var timer1, timer2;

function findPosx(obj) {                	
	var curleft = 0;
	curleft = obj.offsetLeft;
	while (obj = obj.offsetParent) {
		curleft += obj.offsetLeft;
	}
	return(curleft);
}

//to find the y position
function findPosy(obj) {					
	var curtop = 0;
	curtop = obj.offsetTop;
	while (obj = obj.offsetParent) {
		curtop += obj.offsetTop;
	}
	return(curtop);
}

function popshow(id,myid){
	pophide();
	var xpos=findPosx(myid)-45;
	var ypos=findPosy(myid)+20;
	var po= new getObj(id);
	var po2 = document.getElementById(id);
	po.style.visibility="visible";
	po.style.top=ypos+"px";
	po.style.left=xpos+"px";
	po2.onmouseout=function(){
		startime();
	}
	po2.onmouseover=function(){
		clearTimeout(timer1);
	}
}

function pophide(){
	//pophide2();
	var	mnu1 = new getObj('mnu_comp');
	mnu1.style.visibility="hidden";
}

function popshow2(id,myid){
	pophide2();
	var xpos2=findPosx(myid)+245;
	var ypos2=findPosy(myid);
	var po3= new getObj(id);
	var po4 = document.getElementById(id);
	po3.style.visibility="visible";
	po3.style.top=ypos2+"px";
	po3.style.left=xpos2+"px";
	po4.onmouseout=function(){
		startime2();
		startime();
	}
	po4.onmouseover=function(){
		clearTimeout(timer2);
		clearTimeout(timer1);
	}
}

function pophide2(){
	var	mnu2_1= new getObj('mnu2_surve');
	mnu2_1.style.visibility="hidden";
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}


function startime(){ timer1=setTimeout('pophide()', 500);}
function startime2(){ timer2=setTimeout('pophide2()', 500);}