var cityArr = new Array();
var airTxtArr = new Array();
var actvArr = new Array();
var attArr = new Array();
var hgrpArr = new Array();
var hlocArr = new Array();
var starArr = new Array();

var searchError=false;
var errorMsg=false;
var search	="";
var searchLoc="";
var searchLocHA="";
var showAllLoc=false;
var fireFox=false;
var showAllLoc=false;
if (navigator.userAgent.indexOf("Firefox")>-1){fireFox=true;}
var _month = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var actType = new Array("All","Swimming","Golf","Test Program Activity","Show","Shows","Test Program");
 			

function loadAct(){
searchError=false;
document.forms["form1"].elements["H_cmbNoOfRooms"].selectedIndex=0;

try{
document.forms["form1"].elements["Activity_type"].options.length=0;
	try {
		for (var imxk=0; imxk<actvArr.length; imxk++){
			try{document.forms["form1"].elements["Activity_type"].options[imxk] = new Option(actvArr[imxk][1],actvArr[imxk][0]);
			}catch(exp){}
		}
	}catch(ex){return;}
}catch(exp){}
showRooms(1);
showAgCom(0,1);
}

if (!fireFox){
var ixp_ie = (document.all)? true:false;
if (!ixp_ie) window.captureEvents(Event.CLICK)
document.onclick = getMouseXY;
}

calShown=false;
var activeDateObjNM="";
var activeDateObjIO="";
function retDate(add){
	var tmpd= new Date();
	var tmpd1= new Date(tmpd.setDate(tmpd.getDate()+add));
	return new Date(tmpd1.getFullYear(),tmpd1.getMonth(),tmpd1.getDate(),0,0,0,0);
}
var maxChis=0;
var _MouseX=0;
var _MouseY=0;

function getMouseXY(e) {
if (ixp_ie) {_MouseX=event.clientX+document.body.scrollLeft;_MouseY=event.clientY+document.body.scrollTop;
}else{if (fireFox){_MouseX = e.pageX;_MouseY = e.pageY;}}  
if (_MouseX<0){_MouseX=0}
if (_MouseY<0){_MouseY=0}  
hide_things();
return true
}

function hide_things(){
try{
	setObjPos('ixpDataFrame',0,0,0,0,'none');
}catch(ex){}
try{
	setObjPos('maskFrame',0,0,0,0,'none');
}catch(ex){}
}

var toDay = new retDate(0);
var _InDate = new retDate(2);

var _OutDate = new retDate(3);
function twoChar(val){
var tval=""+val+"";
if (tval.length<2){return "0"+val+"";}else{return ""+val+"";}
}
var numToday=Number(""+toDay.getFullYear()+""+twoChar(Number(toDay.getMonth())+1)+""+twoChar(toDay.getDate())+"");


function maxdays(mm,yy){
var maxd;
if (mm==1){
if(yy%4==0){return 29;}else{maxd=28;}
}else if (mm==0 || mm==2 || mm==4 || mm==6 || mm==7 || mm==9 || mm==11){
maxd=31;
}else{
maxd=30;
}
return maxd;
}

function dateOpts(days,date){
var ixpoptDays="";
var sel="";
	for (var ixpa=0; ixpa<days; ixpa++){
		if (date==(ixpa+1)){sel=" selected";}else{sel="";}
		if (ixpa<9){
			ixpoptDays+="<option value=\"0"+(ixpa+1)+"\""+sel+">0"+(ixpa+1)+"</option>";
		}else{
			ixpoptDays+="<option value=\""+(ixpa+1)+"\""+sel+">"+(ixpa+1)+"</option>";	
		}
	}
	return ixpoptDays;
}
function monthOpts(setmonth){
	var sel="";
	var  m_months= new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var optMonths="";
	for (var ixpb=0; ixpb<m_months.length; ixpb++){
		if (setmonth==ixpb){sel=" selected";}else{sel="";}
			optMonths+="<option value=\""+ixpb+"\""+sel+">"+m_months[ixpb]+"</option>";
	}
    return optMonths;
}
function dateCombo(objNm,inout,year,month,date) {
	retStr="";
	if (inout=="_In"){
		retStr="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+
		"<tr>"+
		"<td><select name=\""+objNm+inout+"Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+dateOpts(maxdays(month,year),date)+
		"</select></td>"+
		"<td><img src=\"/images/s.gif\" width=\"1\" height=\"1\"></td>"+
		"<td><select name=\""+objNm+inout+"Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+monthOpts(month)+
		"</select></td>"+
		"<td><img src=\"/images/s.gif\" width=\"1\" height=\"1\"></td>"+
		"<td><select name=\""+objNm+inout+"Year\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">";	
	}else{
		retStr="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+
		"<tr>"+
		"<td><select name=\""+objNm+inout+"Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+dateOpts(maxdays(month,year),date)+
		"</select></td>"+
		"<td><img src=\"/images/s.gif\" width=\"1\" height=\"1\"></td>"+
		"<td><select name=\""+objNm+inout+"Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+monthOpts(month)+
		"</select></td>"+
		"<td><img src=\"/images/s.gif\" width=\"1\" height=\"1\"></td>"+
		"<td><select name=\""+objNm+inout+"Year\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">";	
	}
		
	var ixpc=3;
	if (inout.indexOf("_Out")>-1){ixpc=4;}
	for (ixpd=0; ixpd<ixpc; ixpd++){
		var tmpy=""+(toDay.getFullYear()+ixpd)+"";
		if (year==tmpy){
			retStr+="<option value=\""+tmpy+"\" selected>"+tmpy+"</option>";	
		}else{
			retStr+="<option value=\""+tmpy+"\">"+tmpy+"</option>";	
		}
	}
	retStr+="</select></td>"+
	"<td><img src=\"/images/s.gif\" width=\"3\" height=\"1\"></td>"+
	"<td><a href=\"JavaScript:void(0)\" onClick=\"loadixpCal('"+objNm+"','"+inout+"');\"><img name=\""+objNm+""+inout+"\" src=\"/images/cal_new.gif\" width=\"18\" height=\"18\" border=\"0\"></a></td>"+
	"</tr>"+
	"</table>";
    return retStr;
}

