
var mouseX,mouseY,bMouse;

function layercontrol(layername,objectname) {
	// variables
	this.layer = layername;
	this.objectname = objectname;
	//methods
	this.hide=hide;
	this.hidelayer=hidelayer;
	this.show=show;
	eval(this.objectname+"_LAYER_CONTROL_TIMER_ID=0;");
}
function hidelayer() {
	eval("clearTimeout("+this.objectname+"_LAYER_CONTROL_TIMER_ID);");
	if (document.all) {
		document.all[this.layer].style.visibility = "hidden";
	} else if (document.layers) {
		document.layers[this.layer].visibility = "hide";
	} else if (document.getElementById) {
		document.getElementById(this.layer).style.visibility = "hidden";
	}
}
function hide() {
	eval("clearTimeout("+this.objectname+"_LAYER_CONTROL_TIMER_ID);");
	eval(this.objectname+"_LAYER_CONTROL_TIMER_ID=setTimeout(this.objectname+'.hidelayer()',1000);");
	bMouse = false;
}
function show(sety) {
	if(!bMouse)
	{
		Y = mouseMove();
		bMouse = true;
	}
	document.onmousemove=null;
	eval("clearTimeout("+this.objectname+"_LAYER_CONTROL_TIMER_ID);");
	if (document.all) {
		document.all[this.layer].style.visibility = "visible";
		if (!sety) {
			document.all[this.layer].style.pixelTop= Y-20;
		}
	} else if (document.layers) {
		document.layers[this.layer].visibility = "show";
		if (sety) {
			document.layers[this.layer].top = mouseY-20;
		}
	} else if (document.getElementById) {
		document.getElementById(this.layer).style.visibility = "visible";
		if (sety) {
			document.getElementById(this.layer).style.top = mouseY-20;
		}
	}
}

function mouseMove(e){
	if (document.all) { 
		mouseX = event.clientX + document.body.scrollLeft
		mouseY = event.clientY + document.body.scrollTop
	} else {  
		mouseX = e.pageX
		mouseY = e.pageY
	}  
	return mouseY;
}

function getUrlQuery(iIndex)
{
	location.url = /\?.+/.exec(location.href)
	location.url = location.url?(location.url[0].substring(1).split('&')):[];
	if(location.url.length > 0)
	{
		oLocation = location.url[iIndex].split('=');
		return oLocation[1];
	}
	else
	{
		return null;
	}
}
