var empresa="Hotel Abril";
function lib_bwcheck(){ 
this.ver= parseInt(navigator.appVersion);
var agt=navigator.userAgent.toLowerCase();
this.dom=document.getElementById?1:0
this.mac=agt.indexOf("mac")>-1;
this.pc=agt.indexOf("win")>-1;
this.linux=agt.indexOf("mac")==-1 && agt.indexOf("win")==-1;
this.ns= agt.indexOf("netscape")>-1;
this.ns4 = (this.ns && (this.ver == 4));
this.ns4up =(this.ns && (this.ver > 4));
this.ns7=agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1;
this.ns6=agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1;
this.ies     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.ie4    = (this.ies && (this.ver == 4) && (agt.indexOf("msie 4")!=-1) );
this.ie  = (this.ies  && (this.ver >= 4));
this.ie5    = (this.ies && (this.ver == 4) && (agt.indexOf("msie 5.0")!=-1) );
this.ie5_5  = (this.ies && (this.ver == 4) && (agt.indexOf("msie 5.5") !=-1));
this.ie5up  = (this.ies  && !this.ie3 && !this.ie4);
this.ie5_5up =(this.ies && !this.ie3 && !this.ie4 && !this.ie5);
this.ie6 =(this.ies && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
this.safari=this.mac && agt.indexOf("safari")!=-1;
this.macie=(this.mac && this.ie5up);
this.ie6 = (this.ies && (this.ver == 4) && (agt.indexOf("msie 6.")!=-1) );
this.opera7=agt.indexOf("opera 7")>-1;
this.opera6=agt.indexOf("opera 6")>-1;
this.operadown=agt.indexOf("opera 5")>-1;
this.mozilla=(this.ver >=5) && (agt.indexOf('mozilla')!=-1) && (agt.indexOf('gecko')!=-1);
this.konqueror=(agt.indexOf('konqueror')!=-1);
this.firefox=this.mozilla && (agt.indexOf('firefox')!=-1);
if(this.firefox){var versfirefox=parseFloat(agt.match(/firefox[\/\s](\d+([\.-]\d)*)/)[1]) > parseFloat("0.9")?1:0;}
this.firefox09up=versfirefox && this.firefox;
this.bw=(this.ie5up ||this.ns4up||this.opera7||this.firefox||this.mozilla||this.safari||this.konqueror)
return this
}

bw=new lib_bwcheck() //Browsercheck object

function lib_message(txt){alert(txt); return false}
function lib_obj(obj,nest){ 
 this.nested="";
if(bw.ns4 && nest){ //get nested
nest="n "+nest;
nest=nest.split(' ');
for(var i=1;i<nest.length;i++) this.nested+="document."+nest[i]+".";}
this.evnt=bw.ns4?eval(this.nested+'document.layers["'+obj+'"]'):bw.ie4?eval('document.all["'+obj+'"]'):
bw.dom?eval('document.getElementById("'+obj+'")'):0;
  if(!this.evnt) return lib_message('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!')
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document
    this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0
  }

//Writing content to object ***
lib_obj.prototype.writeIt = function(text,startHTML,endHTML){
	if(bw.ns4){
    if(!startHTML){startHTML=""; endHTML=""}
	  this.ref.open("text/html"); 
    this.ref.write(startHTML+text+endHTML); 
    this.ref.close()
	}else this.evnt.innerHTML=text
}
function Imagen(imagen, nombre_ventana, pie, dimensiones, ancho, alto,fondo,fuente) { 
var codHTML = "";
fondo=fondo==null?"#FFFFFF":fondo;
fuente=fuente==null?"#000000":fuente;
var ventana;
       posx= (screen.width-ancho)/2;
     posy= (screen.height-alto)/2;
dimensiones+=',top='+posy+',left='+posx;
ventana = window.open("/blanco.html",'',dimensiones,"resizable=0,scrollbars=no");
codHTML += '<HTML><HEAD><TITLE>';
codHTML += nombre_ventana;
codHTML += '</TITLE><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD><style type="text/css">body{margin:0px}.piefoto{	font-size:10px; color:#'+fuente+';font-family:Verdana;background:'+fondo+'}</style><BODY onblur="javascript:window.close()" onclick="javascript:window.close()" bgcolor="FFFFFF" leftMargin=0 text=000000 topMargin=0 marginwidth="0" marginheight="0">';
codHTML += '<IMG SRC="' + imagen + '" WIDTH=' + ancho + ' HEIGHT=' + alto + ' ALT="" BORDER="0">';
codHTML += '<BR><table width="' + ancho + '" border="0" cellspacing="0" cellpadding="5"><tr align="right"><td  class=piefoto><div align=justify>';
codHTML += pie+'</div>';
codHTML += '</td></tr></table>';
codHTML += '</BODY></HTML>';
ventana.document.open();
ventana.document.write(codHTML);
ventana.document.close();
}
function popUp(winName,fotoName,scroll,menu,centrar,ancho,alto,posy,posx,escribir) {
if(escribir!=''){
ancho=ancho+5;
alto=alto+5;
}
if(scroll!=''){
lavariable='scrollbars='+scroll}
if(menu!=''){
lavariable+=',menubar='+menu}
if(ancho!=''){
lavariable+=',width='+ancho+'px'}
if(alto!=''){
lavariable+=',height='+alto+'px'}
if(posy!=''){
lavariable+=',top='+posy;}
if(posx!=''){
lavariable+=',left='+posx}

//es obligatorio llamar a las anteriores variables si se quiere llegar a una posterior
//ejemplo:popUp('abrepocoapoco.html','Titulo','no','no','yes',1,1,'','','')
if(centrar!=''){
       posx= (screen.width-ancho)/2;
     posy= (screen.height-alto)/2;
  lavariable+=',top='+posy+',left='+posx;}
ventana=open(winName,fotoName,lavariable); 
}


function Ventana(url,ancho, alto)

{
       posx= (screen.width-ancho)/2;
     posy= (screen.height-alto)/2;

if(posy<0){posy=0}
if(posx<0){posx=0}
dimensiones='width='+ancho+',height='+alto+',top='+posy+',left='+posx;
ventana = window.open(url,'',dimensiones,",menubar=0,scrollbars=1,resizable=0");
 ventana.focus();
  onscreen=true;
}

var mySwf;
var pluginversion;

function Flash_mozillaPlugin(){
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]        || navigator.plugins["Shockwave Flash"]) {
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
if(flashVersion>=minPlayer){return true;}
    }
  }
}
// vbscript check for Flash ActiveX control in windows IE
if(bw.ie) {
  document.write(
    '<script language=VBScript>' + '\n' +
    'Function Flash_checkForActiveX()' + '\n' +
    'Dim hasPlayer, playerversion' + '\n' +
    'hasPlayer = false' + '\n' +
    'playerversion = 10' + '\n' +
    'Do While playerversion >= minPlayer' + '\n' +
    'On Error Resume Next' + '\n' +
    'hasPlayer = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & playerversion & \"\")))' + '\n' +
    'If hasPlayer = true Then Exit Do' + '\n' +
    'playerversion = playerversion - 1' + '\n' +
    'Loop' + '\n' +
    'if hasPlayer = true Then Flash_checkForActiveX = playerversion else Flash_checkForActiveX = hasPlayer' + '\n' +
    'End Function' + '\n' +
    '<\/script>'
  );
}

