function Vacio(){
	for(i=1; i<=3; i++)
		window.document.getElementById('id'+i).style.display='none';
}

function SubMenu(obj,id,x){
	BrowserName = navigator.appName;
	if(BrowserName == "Microsoft Internet Explorer")
		y = 38;
	else
		y = 28;

	if (window.document.getElementById(id).style.display=='')
		window.document.getElementById(id).style.display='none';
	else{
		Vacio();
		window.document.getElementById(id).style.display='';
		window.document.getElementById(id).style.top=findPosY(window.document.getElementById('img_menu'))+y;
		window.document.getElementById(id).style.left=findPosX(window.document.getElementById('img_menu'))+(x);
	}
	obj.style.cursor='pointer';
}

function findPosX(obj){
	var curleft = 0;
	if(obj.offsetParent){
		while(1) {
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	}else if(obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if(obj.offsetParent){
		while(1){
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	}else if(obj.y)
		curtop += obj.y;
	return curtop;
}
