var timerOn = false;
var timecount = 1000;
var timerID = null;

function timer_start() {
	if (timerOn == false) {
		timerID = setTimeout("show_menu()" , timecount);
		timerOn = true;
	}
}

function timer_stop() {
	if (timerOn) {
		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

	//browsercheck...
function GL_checkBrowser(){
	this.dom= (document.getElementById);

		// detect version (even if Opera disguises as Mozilla or IE)
	if (op = (navigator.userAgent.indexOf("Opera")>-1))	{
		switch (parseInt(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6)))	{
			case 5:
			case 6:
				this.op5= true;
				break;
			case 7:
			case 8:
				this.op7= true;
				break;
			default:
				this.op4= true;
		}
	}
	this.konq=  (navigator.userAgent.indexOf("Konq")>-1);
	this.ie4= (document.all && !this.dom && !op && !this.konq);
	this.ie5= (document.all && this.dom && !op && !this.konq);
	this.ie6= (this.ie5);
	this.ns4= (document.layers && !this.dom && !this.konq);
	this.ns5= (!document.all && this.dom && !op && !this.konq);
	this.ns6= (this.ns5);
	this.bw=  (this.ie4 || this.ie5 || this.ns4 || this.ns6 || this.konq || op);

	return this;
}
bw= new GL_checkBrowser();

function GL_getObj(obj){
	nest="";
	this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document."+obj):document.getElementById(obj);
	this.css= bw.ns4?this.el:this.el.style;
	this.ref= bw.ns4?this.el.document:document;
	this.x= (bw.ns4||bw.op5)?this.css.left:this.el.offsetLeft;
	this.y= (bw.ns4||bw.op5)?this.css.top:this.el.offsetTop;
	this.height= (bw.ie4||bw.ie5||bw.ns6||bw.op7)?this.el.offsetHeight:bw.ns4?this.ref.height:bw.op4?this.css.pixelHeight:0;
	this.width= (bw.ie4||bw.ie5||bw.ns6||bw.op7)?this.el.offsetWidth:bw.ns4?this.ref.width:bw.op4?this.css.pixelWidth:0;

	return this;
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function show_menu(entry, obj) {
	if (entry) {
		timer_stop();
	}

	if (document.getElementById) {
		document.getElementById('mnu_company').style.visibility = "hidden";
		document.getElementById('mnu_service').style.visibility = "hidden";
		document.getElementById('mnu_se').style.visibility = "hidden";
		
		blah = GL_getObj('full');
		
		if (entry != null && entry.length > 0) {
			w = (blah.width - 1300) / 2;
			
			if (w < 0)
				w = 0;
			pos = findPos(obj);
			mnu = document.getElementById('mnu_' + entry);
			mnu.style.left = pos[0] - w;
			mnu.style.top = pos[1] + 18;
			mnu.style.visibility = "visible"; 
			
		}
	}
}