function loadixpCal(nm,inout){
activeDateObjNM=nm;
activeDateObjIO=inout;
setcalPos('show',""+nm+""+inout+"");
}

function setcalPos(stat,obj){
	with(document.getElementById("calFrame")){
		if (stat=="show"){
		style.left=getPosImg(obj,"left")+18;
		style.top=getPosImg(obj,"top");
		style.width=185;style.height=220;
		style.display="block";
		calShown=true;
		}else{
		style.display="none";
		style.left=0;style.top=0;style.width=0;style.height=0;
		calShown=false;
		}	
	}
}

function opts(st,end,sel){
	var retStr="";
	for (var ixpe=st; ixpe<=end; ixpe++){
		if (!isNaN(sel)){
			if (sel==ixpe){
			retStr+="<option value=\""+ixpe+"\" selected>"+ixpe+"</option>\n";
			}else{
			retStr+="<option value=\""+ixpe+"\">"+ixpe+"</option>\n";
			}		
		}else{
			retStr+="<option value=\""+ixpe+"\">"+ixpe+"</option>\n";
		}
	}
	return retStr;
}

function showRooms(num){
setTimeout("showRoomsset("+num+")",1);
}

function showRoomsset(num){
for (ixpg=1; ixpg<=5; ixpg++){
if (ixpg<=num){
try{document.getElementById("occR"+ixpg+"").style.display="block";}catch(ex){}
}else{
try{document.getElementById("occR"+ixpg+"").style.display="none";}catch(ex){}
}
}
setSelRoomOcc();
}


function setDtOptIn(type,inout,obj){
var maxDates = maxdays(Number(document.forms["form1"].elements[""+(type+inout)+"Month"].options[document.forms["form1"].elements[""+(type+inout)+"Month"].selectedIndex].value),Number(document.forms["form1"].elements[""+(type+inout)+"Year"].options[document.forms["form1"].elements[""+(type+inout)+"Year"].selectedIndex].value));
var addopts=true;
try{
if (obj.name.indexOf("Date")>-1 && document.forms["form1"].elements[""+(type+inout)+"Date"].options.length==maxDates){addopts=false;}
}catch(ex){}
if (addopts){
setTimeout("loadOpts("+maxDates+",'"+type+inout+"Date')",0);
}
if (inout=="_Out"){
	setNights(type);
}else{
setOutDate(type,inout);
}
}

function setOutDate(type,inout){
var tmpOutDate;
with(document.forms["form1"]){
	tmpOutDate = new Date(elements[""+(type+inout)+"Year"].options[elements[""+(type+inout)+"Year"].selectedIndex].value,elements[""+(type+inout)+"Month"].options[elements[""+(type+inout)+"Month"].selectedIndex].value,elements[""+(type+inout)+"Date"].options[elements[""+(type+inout)+"Date"].selectedIndex].value,0,0,0,0);
//alert("ssaasas"+tmpOutDate);
tmpOutDate = new Date(tmpOutDate.setDate(tmpOutDate.getDate()+Number(elements[""+type+"_nights"].value)));
	
	elements[""+type+"_OutYear"].selectedIndex=Number(tmpOutDate.getFullYear())-Number(toDay.getFullYear());
	elements[""+type+"_OutMonth"].selectedIndex=Number(tmpOutDate.getMonth());
	var tmpmaxDates = maxdays(Number(elements[""+type+"_OutMonth"].options[elements[""+type+"_OutMonth"].selectedIndex].value),Number(elements[""+type+"_OutYear"].options[elements[""+type+"_OutYear"].selectedIndex].value));
	setTimeout("loadOpts("+tmpmaxDates+",'"+type+"_OutDate',"+(Number(tmpOutDate.getDate())-1)+")",0);
}

}

function loadOpts(opts,name,setDt){
var selInd=document.forms["form1"].elements[name].selectedIndex;
document.forms["form1"].elements[name].options.length=0;
	for (ixpk=0; ixpk<opts; ixpk++){
		if (ixpk<9){
		document.forms["form1"].elements[name].options[ixpk]= new Option("0"+(ixpk+1)+"","0"+(ixpk+1)+"");
		}else{
		document.forms["form1"].elements[name].options[ixpk]= new Option(ixpk+1,ixpk+1);
		}
	}
	if (setDt>-1){
		document.forms["form1"].elements[name].selectedIndex=setDt;
	}else{
		if (selInd>=opts){
		document.forms["form1"].elements[name].selectedIndex=opts-1;
		}else{
		document.forms["form1"].elements[name].selectedIndex=selInd;
		}
	}
}

function setOut(type){
var tmpInDate = new Date(document.forms["form1"].elements[""+type+"_InYear"].options[document.forms["form1"].elements[""+type+"_InYear"].selectedIndex].value,document.forms["form1"].elements[""+type+"_InMonth"].options[document.forms["form1"].elements[""+type+"_InMonth"].selectedIndex].value,document.forms["form1"].elements[""+type+"_InDate"].options[document.forms["form1"].elements[""+type+"_InDate"].selectedIndex].value,0,0,0,0);
var tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+Number(document.forms["form1"].elements[""+type+"_nights"].value)));
document.forms["form1"].elements[""+type+"_OutYear"].selectedIndex=tmpOutDate.getFullYear()-toDay.getFullYear();
document.forms["form1"].elements[""+type+"_OutMonth"].selectedIndex=tmpOutDate.getMonth();
var maxDates = maxdays(Number(document.forms["form1"].elements[""+type+"_OutMonth"].options[document.forms["form1"].elements[""+type+"_OutMonth"].selectedIndex].value),Number(document.forms["form1"].elements[""+type+"_OutYear"].options[document.forms["form1"].elements[""+type+"_OutYear"].selectedIndex].value));
loadOpts(maxDates,""+type+"_OutDate");
document.forms["form1"].elements[""+type+"_OutDate"].selectedIndex=tmpOutDate.getDate()-1;
}

