// JavaScript Document
//////////////////////////////////////////////////////////////
function verImagen(iIdImagen){
      var windowImagen;
      if (location.href.indexOf("popup")==-1){
        windowImagen = window.open("popup/popupimagen.asp?imagen="+iIdImagen,"Imagen","width=100,height=100,top=10,left=10,scrollbars=yes");
      }else{
        windowImagen = window.open("popupimagen.asp?imagen="+iIdImagen,"Imagen","width=100,height=100,top=10,left=10,scrollbars=yes");
      }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function abrirDocumento(iIdDocumento){
      var windowDocumento;
      windowDocumento = window.open("popup/popupdocumento.asp?documento="+iIdDocumento,"Documento","width=600,height=450,top=10,left=10,scrollbars=yes,toolbar=yes,location=no,menubar=yes,resizable=yes");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function redireccionar(MP){
	location.href="interior.asp?MP="+MP	
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*function resolucion(){
	var xmlHttp
		
	if (window.ActiveXObject){ 
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
		xmlHttp.open("GET", "http://www.femetal.es/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
		xmlHttp.send();		
	}else { 
		xmlHttp = new XMLHttpRequest();
		xmlHttp.open("GET", "http://www.femetal.es/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
		xmlHttp.send(null);
	}
}*/

function resolucion(iResolucion){
	var xmlHttp
	if (iResolucion == 0) {
		if (window.ActiveXObject){ 
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
			//xmlHttp.open("GET", "http://rodiles/femetal/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.open("GET", "http://www.femetal.es/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.send();
		}
		else { 
			xmlHttp = new XMLHttpRequest();
			//xmlHttp.open("GET", "http://rodiles/femetal/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.open("GET", "http://www.femetal.es/resolucion.asp?resolucion="+screen.width+"*"+screen.height, false);
			xmlHttp.send(null);
		}
		
		var i;
		var screenW = screen.width;
		var screenH = screen.height;
		var host = location.host;
		for (i=0;i<document.links.length;i++) {
			enlace = document.links[i].href;
			// Eliminar aquellos enlaces externos que, por lo tanto, no nos van a ayudar a obtener la resolución			
			// eso lo hacemos mediante "host". Consideramos externo todo aquél enlace que no contenga "host"
			if ((enlace.indexOf("javascript") == -1)&&(enlace.indexOf(host) != -1)) {
				// además que no se añada a los enlaces "falsos" y a los que no tienen otros parámetros
				if ((enlace.indexOf("?") != -1)&&(enlace.indexOf("#void") == -1)) {
					document.links[i].href=document.links[i].href+'&resolucion='+screenW+'*'+screenH;
				}
			}
		}
		
	}
}