// JavaScript Document
function Abrir(url,w,h) {
 leftPos = 0;
 topPos = 0;
 if (screen) {
  leftPos = (screen.width / 2) - w/2;
  topPos = (screen.height / 2) - h/2;
 }
 ventana = window.open(url,'','width='+w+',height='+h+',scrollbars=no,left='+leftPos+',top='+topPos);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function getElement(tag){
	return document.getElementById(tag);
}

function setDisplay(tag, newDisplay){
	getElement(tag).style.display = newDisplay;
}

function openCloseDiv(idTag){
	var divElem = getElement(idTag);
	var newDisplayValue;
	if (divElem.style.display == 'none'){
		newDisplayValue = '';
	}
	else{
		newDisplayValue = 'none';
	}
	setDisplay(idTag, newDisplayValue);
}

function openCloseFaq(idTag){
	openCloseDiv("tr_faq_"+idTag);
	var imgElem = getElement("img_faq_"+idTag);
	var openImage = 'img/layout/bt_abrir.jpg';
	var cerrarImage = 'img/layout/bt_cerrar.jpg';
	if (imgElem.className == 'open'){
		imgElem.src = cerrarImage;
		imgElem.className = 'close';
	}
	else{
		imgElem.src = openImage;
		imgElem.className = 'open';
	}
}

function popUp(URL,SCROLL,ANCHO,ALTO) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" +SCROLL+ ",location=0,statusbar=0,menubar=0,resizable=0,width=" +ANCHO+",height="+ALTO+"');");
}