function setNights(type){
var tmpInDate = new Date(document.forms["form1"].elements[""+type+"_InYear"].options[document.forms["form1"].elements[""+type+"_InYear"].selectedIndex].value,Number(document.forms["form1"].elements[""+type+"_InMonth"].options[document.forms["form1"].elements[""+type+"_InMonth"].selectedIndex].value)-1,document.forms["form1"].elements[""+type+"_InDate"].options[document.forms["form1"].elements[""+type+"_InDate"].selectedIndex].value,0,0,0,0);
var tmpOutDate = new Date(document.forms["form1"].elements[""+type+"_OutYear"].options[document.forms["form1"].elements[""+type+"_OutYear"].selectedIndex].value,Number(document.forms["form1"].elements[""+type+"_OutMonth"].options[document.forms["form1"].elements[""+type+"_OutMonth"].selectedIndex].value)-1,document.forms["form1"].elements[""+type+"_OutDate"].options[document.forms["form1"].elements[""+type+"_OutDate"].selectedIndex].value,0,0,0,0);
var diffe=Number(get_deference(tmpInDate,tmpOutDate));
	if (diffe<=31 && diffe>0){
		document.forms["form1"].elements[""+type+"_nights"].value=diffe;
	}
}

function get_deference(ind,oud){
var milSec=parseInt(oud-ind);
var ret_val=milSec/86400000;
return ret_val;
}

var checkMore=0;
var checkMore=0;
function setChar(ch,img,pkgtyp){
var tmpArr = new Array();
var flag =0;
if(pkgtyp=='H'||pkgtyp=='A'){
	for (var j=0; j<cityArr.length; j++){		
		if (cityArr[j][1].toUpperCase().indexOf(ch.value.toUpperCase())==0){
			if (!showAllLoc){checkMore++;if (checkMore>10){break;}}
			tmpArr[tmpArr.length]="<tr><td class=\"stripe"+((j%2)+3)+"\" style=\"padding-left:5px;cursor:pointer;\" onMouseOver=\"altcell('ov',this)\" onMouseOut=\"altcell('ou',this,'stripe"+((j%2)+3)+"')\" onClick=\"setVal("+j+",'"+ch.name+"','N')\">"+cityArr[j][1]+" - "+cityArr[j][5]+"</td></tr>";
		}
	}
}else{	
	for (var j=0; j<airTxtArr.length; j++){		
		if (airTxtArr[j][0].toUpperCase().indexOf(ch.value.toUpperCase())==0){
			if (!showAllLoc){checkMore++;if (checkMore>10){break;}}
			tmpArr[tmpArr.length]="<tr><td class=\"stripe"+((j%2)+3)+"\" style=\"padding-left:5px;cursor:pointer;\" onMouseOver=\"altcell('ov',this)\" onMouseOut=\"altcell('ou',this,'stripe"+((j%2)+3)+"')\" onClick=\"setVal("+j+",'"+ch.name+"','Y')\">"+airTxtArr[j][0]+" - "+airTxtArr[j][1]+" - "+airTxtArr[j][3]+" - "+airTxtArr[j][7]+"</td></tr>";
			var flag =1;		
		}
	if( (airTxtArr[j][1].toUpperCase().indexOf(ch.value.toUpperCase())==0) && (flag ==0)){
			if (!showAllLoc){checkMore++;if (checkMore>10){break;}}
			tmpArr[tmpArr.length]="<tr><td class=\"stripe"+((j%2)+3)+"\" style=\"padding-left:5px;cursor:pointer;\" onMouseOver=\"altcell('ov',this)\" onMouseOut=\"altcell('ou',this,'stripe"+((j%2)+3)+"')\" onClick=\"setVal("+j+",'"+ch.name+"','Y')\">"+airTxtArr[j][0]+" - "+airTxtArr[j][1]+" - "+airTxtArr[j][3]+" - "+airTxtArr[j][7]+"</td></tr>";
		}
		var flag =0;
	}
}
	
	if (!showAllLoc){
		if (checkMore>10){tmpArr[tmpArr.length]="<tr><td class=\"morebg\" style=\"padding-left:5px;cursor:pointer;\" onClick=\"showAllLoc=true;setChar(document.forms['form1'].elements['"+ch.name+"'],'"+img+"','"+pkgtyp+"')\" title=\"Show All\" align=\"center\"><img src=\"/images/more_arrow.gif\" width=\"9\" height=\"6\" border=\"0\" hspace=\"3\" alt=\"Show All\" align=\"absmiddle\">Show All</td></tr>";}
	}
	checkMore=0;
	
	var outSt="";
if (tmpArr.length==0){
	outSt="<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" class=\"databorder\"><tr><td class=\"stripe4\" onClick=\"setObjPos('ixpDataFrame',0,0,180,0,'none');setObjPos('maskFrame',0,0,180,0,'none');\" align=\"center\">... No Results Available ...</td></tr></table>";
	showRes(img,outSt,1);
}else{
	outSt="<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" class=\"databorder\">"+tmpArr.join("")+"</table>";
	showRes(img,outSt,tmpArr.length);
}
tmpArr.length=0;
}

function getPosImg(imgElem,ops) {
	if (ops=="top"){
		ixppos = document.images[imgElem].offsetTop;
		tempEl = document.images[imgElem].offsetParent;
				while (tempEl != null) {
					ixppos += tempEl.offsetTop;
					tempEl = tempEl.offsetParent;
				}
		return ixppos;
	}else if (ops=="left"){
		ixppos = document.images[imgElem].offsetLeft;
		tempEl = document.images[imgElem].offsetParent;
				while (tempEl != null) {
					ixppos += tempEl.offsetLeft;
					tempEl = tempEl.offsetParent;
				}

		return ixppos;
	}
}

function showRes(img,outSt,records){
setObjPos('ixpDataFrame',getPosImg(img,'left'),getPosImg(img,'top'),311,records,'block');
setObjPos('maskFrame',getPosImg(img,'left'),getPosImg(img,'top'),311,records,'block');
document.getElementById("ixpDataFrame").innerHTML=outSt;
}

function setObjPos(name,x,y,w,recs,stat,records){
	with(document.getElementById(name).style){
	left=x;top=y-1;width=w;height=recs*23;display=stat;
	}
}

