// JavaScript Document

function enviarAmigo(){
var url = document.location.href;
document.location.href='http://www.reservarhotelesconencanto.com/enviarAmigo.php?url='+url;
}

function enviardatos(i,d,h,id_fisica,id_capacidad,n,tarj,totant,tot,id,des,dif){

	if(document.form.enviar.value=="S"){

		/*if(tarj=="Si" && totant > 0){
			location.href="datos1.php?id_hotel=" + i + "&fecha_desde=" + d + "&fecha_hasta=" + h + "&tipo_hab=" + t + "&num_hab=" + n + "&anticipo=" + totant + "&total=" + tot + "&id_idioma=" + id;
		}else{*/
			location.href="paso2.php?id_hotel=" + i + "&fecha_desde=" + d + "&fecha_hasta=" + h + "&id_fisica="+id_fisica+"&id_capacidad="+id_capacidad+"&num_hab=" + n + "&total=" + tot + "&garantia=" + tarj + "&id_idioma=" + id+"&desayuno="+des+"&diferenciaDIAS="+dif;
		//}

	}else{
				switch(id){
						case "0": case "4":
							alert("Acepte el Total de la Reserva.");
							break;
						case "1":
							alert("Accepter le prix de la réservation.");
							break;
						case "2":
							alert("Den Gesamtpreis der Reserve.");
							break;
						case "3":
							alert("Accept the total price of the reserve.");
							break;
					}

				document.form.enviar.focus();
	}
}

function Right(str, n)

/***

		IN: str - the string we are RIGHTing

			n - the number of characters we want to return



		RETVAL: n characters from the right side of the string

***/

{

		if (n <= 0)     // Invalid bound, return blank string

		   return "";

		else if (n > String(str).length)   // Invalid bound, return

		   return str;                     // entire string

		else { // Valid bound, return appropriate substring

		   var iLen = String(str).length;

		   return String(str).substring(iLen, iLen - n);

		}

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  		window.open(theURL,winName,features);
	}
function mailnobot(nm,dm)

{

   mailurl = "mailto:" + nm + "@" + dm;

   window.location = mailurl;

}
function agregar(){
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.hotelespamplona.com/"; 
      var titulo="Hoteles Pamplona";
      window.external.AddFavorite(url,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }
}

/***************************** FUNCIONES FOTOS DE HOTELES *************************************************************/

function seleccionaimagen(camino){
	document.getElementById("imagenIz").innerHTML="<img src='http://www.visitnavarra.info/centraldereservas/hoteles/ima/fotos/grande/" + camino + "' width=205px>";
}

function YY_LS(das, ex, ey, dly, sx, loop, dx, dy){//v4.08
//copyright (c)2000,2001 Yaromat.com
    var s=MM_findObj(das),d=document,c,t,l,ct,cb,cl,cr,ncl,nct,ncr,ncb,doto,sy=sx,yx,yy,st;
    if(!s.ot){s.ot=(d.layers)?s.top:s.style.top;s.ol=(d.layers)?s.left:s.style.left;}
    with(Math)if(d.layers){
        ct=s.clip.top;cb=s.clip.bottom;cl=s.clip.left;cr=s.clip.right;t=s.top;l=s.left;
        yy=abs(round((ct-ey)/sy));dy=round((ey-ct)/yy);
        yx=abs(round((cl-ex)/sx));dx=round((ex-cl)/yx);
        if(yx<1){dx=0}else{yx--};if(yy<1){dy=0}else{yy--};
        s.clip.top=ct+dy; s.clip.bottom=cb+dy;s.top=t-dy;s.clip.left=cl+dx;s.clip.right=cr+dx;s.left=l-dx;
    }else if ((d.all||d.getElementById)&&s.style.clip){
      st=s.style;
        l=parseInt((d.getElementById)?st.left:st.pixelLeft);t=parseInt((d.getElementById)?st.top:st.pixelTop);
        c=st.clip.match(/rect.(\d+)[a-z,A-Z,\s]+(\d+)[a-z,A-Z,\s]+(\d+)[a-z,A-Z,\s]+(\d+).*/);
        ct=c[1]/1;cr=c[2]/1;cb=c[3]/1;cl=c[4]/1;
        yy=abs(round((ct-ey)/sy));yx=abs(round((cl-ex)/sx));
        dx=(yx<1)?0:round(-(cl-ex)/yx);dy=(yy<1)?0:round(-(ct-ey)/yy);
        ncl=cl+dx;nct=ct+dy;ncr=cr+dx;ncb=cb+dy;
        st.pixelTop=t-dy;st.pixelLeft=l-dx;st.left=l-dx;st.top=t-dy;
        eval("st.clip='rect('+nct+' '+ncr+' '+ncb+' '+ncl+')'");yy--;yx--;
    }
    if(s.yyto)clearTimeout(s.yyto);
    if(yy>0||yx>0){doto=true;}else if(dly>-1&&loop==true){
        if(d.layers){s.left=s.ol;s.clip.left=0;s.clip.right=cr-cl;s.top=s.ot;s.clip.top=0;s.clip.bottom=cb-ct;
        }else{eval("st.clip='rect('+0+' '+(cr-cl)+' '+(cb-ct)+' '+0+')'");st.top=s.ot;st.left=s.ol;}
        doto=true;
    }
    if(doto==true)s.yyto=setTimeout("YY_LS(\""+das+"\","+ex+","+ey+","+dly+","+sx+","+loop+","+dx+","+dy+")",dly);
}

function YY_StopLayerfx(){ //v3.09
//copyright (c)1998-2000 Yaromat.com
  var args = YY_StopLayerfx.arguments;var yydiv;
  for (var i=0; i<args.length; i++){
    yydiv=MM_findObj(args[i]);
    if (yydiv&&(document.layers||document.all||document.getElementById)){
      if(yydiv.yyto!=null)clearTimeout(yydiv.yyto);
      if(yydiv.tmtScrollo!=null)clearTimeout(yydiv.tmtScrollo);
    }
  }
}
function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MZ_findObj(n){ //v3.6
        var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
        x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
        }else{x=document.getElementById(n)}return x;
}


var now = new Date(); //now hace falta en los calendarios

now.setDate(now.getDate());

var sTomorrow = new Date();

sTomorrow.setDate(sTomorrow.getDate() + 1);

/************************************************************************************************************/