function Flash_checkForMinPlayer() {
  if(bw.ie) return (Flash_checkForActiveX())
  else{
  return (Flash_mozillaPlugin());
  }
  ;
}
var count=0
var documentflash=new Array();
function Flash_embedSWF(srcURL,idi,ancho, alto) {
count++;
documentflash[count]= '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
'codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=7,0,0,0"' 
+  'ID="' + idi +'" WIDTH="'+ancho+'" HEIGHT="'+alto+'">' +
    '<PARAM NAME="movie" VALUE="' + srcURL + '">' + 
    '<PARAM NAME="quality" VALUE="best">' +
    '<embed src="' + srcURL + '" quality="high" bgcolor="#ffffff"' 
	+ 'width="'+ancho+'" height="'+alto+'"' +
    'type="application/x-shockwave-flash" NAME="' + idi + '"' +
'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></OBJECT>'
}
	
//----------------------------------fuentes y estilo
			var title=2;	var guardasize=2;
function setActiveFont(title2, reset,comienzo) {
  var i, a, main;
 if (typeof(title2)=="number" && title2!=2){
			if(comienzo!=1){
				title=Number(title)+Number(title2)
			}
			if(title<=0){
				title=1;
			}
			if(title>=5){
				title=4
			}
guardasize=title;
}
else{
	title=title2;
}

  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("title").indexOf("css")!=0) && (a.getAttribute("media")!="print")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) 
		{a.disabled = false;
		if(title!=2){title=guardasize;}
		}
    }
  }
  if(reset==1){
	  createCookie("stylefuentes", title, 365);
	  }
}