function altcell(st,obj,cls){
	if (st=="ov"){
	obj.className="overclass";
	}else{
	obj.className=cls;
	}
}

function setVal(index,obj,stt){
	if(stt=='N'){
		//alert('if >'+stt);
		document.forms["form1"].elements["hid_H_Loc"].value=cityArr[index].join("|");
		document.forms["form1"].elements["hid_A_Loc"].value=cityArr[index].join("|");
		document.forms["form1"].elements[obj].value=cityArr[index][1];
	}else{
		//alert('else >'+stt);
		//document.forms["form1"].elements["hid_car_Loc"].value=airTxtArr[index].join("|");
		//document.forms["form1"].elements["hid_air_Loc"].value=airTxtArr[index].join("|");
		document.forms["form1"].elements[obj].value=airTxtArr[index][0];
		//alert('car >'+document.forms["form1"].elements["hid_car_Loc"].value);
		//alert('air >'+document.forms["form1"].elements["hid_air_Loc"].value);
	}

	setObjPos('ixpDataFrame',0,0,180,0,'none');
	setObjPos('maskFrame',0,0,180,0,'none');
	showAllLoc=false;
}


function getSelVal(fr,nm){
try{
//alert("aa***aaaa");
	return; //document.forms[fr].elements[nm].options[document.forms[fr].elements[nm].selectedIndex].value;
//alert("sssssssssss");	
}catch(exp){
	alert(nm)
	return document.forms[fr].elements[nm].value;
}

}
var sel_adlts=0;
var sel_chis=0;
var set_agelist="";
function setFields(eng){
		with(document.forms["ResPkgSearchForm"]){
		cmbInMn.value=Number(getSelVal("form1",""+eng+"_InMonth"))+1;
		cmbInDt.value=getSelVal("form1",""+eng+"_InDate");
		cmbInYr.value=getSelVal("form1",""+eng+"_InYear");
		cmbOutMn.value=Number(getSelVal("form1",""+eng+"_OutMonth"))+1;
		cmbOutDt.value=getSelVal("form1",""+eng+"_OutDate");
		cmbOutYr.value=getSelVal("form1",""+eng+"_OutYear");
		
		if (eng!="A"){
			setAdults_Chi_Gstlst(Number(getSelVal("form1",""+eng+"_cmbNoOfRooms")));
			cmbAdlt.value=sel_adlts;
			if (document.forms["ResPkgSearchForm"].elements["accommodationType"].value=="HT"){
				cmbNoRm.value=getSelVal("form1",""+eng+"_cmbNoOfRooms");
			}else{
				cmbNoRm.value=sel_adlts;
			}
			cmbChi.value=sel_chis;
			gstLst.value=set_agelist;
		}
		cmbNgt.value=getSelVal("form1",""+eng+"_nights");
		
			try{
				searchLoc=document.forms["form1"].elements["hid_"+eng+"_Loc"].value.split("|");
				cmbCty.value=searchLoc[0];
				ctyNm.value=searchLoc[1];
				cmbSte.value=searchLoc[2];
				cmbCtry.value=searchLoc[3];
			}catch(ex){
			}
		}
}


function setAdults_Chi_Gstlst(val){
var AccomVal=document.forms["ResPkgSearchForm"].elements["accommodationType"].value;
	with (document.forms["form1"]){
		if (AccomVal=="HT"){
			_noR = Number(elements["H_cmbNoOfRooms"].options[elements["H_cmbNoOfRooms"].selectedIndex].value);
				for (var _NOR=0; _NOR<_noR; _NOR++){
					sel_adlts+=Number(elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value);
					sel_chis+=Number(elements["R"+(_NOR+1)+"occChi"].options[elements["R"+(_NOR+1)+"occChi"].selectedIndex].value);
				}
			
		}else if (AccomVal=="HS"){
			sel_adlts=Number(elements["H_Adults"].options[elements["H_Adults"].selectedIndex].value);
			sel_chis=0;
		}
	}
	set_agelist=document.forms["ResPkgSearchForm"].elements["gstLst"].value;
}

function printVals(){
var eleStr="";
for (var kk=0; kk<document.forms["ResPkgSearchForm"].elements.length; kk++){
eleStr+=""+document.forms["ResPkgSearchForm"].elements[kk].name+" = "+document.forms[0].elements[kk].value+"\n";
}
document.write("<xmp>"+eleStr+"</xmp>")
}

function chkDates(){
with(document.forms["ResPkgSearchForm"]){
var idtNum=Number(""+cmbInYr.value+""+twoChar(cmbInMn.value)+""+twoChar(cmbInDt.value)+"");
var odtNum=Number(""+cmbOutYr.value+""+twoChar(cmbOutMn.value)+""+twoChar(cmbOutDt.value)+"");
var tpInDate = new Date(cmbInYr.value,Number(cmbInMn.value)-1,cmbInDt.value,0,0,0,0);
var tpOutDate = new Date(cmbOutYr.value,Number(cmbOutMn.value)-1,cmbOutDt.value,0,0,0,0);
}
var diff=Number(get_deference(tpInDate,tpOutDate));
if (numToday>idtNum){
	searchError=true;
	errorMsg="Arrival Date Should be Greater Than Today's Date";
	return true;
}
if (idtNum>odtNum){
	searchError=true;
	errorMsg="Departure Date Should be Greater Than Arrival Date";
	return true;
}
if (diff>31){
	searchError=true;
	errorMsg="You Can Book Maximum of 31 Nights";
	return true;
}
return false;
}

function actStr(){
var tmpsr=actvArr.join("$");
tmpsr=tmpsr.split(",");
tmpsr=tmpsr.join("@");
document.forms["ResPkgSearchForm"].elements["actList"].value=tmpsr;
}

function showError(){
document.getElementById("errorMSG").innerHTML=errorMsg;
document.getElementById("errorTBL").style.display="block";
setTimeout("hideError()",2500);
}

function hideError(){
document.getElementById("errorMSG").innerHTML="";
document.getElementById("errorTBL").style.display="none";
errorMsg="";
searchError=false;
}

