function getAbsoluteElementPosition(element) {
	if (typeof element == "string")
		element = document.getElementById(element)
		
	if (!element) return { top:0,left:0 };
		
	var y = 0;
	var x = 0;
	while (element.offsetParent) {
		x += element.offsetLeft;
		y += element.offsetTop;
		element = element.offsetParent;
	}
	return {top:y,left:x};
}
/* -- func para soportar el hover en FF y IE ------------------------------------------------*/
loadGeneric = function() { startList(); }
loadGenericCol = function() { startList(); startListMenuInner(); }
function startList()
{	
	if (document.all&&document.getElementById) 
	{	//Forzamos el rollOver para IE del primer nivel de menú
	
		navRoot = document.getElementById("main");
		for (i=0; i<navRoot.childNodes.length; i++) 
		{	node = navRoot.childNodes[i];
			if (node.nodeName=="LI") 
			{	node.onmouseover=function()	
				{	this.className+=" over"; 
				}
				node.onmouseout=function() 	{	this.className=this.className.replace(" over", "");	}
				node = node.childNodes[0]
			}
		}

		//Forzamos rollOver para IE en todos los supApartados del todas las secciones	
		 for(x=1; x<=4;x++)
		 {		navRoot= document.getElementById("sub" + x);	
				for (i=0; i<navRoot.childNodes.length; i++)
				{	node = navRoot.childNodes[i];
					if (node.nodeName=="LI") 
					{	
						node.onmouseover=function()	{	this.className+=" over"; }
						node.onmouseout=function() 	{	this.className=this.className.replace(" over", "");	}
					}
				}
		 }
	}
	
	if (navigator.appName == "Microsoft Internet Explorer") 
{

	//Array of elements to be replaced
	var arrElements = new Array(3);
	arrElements[0] = "object";
	arrElements[1] = "embed";
	arrElements[2] = "applet";	
	
	//Loop over element types
	for (n = 0; n < arrElements.length; n++) 
	{	
		//set object for brevity
		replaceObj = document.getElementsByTagName(arrElements[n]);
		
		//loop over element objects returned
		for (i = 0; i < replaceObj.length; i++ ) 
		{
			//set parent object for brevity
			parentObj = replaceObj[i].parentNode;
			
			//grab the html inside of the element before removing it from the DOM
			newHTML = parentObj.innerHTML;			
			
			//remove element from the DOM
			parentObj.removeChild(replaceObj[i]);
				
			//stick the element right back in, but as a new object
			parentObj.innerHTML = newHTML;			
		
		}
	}
}
	
}

function startListMenuInner()
{	
	if (document.all&&document.getElementById) 
	{	if(document.getElementById("listaSubNivel") != null)
		{
			navRoot2 = document.getElementById("listaSubNivel").childNodes[0];
			for (i=0; i<navRoot2.childNodes.length; i++) 
			{	node = navRoot2.childNodes[i];
				if (node.nodeName=="LI") 
				{	node.onmouseover=function()	{	this.className+=" over"; }
					node.onmouseout=function() 	{	this.className=this.className.replace(" over", "");	}
				}
			}
		}
	}
}


var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{  if(popUpWin)
  {    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function acceptConditions(obj){
	var boton = document.getElementById("btnEnviar");
	if (obj.checked == true){
		boton.disabled = false;
		boton.className = "boton";
	} else {
		boton.disabled = true;
		boton.className = "boton_disabled";
	}
}