function setActiveCSS(titleCSS, reset,comienzo) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if((a.getAttribute("rel").indexOf("style") != -1) && a.getAttribute("title").indexOf("css")!=-1){
      a.disabled = true;
      if(a.getAttribute("title") == titleCSS) 
		{a.disabled = false;}
    }
  }
  if(reset==1){
	  createCookie("stylecss", titleCSS, 365);
	  }
}

function setStyle() {
	var style = readCookie("stylefuentes");
	if (style != null) {
			setActiveFont(style,0,1);
	}
}

function setStylecss() {
	var style = readCookie("stylecss");
	if (style != null) {
		setActiveCSS(style,0,1);
	}

}


function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = ";expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+";path=/;";
}


function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function fixEstilos(){
setStylecss();
setStyle();
}
fixEstilos();

//--------------
function sendrequest(numero,accion){
comment(empresa);
if (accion){document.formse.action=accion}
document.formse.id.value=numero;
document.formse.submit();
}

//---------------------enseñar tooltip
function showtip(current,text){
if (document.all||document.getElementById){
thetitle=text.split('<br>')
if (thetitle.length>1){
thetitles=''
for (i=0;i<thetitle.length;i++)
thetitles+=thetitle[i]
current.title=thetitles
}else
current.title=text
}}

//-------------window.status
function comment(comentario){
window.status=comentario;
}
function uncomment(){
window.status=empresa;
window.defaultStatus=empresa;
}
if(bw.ie){
window.defaultStatus=empresa}
else{
window.status=empresa;
}
//--------mouseovers con javascript
function cargarimagenes() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=cargarimagenes.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
	function volver() { 
				var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}

			function MM_findObj(n, d) {
				var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
				d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
				if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
				for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
			}
			function vermov() {
				var i,j=0,x,a=vermov.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
				if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
			}
//mouseovers con css--------------------------
function changeClass(capa1,laclase1,laclase2){
args=changeClass.arguments;
argslen3=changeClass.arguments.length/3;
j=0
for (i=0;i<argslen3;i++){
capa=document.getElementById(args[j]);
if(capa.className==args[j+1]){
capa.className=args[j+2];
}else{
capa.className=args[j+1];
}
j+=3;
}
}
//----------------------
var msgAlert;
function comprobarform(formobj,funcion){
	// dialog message

	var alertMsg = typeof(msgAlert)=="undefined"?"Por favor rellene los siguientes campos:\n":msgAlert;
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
if(alertMsg.length == l_Msg && fieldEmail[i]==1 && validateEmail(obj.value)==false){
alertMsg='Por favor, compruebe que el e-mail que ha escrito en --'+fieldDescription[i]+'-- se compone de: nombredeusuario+@+dominio+.+extensión. Por ejemplo: nombreusuario@servidordecorreo.com';
break
}	
	}