function setSelRoomOcc(){
var _noR="";
var _nChi="";
var tempOcc="";
var totAdlt=0;
var totChi=0;
var adlts=0;
var occupancyStr="";
var AccomVal=document.forms["ResPkgSearchForm"].elements["accommodationType"].value;
	if (AccomVal=="HT"){
	
		with (document.forms["form1"]){
		_noR = Number(elements["H_cmbNoOfRooms"].options[elements["H_cmbNoOfRooms"].selectedIndex].value);
		
			for (var _NOR=0; _NOR<_noR; _NOR++){
			adlts = Number(elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value);			
			tempOcc+=elements["R"+(_NOR+1)+"occAdults"].options[elements["R"+(_NOR+1)+"occAdults"].selectedIndex].value+"|";
			_nChi=Number(elements["R"+(_NOR+1)+"occChi"].options[elements["R"+(_NOR+1)+"occChi"].selectedIndex].value);
			
			tempOcc+=_nChi+"|";
				if (_nChi>0){
					for (var _Nch=0; _Nch<_nChi; _Nch++){
						tempOcc+=elements["R"+(_NOR+1)+"occAge"+(_Nch+1)+""].options[elements["R"+(_NOR+1)+"occAge"+(_Nch+1)+""].selectedIndex].value;
						if ((_Nch+1)!=_nChi){tempOcc+=",";}
					}
					tempOcc+="|%|%@";
				}else{
					tempOcc+="-|%|%@";
				}
			totAdlt+=adlts;
			totChi+=_nChi;
			occupancyStr = occupancyStr+"<room"+(_NOR+1)+"Adults>"+adlts+"</room"+(_NOR+1)+"Adults>"+"<room"+(_NOR+1)+"Children>"+_nChi+"</room"+(_NOR+1)+"Children>";
			}
			
		}
		
	}else if (AccomVal=="HS"){
		tempOcc="";
		with (document.forms["form1"]){
		var HSAdults=Number(elements["H_Adults"].options[elements["H_Adults"].selectedIndex].value);
			for (var dfg=0; dfg<HSAdults; dfg++){
				tempOcc+="1|0|-|%|%@";
			}		
		}
	}
//alert('tempOcc>'+tempOcc);
//alert('totAdlt>'+totAdlt);
//alert('totChi>'+totChi);
//alert('occupancyStr>'+occupancyStr);
	document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value 	= occupancyStr;
	document.forms["ResPkgSearchForm"].totAdlt_Hotels.value				= totAdlt;
	document.forms["ResPkgSearchForm"].totChi_Hotels.value				= totChi;
	document.forms["ResPkgSearchForm"].elements["gstLst_Hotels"].value	= tempOcc;
}

function showAgCom(val,rm){
setTimeout("showAgComset("+val+",'"+rm+"')",1);
}

function showAgComset(val,rm){
if (val==0){
try{document.getElementById("R"+rm+"ageTbl").style.display="none";}catch(ex){}
}else{
try{document.getElementById("R"+rm+"ageTbl").style.display="block";}catch(ex){}
}

	for (fgh=1; fgh<=3; fgh++){
		if (fgh<=val){
			document.getElementById("R"+rm+"chAgHd"+fgh+"").style.display="block";
			document.getElementById("R"+rm+"occAge"+fgh+"").style.display="block";
		}else{
			document.getElementById("R"+rm+"chAgHd"+fgh+"").style.display="none";
			document.getElementById("R"+rm+"occAge"+fgh+"").style.display="none";
		}
	}
}

function loadFilters(){
	with(document.forms["form1"]){
		if (hlocArr.length!=0){
			elements["hLocation"].options.length=0;
			elements["hLocation"].options[0] = new Option("All","All");
			for (var loopr=0; loopr<hlocArr.length; loopr++){
			//try{elements["hLocation"].options[elements["hLocation"].options.length] = new Option(hlocArr[loopr][1],hlocArr[loopr][0]);}catch(ex){}
			elements["hLocation"].options[elements["hLocation"].options.length] = new Option(hlocArr[loopr][1],hlocArr[loopr][0]);
			}
		}
		if (hgrpArr.length!=0){
			elements["hGroup"].options.length=0;
			elements["hGroup"].options[0] = new Option("All","All");
			for (var loopr=0; loopr<hgrpArr.length; loopr++){
			//try{elements["hLocation"].options[elements["hLocation"].options.length] = new Option(hlocArr[loopr][1],hlocArr[loopr][0]);}catch(ex){}
			elements["hLocation"].options[elements["hLocation"].options.length] = new Option(hlocArr[loopr][1],hlocArr[loopr][0]);
			}
		}
		if (starArr.length!=0){
			elements["hstarCat"].options.length=0;
			elements["hstarCat"].options[0] = new Option("All","All");
			for (var loopr=0; loopr<starArr.length; loopr++){
			//try{elements["hstarCat"].options[elements["hstarCat"].options.length] = new Option(starArr[loopr][1],starArr[loopr][0]);}catch(ex){}
			elements["hstarCat"].options[elements["hstarCat"].options.length] = new Option(starArr[loopr][1],starArr[loopr][0]);
			}
		}
		if (attArr.length!=0){
			elements["hAtt"].options.length=0;
			elements["hAtt"].options[0] = new Option("All","All");
			for (var loopr=0; loopr<attArr.length; loopr++){
			//try{elements["hAtt"].options[elements["hAtt"].options.length] = new Option(attArr[loopr][1],attArr[loopr][0]);}catch(ex){}
			elements["hAtt"].options[elements["hAtt"].options.length] = new Option(attArr[loopr][1],attArr[loopr][0]);
			}
		}
	}
}
function setFilter(val,objnm){
document.forms["ResPkgSearchForm"].elements[objnm].value=val;
}

loadfilt=false;

function chkFilters(chk){
if (chk){
	document.getElementById('hFilt').style.display='block';
}else{
	document.getElementById('hFilt').style.display='none';
}
if (!loadfilt){
	loadFilters();
	loadfilt=true;
}
}

