var baseLocation="";

baseLocation=window.location.href;
//baseLocation="http://127.0.0.1/LG";

function ira(i) {
	document.menu.irpagina.value=i
	document.menu.submit()
}

function recomendar()
{
	//var nuevaVentana = window.open( baseLocation + "/recomendar.asp", "Recomendar", "width=305,height=190,menubar=no,toolbar=no");
	var nuevaVentana = window.open( "recomendar.asp", "Recomendar", "width=305,height=190,menubar=no,toolbar=no");
}

function imprimir(){
	window.print()
}

function cerrar(){
	close();
}

function verMapa(x, y, l1, l2, l3, ciudad)
{
  URLGis = "http://callejero.paginasamarillas.es/sites/home/mapext.asp?x="+x+"&y="+y+"&l1="+escape(l1)+"&l2="+escape(l2)+"&l3="+escape(l3)+"&ciudad="+ciudad;
  var nuevaVentana=window.open(URLGis,"nuevaVentana");
}

function PopUp(img) {
	foto1= new Image();
	foto1.src=(img);
	Control(img);
}
 
function Control(img) {
	if((foto1.width!=0) && (foto1.height!=0)){
		verFoto(img);
	}
	else
	{
		funcion="Control('"+img+"')";
		intervalo=setTimeout(funcion,20);
	}
}

function verFoto(img) {
	ancho=foto1.width+20;
	alto=foto1.height+20;
	cadena="width="+ancho+",height="+alto + "menubar=no,toolbar=no,scrollbars=no,top='+(screen.height/2-100)+',left='+(screen.width/2-200)";
	ventana=window.open(img, "Ampliacion", cadena);
}

function escalar() {
	
	var hcabecera=document.getElementById("hcabecera").offsetHeight;
	var hseparador=document.getElementById("hseparador").offsetHeight;
	var hmenu=document.getElementById("hmenu").offsetHeight;
	var hplantilla=document.getElementById("hplantilla").offsetHeight + 25 + 25; //25 implica el cellsapcing del cuerpo
	var hfooter=document.getElementById("hfooter").offsetHeight;

	var htotal = hcabecera + hseparador + hmenu + hplantilla + hfooter + 10; //10 para hacer un ajuste
	
	if (window.innerHeight) {
		//navegadores basados en mozilla 
		alto = window.innerHeight;
	}
	else
	{ 
  		if (document.body.offsetHeight){ 
   			//Navegadores basados en IExplorer, es que no tengo innerheight 
			alto = document.body.offsetHeight;
		}
		else
		{ 
    		//otros navegadores 
			alto = 1024; 
		} 
	} 

	//var alto=document.body.clientHeight+205; 
	if (htotal < alto) { 
		document.getElementById("main_footer").setAttribute("height", alto-htotal); 
	}
}

