function window_open(psURL,psName,pnWidth,pnHeight,pnTop,pnLeft,pbScroll){
	var nLeft=pnLeft || Math.round((window.screen.width-pnWidth)/2);
	var nTop=pnTop || Math.round((window.screen.height-pnHeight)/2)-20;	
	if (psName=="") psName=null;
	var oWindow=window.open(psURL,psName,"top="+nTop+",left="+nLeft+",height="+pnHeight+",width="+pnWidth+",status=no,toolbar=no,menubar=no,location=no,resizable=no"+((pbScroll)?",scrollbars=yes":""));
	oWindow.focus();
}

function window_open_resize(psURL,psName,pnWidth,pnHeight,pnTop,pnLeft,pbScroll){
	var nLeft=pnLeft || Math.round((window.screen.width-pnWidth)/2);
	var nTop=pnTop || Math.round((window.screen.height-pnHeight)/2)-20;	
	if (psName=="") psName=null;
	var oWindow=window.open(psURL,psName,"top="+nTop+",left="+nLeft+",height="+pnHeight+",width="+pnWidth+",status=no,toolbar=no,menubar=no,location=no,resizable=yes"+((pbScroll)?",scrollbars=yes":""));
	oWindow.focus();
}


function write_page_image(ps_imagen,nWidth){
	if (ps_imagen){
		var nHeight=(ps_imagen.indexOf("_1")!=-1)?90:55;
		document.write("<img src=\"../comun/img/niveles/"+ps_imagen+"\" width=\""+nWidth+"\" height=\""+nHeight+"\">");
	}
}
function js_trim(ps_cadena){
//Quita los espacios al inicio y al final de una cadena (ps_cadena)
	return(ps_cadena.replace(/(^\s+)|(\s+$)/g,""));
}
function on(po_src, ps_clase) {    
	po_src.className=ps_clase;
}  
function recarga(){
	document.location.href=document.location.href
}

// Adaptación WAI - La función que existía en el js MenuIzq
function menu_hover(poElement,psClass){	
	if (!document.layers){
		if (!psClass) psClass=sOldClass;
		var oElements=(document.all)?poElement.children:poElement.childNodes;
		sOldClass=oElements[2].className;
		oElements[1].className="sp "+psClass;
		oElements[2].className=psClass;
		oElements[3].className="sp "+psClass;
	}
}
// Adaptación WAI - Las funciones que existían en el js MenuDer
function menu_hover2(poElement,psClass){	
	if (!document.layers){
		if (!psClass) psClass = sOldClass2;
		var oElements = (document.all) ? poElement.children : poElement.childNodes;
		sOldClass2 = oElements[4].className;
		oElements[1].className="sp " + psClass;
		oElements[2].className="sp " + psClass;
		oElements[3].className="sp " + psClass;
		oElements[4].className=psClass;
	}
}
function toUrl(poSelect){
	var sURL=poSelect.options[poSelect.options.selectedIndex].value
	if (sURL) window.location.href=sURL;
}

// Funcion para abrir os popups de online
function popUp(URL) {
day = new Date();
id = day.getTime();
myWidth=732;
myHeight=500;
var myLeft = (screen.width-myWidth)/2;
var myTop = (screen.height-myHeight)/2;
var features='toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width='+myWidth+',height='+myHeight+',left ='+myLeft+',top ='+myTop;
//eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=732,height=500,left = 122,top = 94');");
eval("page" + id + " = window.open(URL, '" + id + "', features);");
}

function FullscreenURL(url, nombre){
	if (window.screen){
		var hori=screen.availWidth-8;
		var verti=screen.availHeight-30;
		window.open(url,nombre, 'width='+hori+',height='+verti+', scrollbars=0,left='+(0)+',top='+(0));
	}
}
function FullscreenLoad(){ 
	if (window.screen){ 
		var hori=screen.availWidth; 
		var verti=screen.availHeight;
		try {
		flash = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		} catch(ex) {
		flash = false;
		}
		if (flash) {
			FullscreenURL('http://server-uk.imrworldwide.com/cgi-bin/b?cg=clicks&ci=es-correos&tu=http://www.correos.es/comun/GuiaProductos09/0811-GuiaProductos09.asp', 'guia09');
		} else {
			window.location = '/comun/tarifaspdf08/0811-tarifaspdf.asp';
		}
	} 
} 