function buildOcc(){
var occStr="";
var _sty="";
for (var oc=0; oc<5; oc++){
if(oc==0){_sty="block";}else{_sty="none";}
occStr+="<span id=\"occR"+(oc+1)+"\" style=\"display:"+_sty+";\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n"+
"<tr>\n"+
"<td width=\"25%\" class=\"txt\">&nbsp;&nbsp;Room&nbsp;"+(oc+1)+"&nbsp;</td>\n"+
"<td width=\"25%\" class=\"txt\">Adults</td>\n"+
"<td width=\"25%\" class=\"txt\">Children (2-11yrs)</td>\n"+
"<td width=\"25%\" class=\"txt\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\"><select name=\"R"+(oc+1)+"occAdults\" style=\"width:40px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,10,1)+"</select></td>\n"+
"<td width=\"25%\"><select name=\"R"+(oc+1)+"occChi\" style=\"width:40px;\" onChange=\"setSelRoomOcc();showAgCom(Number(this.options[this.selectedIndex].value),"+(oc+1)+");\">\n"+opts(0,3,0)+"</select></td>\n"+
"<td width=\"25%\" class=\"txt\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td colspan=\"4\"><span id=\"R"+(oc+1)+"ageTbl\" style=\"display:none;\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd1\" style=\"display:none;\">Age 1</span></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd2\" style=\"display:none;\">Age 2</span></td>\n"+
"<td width=\"25%\" class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd3\" style=\"display:none;\">Age 3</span></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td width=\"25%\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"1\"></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge1\" name=\"R"+(oc+1)+"occAge1\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge2\" name=\"R"+(oc+1)+"occAge2\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></td>\n"+
"<td width=\"25%\"><select id=\"R"+(oc+1)+"occAge3\" name=\"R"+(oc+1)+"occAge3\" style=\"width:40px;display:none;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></td>\n"+
"</tr>\n"+
"</table>\n"+
"</span></td>\n"+
"</tr>\n"+
"<tr align=\"center\">\n"+
"<td colspan=\"4\"><img src=\"/images/ixps.gif\" width=\"1\" height=\"5\"></td>\n"+
"</tr>\n"+
"</table>\n";
}
return occStr;
}

function setAcType(val){
	document.forms["ResPkgSearchForm"].elements["accommodationType"].value=val;
	if (val=="HT"){
		document.getElementById("roomsCombo").style.display="block";	
		document.getElementById("adultsCombo").style.display="none";
		document.getElementById("occBox").style.display="block";
	}else if (val=="HS"){
		document.getElementById("roomsCombo").style.display="none";	
		document.getElementById("adultsCombo").style.display="block";
		document.getElementById("occBox").style.display="none";
	}
}
function setEng(id1,id2,val){
	document.getElementById(id1).style.display="block";	
	document.getElement
	ById(id2).style.display="none";
	document.forms["form1"].pkgType.value=val;
}

