//funciones de paquetes
var cF=document.all.CalFrame; 
var cW=window.frames.CalFrame;
var g_tid=0;
var g_cP,g_eD,g_eDP,g_dmin,g_dmax,g_htm;

/*Arma las fechas por default en formato ingles
strStartDate - para el primer textbox
strEndDate - para el segundo texbox mas un dia.*/
var dtDate = new Date(new Date().valueOf() + 1814400000);
var strStartDate = (dtDate.getMonth() + 1) + '/' + dtDate.getDate() + '/' + dtDate.getFullYear() + '';

var dtEndDate = new Date(new Date().valueOf() + 1987200000);
var strEndDate = (dtEndDate.getMonth() + 1) + '/' + dtEndDate.getDate() + '/' + dtEndDate.getFullYear() + '';

/*En esta parte define a la variable d como el html del cliente de donde
fue llamado el calendario,
y le asigna fechas por default a los textboxes*/
d=document.forms;
d.PkgFormWithFlight.FromDate.value = strStartDate;
d.PkgFormWithFlight.ToDate.value = strEndDate;

function CB(){event.cancelBubble=true}

function SCal(cP,eD,eDP,dmin,dmax,htm){
   clearTimeout(g_tid);
   var s=(g_eD==eD);
   g_cP=cP;
   g_eD=eD;
   g_eDP=eDP;
   g_dmin=dmin;
   g_dmax=dmax;
   g_htm=htm;
   WaitCal(true,s);
}

function CancelCal(){
	clearTimeout(g_tid);
	if (typeof cF != "undefined" && cF != null) //Existe document.all.CalFrame
		cF.style.display="none";
}

function WaitCal(i,s)
{
   if(null==cW.g_fCL || false==cW.g_fCL)
	{if(i){
		if(s&&"block"==cF.style.display){
			cF.style.display="none";return;
		}
       cW.location.replace(g_htm);
       PosCal(g_cP);cF.style.display="block";
     }
     g_tid=setTimeout("WaitCal()", 200);
   }else {
   cW.DoCal(g_cP,g_eD,g_eDP,g_dmin,g_dmax);
   }
}

function PosCal(cP){var dB=document.body;var eL=0;var eT=0;for(var p=cP;p&&p.tagName!='BODY';p=p.offsetParent){eL+=p.offsetLeft;eT+=p.offsetTop;}var eH=cP.offsetHeight;var dH=cF.style.pixelHeight;var sT=dB.scrollTop;if(eT-dH>=sT&&eT+eH+dH>dB.clientHeight+sT)eT-=dH;else eT+=eH;cF.style.left=eL;cF.style.top=eT;}
function GetDowStart() {return 0;}
function GetDateFmt() {return "mmddyy";}
function GetDateSep() {return "/";}

function ShowCalendar(eP,eD,eDP,dmin,dmax){
   var htm="/_lib/java/cal_esp.htm";
   SCal(eP,eD,eDP,dmin,dmax,htm);
}

function chkBrowser(){this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;/*this.ie4=(document.all && !this.dom)?1:0;*/this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.bVer=(this.ie5 || this.ie4 || this.ns4 || this.ns5);return this;}bVer=new chkBrowser();ns4 = (document.layers)? true:false;/*ie4 = (document.all)? true:false;*/
function AttB(f){if(bVer.ie4)f.style.display='block';}
function AttN(f){if(bVer.ie4)f.style.display='none';}
function show(idLayer,idParent){cLayer=bVer.dom?document.getElementById(idLayer).style:/*bVer.ie4?document.all[idLayer].style:*/bVer.ns4?idParent?document[idParent].document[idLayer]:document[idLayer]:0;cLayer.display='block';var d=document.Wiz;}
function hide(idLayer,idParent){cLayer=bVer.dom?document.getElementById(idLayer).style:bVer.ie4?/*document.all[idLayer].style:bVer.ns4?*/idParent?document[idParent].document[idLayer]:document[idLayer]:0;cLayer.display='none';}
function SetOptsURL(){var d=document.Wiz;{document.location.href="http://travel.wwte1.com/pubspec/scripts/eap.asp?GOTO=PACKAGEWIZ&eapid=11536-30001";}}
function SetOpts(){if (document.Wiz.srch){{document.getElementById('wizopts').innerHTML = '<A href="#" onmouseover="window.status=\'Vacation Packages\';return(true);" onmouseout="window.status=\'\'" onclick="SetOptsURL();return(false);" style="color:000000">More package destinations</A>'}}}
function SyncVals(obj){
	var sFldNme=obj.form.name + "." + obj.name;
	d=document.forms;
	if (sFldNme=='PkgFormNoFlight.CityID'||sFldNme=='PkgFormWithFlight.CityID'){
		d.PkgFormNoFlight.CityID.value=d.PkgFormWithFlight.CityID.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.FromDate'||sFldNme=='PkgFormWithFlight.FromDate'){
		d.PkgFormNoFlight.FromDate.value=d.PkgFormWithFlight.FromDate.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.ToDate'||sFldNme=='PkgFormWithFlight.ToDate'){
		d.PkgFormNoFlight.ToDate.value=d.PkgFormWithFlight.ToDate.value=obj.value;
	}else if (sFldNme=='PkgFormWithFlight.FrAirport'){
		d.PkgFormWithFlight.FrAirport.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.NumAdult'||sFldNme=='PkgFormWithFlight.NumAdult'){
		d.PkgFormNoFlight.NumAdult.value=d.PkgFormWithFlight.NumAdult.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.NumChild'||sFldNme=='PkgFormWithFlight.NumChild'){
		d.PkgFormNoFlight.NumChild.value=d.PkgFormWithFlight.NumChild.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.NumSenior'||sFldNme=='PkgFormWithFlight.NumSenior'){
		d.PkgFormNoFlight.NumSenior.value=d.PkgFormWithFlight.NumSenior.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.FromTime'||sFldNme=='PkgFormWithFlight.FromTime'){
		d.PkgFormNoFlight.FromTime.value=d.PkgFormWithFlight.FromTime.value=obj.value;
	}else if (sFldNme=='PkgFormNoFlight.ToTime'||sFldNme=='PkgFormWithFlight.ToTime'){
		d.PkgFormNoFlight.ToTime.value=d.PkgFormWithFlight.ToTime.value=obj.value;
	}
}
function SetPkgType(i){var PkgWithFlightSelectedVal = document.PkgFormWithFlight.CityID.value;var PkgNoFlightSelectedVal = document.PkgFormNoFlight.CityID.value;var optionIndex = 0;if (3==i){hide('PkgWithFlight');show('PkgNoFlight');if (PkgWithFlightSelectedVal.length > 0) {document.PkgFormNoFlight.CityID.value = PkgWithFlightSelectedVal;}}else{hide('PkgNoFlight');show('PkgWithFlight');if (PkgNoFlightSelectedVal.length > 0) {document.PkgFormWithFlight.CityID.value = PkgNoFlightSelectedVal;}document.PkgFormWithFlight.PackageType.value = i;}document.PkgTypeFrm.PrevPkgType.value = i;}
	
	
	
	
	
	
	
	
