// JavaScript Document

function ampliar_foto(imagen){
	window.open(imagen,"image","width=600, height=400");
}

function ampliar_foto2(imagen, posicion){
	if (posicion=="h")
		window.open(imagen,"image","width=600, height=400");
	if (posicion=="v")
		window.open(imagen,"image","width=400, height=600");
}

function popUp(url,ancho,largo) {
	//var destino = "http://localhost/bp/hoteles/" + url;
	var destino = "/bp/hoteles/" + url;
	window.open(destino,"win","toolbar=0,location=300,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+ancho+",height="+largo+"");
}

function construccion(idioma){
	abrepop("/bp/common/enconstruccion_pop.jsp?idioma="+idioma, 380, 150);
	//window.open("/bp/common/enconstruccion_pop.jsp?idioma="+idioma,"win","toolbar=0,location=300,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=380,height=150");
}

function abrepop(pagina, ancho, alto, barras){
	
	var ventana;
	if (barras=="undefined"){
		barras=0;
	}
	
	if (ancho < 460) ancho=460;
	
	var izquie = (screen.width) ? (screen.width-ancho)/2 : 0;
	var arriba = (screen.height) ? (screen.height-alto)/2 : 0;
	
	if (ventana) ventana.close();//ventana
	window.focus();
	ventana = eval("open('"+pagina+"', '', 'width="+ancho+", height="+alto+", top="+arriba+", left="+izquie+", scrollbars=yes, resizable=0, maximize=0')")
}

function cambiaicono(imagen)
{
	//var iconom=document.images[imagen].src
	var iconom=document.getElementById(imagen).src;
	var longi=iconom.length;
	var termina=iconom.charAt(longi-5)
	var iconom2="";
	
	if (termina==0) {
		iconom2=iconom.substring(0,longi-5) + "1" + iconom.substring(longi-4, longi);
		document.getElementById(imagen).src=iconom2;
		//document.images[imagen].src=iconom2
	} 
	else if (termina==1) {
		iconom2=iconom.substring(0,longi-5) + "0" + iconom.substring(longi-4, longi);
		document.getElementById(imagen).src=iconom2;
		//document.images[imagen].src=iconom2
	}
}

/*function ampliarVR(hotel, virtual, texto){
	//direccion = "/static/images/gallery/" + hotel + "/virtual/gallery_vr.html?vis=/" + virtual;
	var direccion = "/bp/static/gallery_vr.html?" + hotel + "$" + virtual + "$400$300$" + texto;
	window.open(direccion,"virtual","width=410, height=310");
}*/

function pone_Cookie(elemento,expira) {
	setCookie(elemento.name, elemento.value, expira);
}

function carga_cookies() {
  getValueCookie(form1.p_usuario);
  getValueCookie(form1.h_pass);
  getValueCookie(form1.p_password);
  if (form1.h_pass.value != 1){
	form1.r_pass.checked=false;
  }
}
