// JavaScript Document

pf = {};

function slide (href) {
	li = href.parentNode; ul = li.parentNode; id = ul.id; _pf = pf[id]; _new = parseInt(href.innerHTML) - 1;
	
	_sel = ul.getElementsByTagName("li")[_pf.selected];
	_sel.innerHTML = '<a href="#" onclick="return slide(this);">' + (_pf.selected + 1) + '</a>';
	_sel.className = '';
	
	pf[id].selected = _new;
	
	li.innerHTML = href.innerHTML;
	li.className = 'currentpage';
	
	
	document.getElementById(id + "_image").src = _pf.images[_new];
	
	return false;
	
	//console.log (_new);
}


function pf_open (id) {

	img = pf[id].fullimg[pf[id].selected];
	window.open(img,'wndImg');	
	//console.log (img);
	
	
	return false;
}



var topMenu = new Array()
var TimeOut = 400;
var Timer;
var vis_cid = '';
var vis_id = '';

function hide() {
	resetTimer(); 
	Timer = setTimeout("hideVisible()", TimeOut);
}
function resetTimer() {
	clearTimeout(Timer); 
	Timer = null;
}

function menu(n) {
	d = document.getElementById('sublevel_'+n);
	for (i=0; i<topMenu.length; i++) {
		if (topMenu[i] != n) {
			tmp = document.getElementById('sublevel_'+topMenu[i]);
			tmp.style.display = 'none';
		}
	}

	if (d.style.display == 'block') {
		d.style.display = 'none';
	} else {
		d.style.display = 'block'
	}
}

function show(cid, id) {
	if (id != vis_id && vis_id != '') {
		hideVisible();
	}
	clearTimeout(Timer); 
	vis_cid = cid;
	vis_id = id;
//	alert(cid);
	c = document.getElementById('sublevel_'+cid);
	p = document.getElementById('subrow_'+id);
//	alert('|'+id+'|');
	d = document.getElementById('float_'+id);
//	alert(d);
//	alert(c.getElementsByTagName('div').item(0).offsetTop);
	x = p.offsetWidth + p.offsetLeft;
	y = p.offsetTop + c.offsetTop - c.getElementsByTagName('div').item(0).offsetTop;
	d.style.left = x+8;
	d.style.top = y+188;
	d.style.display = 'block';
//	alert(d.style.top);
//	if()
}

function hideVisible() {
  if(vis_id==0) return;
  d = document.getElementById('float_'+vis_id);
  d.style.display = 'none';
  vis_id=0;
}
function ow(loc,height,width)
{
  return window.open(loc,null,'height='+height+',width='+width+',left=200,top=200,status=no,toolbar=no,menubar=no,location=no');
} 