//	function befSubmit(){
//		var typ1="";
//		var srhdates="<br>Arriving on <b>"+_month[Number(document.forms["ResPkgSearchForm"].elements["cmbInMn"].value)-1]+"-"+document.forms["ResPkgSearchForm"].elements["cmbInDt"].value+"-"+document.forms["ResPkgSearchForm"].elements["cmbInYr"].value+"</b>, Departing <b>"+_month[Number(document.forms["ResPkgSearchForm"].elements["cmbOutMn"].value)-1]+"-"+document.forms["ResPkgSearchForm"].elements["cmbOutDt"].value+"-"+document.forms["ResPkgSearchForm"].elements["cmbOutYr"].value+"</b>";
//		if (document.forms["ResPkgSearchForm"].elements["accommodationType"].value=="HT"){
//			typ1="<b>"+document.forms["ResPkgSearchForm"].elements["cmbNoRm"].value+"</b> Room(s) ,";
//		}
//		searchMessage="<strong>We are Searching, Please Wait ... </strong> "+srhdates+"<br>"+typ1+"<b>"+sel_adlts+"</b> Adult(s) and <b>"+sel_chis+"</b> Children";
//		typ1="";
//		document.getElementById("searchMsg").innerHTML=searchMessage;
//		document.getElementById("waitMsg").style.display="block";
//		document.getElementById("fullContent").style.display="none";
//	}

	
function befSubmit(pkgType){

	if(pkgType=='H'){
		var srhdates=""+document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value+"-"+_month[Number(document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value+" ";
		
		var deptdate=""+document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value+"-"+_month[Number(document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value+"";
		
			var rooms = " "+document.forms["ResPkgSearchForm"].elements["cmbNoRm_Hotels"].value+"";
			var nignts = " "+document.forms["ResPkgSearchForm"].cmbNgt_Hotels.value+" ";			 
			var loc = " "+document.forms["ResPkgSearchForm"].searchCityName.value+"";
		

searchMessage="<table width='611' border='0' align='center' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td>";
searchMessage+="<table width='98%'  border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td  height='10'  class='bold' align='center'><p align='center'><b>WE ARE PERFORMING YOUR REQUESTED SEARCH</b><br />Please do not close this   window while we are processing your request</p></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td width='48%' align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='280' height='32'>       <param name='movie' value='/images/preload_new.swf' /><param name='quality' value='high' /><embed src='/images/preload_new.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='280' height='32'></embed></object></td>";
searchMessage+="</tr>";
searchMessage+="<tr valign='top'>";
searchMessage+="<td height='170' colspan='3' class='bold' align='center'>";
searchMessage+="<table width='550' height='173' border='0' cellpadding='0' cellspacing='0'><br>";
searchMessage+="<tr valign='top'>";
searchMessage+="<td height='150'><fieldset>";
searchMessage+="<legend><span class='style1'><b>Your Requested Search Criteria</b></span></legend>";
searchMessage+="<table width='550' border='0' align='center' cellpadding='1' cellspacing='1' class='normal'>";
searchMessage+="<tbody>";
searchMessage+="<tr>";
searchMessage+="<td width='150' nowrap='nowrap' align='right'>Selected Product :</td>";
searchMessage+="<td width='400' nowrap='nowrap' align='left'>Hotels</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Location : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+loc+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Arrival Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+srhdates+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Night(s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+nignts+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Departure Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+deptdate+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td height='20' align='right' nowrap='nowrap'>Room (s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+rooms+"</td>";
searchMessage+="</tr>";
searchMessage+="</tbody>";
searchMessage+="</table>";
searchMessage+="</fieldset></td>";
searchMessage+="</tr>";
searchMessage+="</table>";

searchMessage+="<tr>";
searchMessage+="<td>";
searchMessage+="<table width='100%' border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td align='left'>If you do not get results within 2 minutes then your internet connection may be too slow for our international suppliers to respond in time. Please do the following:</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td align='left'>1. Return to our home page and try again</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td align='left'>2. Speak to a consultant on 0861 232 867 who can confirm your booking over the phone</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td align='left'>3. Email us at <a href='mailto:reservations@onlinetravel.co.za'>reservations@onlinetravel.co.za</a> with your travel requirements and we will contact you</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";}
	

	if(pkgType=='A'){
	var srhdates=""+document.forms["ResPkgSearchForm"].cmbInDt_Activities.value+"-"+_month[Number(document.forms["ResPkgSearchForm"].cmbInMn_Activities.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Activities.value+"";
		
		var depdate=""+document.forms["ResPkgSearchForm"].cmbOutDt_Activities.value+"-"+_month[Number(document.forms["ResPkgSearchForm"].cmbOutMn_Activities.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbOutYr_Activities.value+"";
		
		var actTypeName = actType[Number(document.forms["ResPkgSearchForm"].actType_Activities.value)];
		var nights=""+document.forms["ResPkgSearchForm"].cmbNgt_Activities.value+"";
		var loc = ""+document.forms["ResPkgSearchForm"].searchCityName.value+"";
		
			
searchMessage="<table width='611' height='329' border='0' align='center' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td height='320' background='images/mav_left.gif' align='left'></td>";
searchMessage+="<td valign='top'>";
searchMessage+="<table width='98%' height='84%' border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td  height='10'  class='bold' align='center'><p align='center'><b>WE ARE PERFORMING YOUR REQUESTED SEARCH</b><br />Please do not close this   window while we are processing your request</p></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td width='48%' align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='280' height='32'>       <param name='movie' value='/images/preload_new.swf' /><param name='quality' value='high' /><embed src='/images/preload_new.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='280' height='32'></embed></object></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td height='174' colspan='3' class='bold' align='center'>";
searchMessage+="<table width='550' height='173' border='0' cellpadding='0' cellspacing='0'><br>";
searchMessage+="<tr>";
searchMessage+="<td height='154'><fieldset>";
searchMessage+="<legend><span class='style1'><b>Your Requested Search Criteria</b></span></legend>";
searchMessage+="<table width='550' height='100%' border='0' align='center' cellpadding='1' cellspacing='1' class='normal'>";
searchMessage+="<tbody>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Selected Product :</td>";
searchMessage+="<td nowrap='nowrap' align='left'>Activity</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Activity Type : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+actTypeName+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Location : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+loc+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Arrival Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+srhdates+"</td>";
searchMessage+="<td nowrap='nowrap' align='right'>Night(s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+nights+"</td>";
searchMessage+="<td nowrap='nowrap' align='right'>Departure Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+depdate+"</td>";
searchMessage+="</tr>";
searchMessage+="</tbody>";
searchMessage+="</table>";
searchMessage+="</fieldset></td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</table>";
searchMessage+="If you do not get results within 2 minutes then your internet connection may be too slow for our international suppliers to respond in time. Please do the following: <br>";
searchMessage+="1. Return to our home page and try again<br> ";
searchMessage+="2. Speak to a consultant on 0861 232 867 who can confirm your booking over the phone<br> ";
searchMessage+="3. Email us at <a href='mailto:reservations@onlinetravel.co.za'>reservations@onlinetravel.co.za</a> with your travel requirements and we will contact you<br>";		
	}
	if(pkgType=='F'){
		var srhdates=""+document.forms["ResPkgSearchForm"].depDate_Air.value+"";
		var tranDept=""+document.forms["ResPkgSearchForm"].depDate_Air_Tran.value+"";
				
		
		var returndate=""+document.forms["ResPkgSearchForm"].arrDate_Air.value+"";
		var tranArr=""+document.forms["ResPkgSearchForm"].arrDate_Air_Tran.value+"";
		
		
		var deptim = ""+document.forms["ResPkgSearchForm"].cmbDepTime_Air.value+"";
		var arrtim = ""+document.forms["ResPkgSearchForm"].cmbArrTime_Air.value+"";
		var adults = " "+document.forms["ResPkgSearchForm"].cmbAdults_Air.value+"";
		var Seniors = ""+document.forms["ResPkgSearchForm"].cmbSeniors_Air.value+"";
		var Child = ""+document.forms["ResPkgSearchForm"].cmbChildren_Air.value+"";
		var Infant = ""+document.forms["ResPkgSearchForm"].cmbInfant_Air.value+"";
		var dep = ""+document.forms["ResPkgSearchForm"].depLocName_Air.value+"";
		var arr = ""+document.forms["ResPkgSearchForm"].arrLocName_Air.value+"";
		
		
		
				
searchMessage="<table width='700' border='0' align='center' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td valign='top'>";
searchMessage+="<table width='98%' border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td  height='10'  class='bold' align='center'><p align='center'><b>WE ARE PERFORMING YOUR REQUESTED SEARCH</b><br />Please do not close this   window while we are processing your request</p></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td width='48%' align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='280' height='32'>       <param name='movie' value='/images/preload_new.swf' /><param name='quality' value='high' /><embed src='/images/preload_new.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='280' height='32'></embed></object></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td colspan='3' class='bold' align='center'>";
searchMessage+="<table width='680'  border='0' cellpadding='0' cellspacing='0' align='center'><br>";
searchMessage+="<tr>";
searchMessage+="<td height='180'><fieldset>";
searchMessage+="<legend><span class='style1'><b>Your Requested Search Criteria</b></span></legend>";
searchMessage+="<table width='570' border='0' align='center' cellpadding='4' cellspacing='4' class='normal'>";
searchMessage+="<tbody>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Selected Product :</td>";
searchMessage+="<td colspan='6' nowrap='nowrap' align='left'>Flight</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Departing From : </td>";
searchMessage+="<td colspan='6' nowrap='nowrap' align='left'>"+dep+"</td>";
searchMessage+="<td width='100' nowrap='nowrap' align='right'>Going To : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+arr+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Departing Date : </td>";
searchMessage+="<td colspan='6' nowrap='nowrap' align='left'>"+tranDept+" (Time :"+deptim+")</td>";
if(document.forms["form1"].elements["Air_TripType1"].checked){
searchMessage+="<td nowrap='nowrap' align='left'>&nbsp;</td>";
}else{
searchMessage+="<td width='100' nowrap='nowrap' align='right'>Return Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+tranArr+" (Time :"+arrtim+")</td>";
}
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td height='20' align='right' nowrap='nowrap'>Adult(s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+adults+"</td>";
searchMessage+="<td height='20' align='right' nowrap='nowrap'></td>";
searchMessage+="<td nowrap='nowrap' align='left'></td>";
searchMessage+="<td height='20' align='right' nowrap='nowrap'>Children(s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+Child+"</td>";
searchMessage+="<td height='20' align='right' nowrap='nowrap'>Infant(s) : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+Infant+"</td>";
searchMessage+="</tr>";
searchMessage+="</tbody>";
searchMessage+="</table>";
searchMessage+="</fieldset></td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="<table width='100%' border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td>If you do not get results within 2 minutes then your internet connection may be too slow for our international suppliers to respond in time. Please do the following:</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>1. Return to our home page and try again</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>2. Speak to a consultant on 0861 232 867 who can confirm your booking over the phone</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>3. Email us at <a href='mailto:reservations@onlinetravel.co.za'>reservations@onlinetravel.co.za</a> with your travel requirements and we will contact you</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";}
	if(pkgType=='C'){
		var srhdates=""+document.forms["ResPkgSearchForm"].pickupDate_Car.value+"";
		
		
		var tranIn=""+document.forms["ResPkgSearchForm"].pickupDate_Car_Tran.value+"";
		var tranOut=""+document.forms["ResPkgSearchForm"].returnDate_Car_Tran.value+"";
		
		
		var Returndate=""+document.forms["ResPkgSearchForm"].returnDate_Car.value+"";
	
		var pictim = ""+document.forms["ResPkgSearchForm"].pickupTime_Car.value+"";		
		var rettim = ""+document.forms["ResPkgSearchForm"].retTime_Car.value+"";
		var cartype = ""+document.forms["ResPkgSearchForm"].carType_Car.value+"";
		var pick = ""+document.forms["ResPkgSearchForm"].pickupLocName_Car.value+"";
		var retto = ""+document.forms["ResPkgSearchForm"].retupLocName_Car.value+"";
			
				
			
searchMessage="<table width='611' border='0' align='center' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td valign='top'>";
searchMessage+="<table width='98%'  border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td  height='10'  class='bold' align='center'><p align='center'><b>WE ARE PERFORMING YOUR REQUESTED SEARCH</b><br />Please do not close this   window while we are processing your request</p></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td width='48%' align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='280' height='32'>       <param name='movie' value='/images/preload_new.swf' /><param name='quality' value='high' /><embed src='/images/preload_new.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='280' height='32'></embed></object></td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td height='174' colspan='3' class='bold' align='center'>";
searchMessage+="<table width='550' height='173' border='0' cellpadding='0' cellspacing='0'><br>";
searchMessage+="<tr>";
searchMessage+="<td height='154'><fieldset>";
searchMessage+="<legend><span class='style1'><b>Your Requested Search Criteria</b></span></legend>";
searchMessage+="<table width='550' border='0' align='center' cellpadding='2' cellspacing='1' class='normal'>";
searchMessage+="<tbody>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Selected Product :</td>";
searchMessage+="<td nowrap='nowrap' align='left'>Car</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Car Type: </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+cartype+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Pickup From : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+pick+"</td>";
searchMessage+="<td nowrap='nowrap' align='right'>Return To : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+retto+"</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td nowrap='nowrap' align='right'>Pickup Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+tranIn+" (Time :"+pictim+")</td>";
searchMessage+="<td nowrap='nowrap' align='right'>Return Date : </td>";
searchMessage+="<td nowrap='nowrap' align='left'>"+tranOut+"  (Time :"+rettim+")</td>";
searchMessage+="</tr>";
searchMessage+="</tbody>";
searchMessage+="</table>";
searchMessage+="</fieldset></td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="<table width='100%' border='0' cellpadding='0' cellspacing='0'>";
searchMessage+="<tr>";
searchMessage+="<td>If you do not get results within 2 minutes then your internet connection may be too slow for our international suppliers to respond in time. Please do the following:</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>1. Return to our home page and try again</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>2. Speak to a consultant on 0861 232 867 who can confirm your booking over the phone</td>";
searchMessage+="</tr>";
searchMessage+="<tr>";
searchMessage+="<td>3. Email us at <a href='mailto:reservations@onlinetravel.co.za'>reservations@onlinetravel.co.za</a> with your travel requirements and we will contact you</td>";
searchMessage+="</tr>";
searchMessage+="</table>";
searchMessage+="</td>";
searchMessage+="</tr>";
searchMessage+="</table>";}
	document.getElementById("searchMsg").innerHTML=searchMessage;
	document.getElementById("waitMsg").style.display="block";
	document.getElementById("fullContent").style.display="none";
	document.getElementById("process").style.display="block";
}

function returnLocHide(){
	if(document.forms["form1"].elements["_ReturnCar"].checked){
		document.getElementById("retLocDisplay").style.display="none";
		document.getElementById("retLocDisplay1").style.display="none";
	}else{
		document.getElementById("retLocDisplay").style.display="block";
		document.getElementById("retLocDisplay1").style.display="block";
	
	}
}

function onewayHide(){
	if(document.forms["form1"].elements["Air_TripType1"].checked){
		document.getElementById("retDateDisplay").style.display="none";
//		document.getElementById("retDateDisplay1").style.display="none";
		
	} if(document.forms["form1"].elements["Air_TripType2"].checked){
		document.getElementById("retDateDisplay").style.display="block";
//		document.getElementById("retDateDisplay1").style.display="block";
	
	}
}
