
var imagen=new Image();


function mostrar(save,alt)
{
  winWidth=imagen.width;
  winHeight=imagen.height;
  winLeft= (screen.width) ? (screen.width-winWidth)/2 : 0;
  winTop= (screen.height) ? (screen.height-100-winHeight)/2 : 0;
  winset="menubar=0,status=0,width="+winWidth+",height="+winHeight+",titlebar=no";
  winset+=",top="+winTop+",left="+winLeft;
  var aux=open("","",winset);
  
  
  aux.document.writeln("<HTML><HEAD><TITLE>PiscinaFacil.es</TITLE>");    
  aux.document.writeln("<BODY bgcolor='#ffffff' leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><CENTER>");
  aux.document.writeln("<img  src='"+imagen.src+"' alt='"+alt+"' >");
  aux.document.writeln("</CENTER></BODY></HTML>");
}

function EsperaCarga(save1,alt1)
{
 if (imagen.width>1 && imagen.height>1) 
    {//alert(imagen.width+"///"+imagen.height);
	 mostrar(save1,alt1);
	 return true} 
  else { setTimeout('EsperaCarga('+save1+',"'+alt1+'")', 200);}
}

function Verfoto(url,save,alt)
//url -> Directorio en el que se encuentra la imagen desde la home
//save -> Booleano que indica si se puede salvar con el boton derecho o no
//alt -> Texto alternativo de la imagen
{
  //var base="http://www.findfine.com/"
  imagen.width=0;
  imagen.height=0;
  imagen.src=eval('document.getElementById("imagen").value');
  EsperaCarga(save,alt);
}


function revisa_provincia(provincia)
{
if (provincia==8)
{
  if (document.getElementById('control').value==0)
  {
  alert('Los envíos a las Islas Baleares han de ser valorados de forma independiente, dependiendo del peso y volumen de los mismos.\n\nPuede realiazr su pedido seleccionando como forma de pago Transferencia o Ingreso Bancario, contactaremos con usted para indicarle el coste del envío.');
  document.pedidos.formapago.options[0] = null;
  document.getElementById('control').value=1;
  }
}
else
{
  if (document.getElementById('control').value==1)
  {
  document.forms.pedidos.formapago.options[0]=new Option('Tarjeta de Credito',1,'defaultSelected');
  document.forms.pedidos.formapago.options[1]=new Option('Transferencia o Ingreso bancario',2);
  document.getElementById('control').value=0;
  }
}
}