if (alertMsg.length == l_Msg){//<if-1
args=comprobarform.arguments;
argsLen=comprobarform.arguments.length;
for (i=1;i<argsLen;i++){//<for-2
if(args[i]!=""){//<if-3
funcion=args[i];
if(funcion(formobj)){//<if-4
}
else{return false;
break}//>if-4

}//>if-3
}//>for-2
lacapa.writeIt('<strong>Enviando...</strong>');
formobj.submit();


}
	else{
		alert(alertMsg);
		return false;
	} 
}
function iguales(formobj){
if(formobj.elements[losiguales[0]].value==formobj.elements[losiguales[1]].value){
return true
}else{
alert("Por favor compruebe que "+losigualesDescripcion[0]+" y "+losigualesDescripcion[1]+" son iguales");
return false
}
}

function unoden(formobj){
argsLen=unodeN.length;
for (i=0;i<argsLen;i++){//<for-2
if(formobj.elements[unodeN[i]].value!=""){
return true;
break;
}}
alert("Por favor compruebe que ha elegido una opción de "+unodeNDescripcion);
return false;
}

function validateEmail(formobj)
{

// 5_12_2006: Ahora no permitimos enviar correos a varios destinatarios
if (formobj.indexOf(';') > -1)
{
	return false;
}

splitted = formobj.match("^(.+)@(.+)$");
    var regexp_user=/^\"?[\w-_\.]*\"?$/;
    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;	 
						    if(splitted==null || (splitted[1] != null && splitted[1].match(regexp_user) == null) || (splitted[2] != null && splitted[2].match(regexp_domain) == null && splitted[2].match(regexp_ip) == null))
							{ 						
return false;							}					
							return true;	
}
//--------Busqueda
function PostBack(formulario,url,valores)
  {
var FunArg=PostBack.arguments;
var LenArg=PostBack.arguments.length;
for (var i=2; i < LenArg; i+=2) {
 document.forms[formulario][FunArg[i]].value=FunArg[i+1];
   }
if(url!=""){
	document.forms[formulario].action=url;
	}
   document.forms[formulario].submit()
	 }
	 
function desplegar(lacapa){
if (document.getElementById(lacapa).style.display==""){
document.getElementById(lacapa).style.display="block"
return true;
}
else{
document.getElementById(lacapa).style.display=""
}
}
function enfocar(lacapa,formulario,mover){
if(desplegar(lacapa)){
window.location.href="#containerRecomienda";
formulario.focus();
if(mover!=null){window.scrollBy(0,mover);}}}

function popPrint(){
popUp('','Titulo','yes','no','yes',520,400,'','','')
ventana.document.open();
textoW="<html><head><meta http-equiv='Content-Type' content='text/html;charset=iso-8859-1'><title>"+empresa+"</title><link href='css/print.css' type='text/css' rel='stylesheet' title='impresion'><body>"
ventana.document.write(textoW);
ventana.document.write(document.body.innerHTML);
ventana.document.write("</body></html>");
ventana.document.close();
}	 

function keyPressed(e,codigo,funcion,argumentos)
{
	try{
	if (!e) var e = window.event;
    if( typeof( e.which ) == 'number' ) {
         e = e.which;
    } else if( typeof( e.keyCode ) == 'number'  ) {
        //IE, NS 6+, Mozilla 0.9+
        e = e.keyCode;
    } else if( typeof( e.charCode ) == 'number'  ) {
        //also NS 6+, Mozilla 0.9+
        e = e.charCode;
    } 
    if(codigo && funcion && e==codigo){
	 funcion(argumentos)
	 }
	 }
catch(e){}
}

function resetear(){
campos=Array("INPUT","SELECT","TEXTAREA");
tipoexcluido=Array("hidden");
tipoexcluidolen=tipoexcluido.length;
	for(h=0;h<campos.length;h++){
	elementoslen=document.getElementsByTagName(campos[h]).length;
		for(i=0;i<elementoslen;i++){
			for(j=0;j<tipoexcluidolen;j++){
					if(document.getElementsByTagName(campos[h])(i).getAttribute("type")!=tipoexcluido[j]){
					document.getElementsByTagName(campos[h])(i).value="";
					}
			}
		}
	}
}