// setting portal name
var schemaName="rez2goholidays";
//Setting server path
var subURL="http://www14.secure-reservation.com/"+schemaName+"";
//var subURL="http://192.168.1.119/"+schemaName+"";


var browser=navigator.appName;


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("January","February","March","April","May","June","July","August","September","October","November","December");
var actType = new Array("All","Swimming","Golf","Test Program Activity","Show","Shows","Test Program");

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

//depend on the searchdetail() function type(H ) passing values from Booking engine form to systms.
function loadDataNew_H(){ 
	setFields("H");
	document.forms["ResPkgSearchForm"].action=subURL+"/packaging/reservation/ResPkgSearchCriteria.do?ActionType=ResSearchHotels";
	if (chkDates()){showError();return;}
	var searchStr = document.forms["form1"].hid_H_Loc.value.split("|");
	document.forms["ResPkgSearchForm"].searchCityId.value		= searchStr[0];
	document.forms["ResPkgSearchForm"].searchCityName.value	= searchStr[1];
	document.forms["ResPkgSearchForm"].searchStateId.value	= searchStr[2];
	document.forms["ResPkgSearchForm"].searchCountryId.value	= searchStr[3];
	document.forms["ResPkgSearchForm"].cmbSuburb.value	= searchStr[6];
	document.forms["ResPkgSearchForm"].cmbCty_Hotels.value	= document.forms["ResPkgSearchForm"].searchCityId.value;
	document.forms["ResPkgSearchForm"].cityLookup_Hotels.value	= document.forms["ResPkgSearchForm"].searchCityName.value;
	document.forms["ResPkgSearchForm"].cmbSte_Hotels.value	= document.forms["ResPkgSearchForm"].searchStateId.value;
	document.forms["ResPkgSearchForm"].cmbCtry_Hotels.value	= document.forms["ResPkgSearchForm"].searchCountryId.value;
	document.forms["ResPkgSearchForm"].cmbSuburb_Hotels.value	= document.forms["ResPkgSearchForm"].cmbSuburb.value;
	document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value	= Number(document.forms["form1"].elements["H_InYear"].options[document.forms["form1"].elements["H_InYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value	= Number(document.forms["form1"].elements["H_InMonth"].options[document.forms["form1"].elements["H_InMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value	= document.forms["form1"].elements["H_InDate"].options[document.forms["form1"].elements["H_InDate"].selectedIndex].value;	
	document.forms["ResPkgSearchForm"].cmbNgt_Hotels.value	= Number(document.forms["form1"].elements["H_nights"].options[document.forms["form1"].elements["H_nights"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value	= Number(document.forms["form1"].elements["H_OutYear"].options[document.forms["form1"].elements["H_OutYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value	= Number(document.forms["form1"].elements["H_OutMonth"].options[document.forms["form1"].elements["H_OutMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value	= document.forms["form1"].elements["H_OutDate"].options[document.forms["form1"].elements["H_OutDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbNoRm_Hotels.value	= Number(document.forms["form1"].elements["H_cmbNoOfRooms"].options[document.forms["form1"].elements["H_cmbNoOfRooms"].selectedIndex].value);	
	document.forms["ResPkgSearchForm"].totRooms_Hotels.value	= Number(document.forms["form1"].elements["H_cmbNoOfRooms"].options[document.forms["form1"].elements["H_cmbNoOfRooms"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbInMn.value=Number(document.forms["form1"].elements["H_InMonth"].options[document.forms["form1"].elements["H_InMonth"].selectedIndex].value)+1;	
	document.forms["ResPkgSearchForm"].cmbInYr.value=document.forms["form1"].elements["H_InYear"].options[document.forms["form1"].elements["H_InYear"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutMn.value=Number(document.forms["form1"].elements["H_OutMonth"].options[document.forms["form1"].elements["H_OutMonth"].selectedIndex].value)+1;	
	document.forms["ResPkgSearchForm"].cmbOutYr.value=document.forms["form1"].elements["H_OutYear"].options[document.forms["form1"].elements["H_OutYear"].selectedIndex].value;	
	document.forms["ResPkgSearchForm"].cmbInDt.value=document.forms["form1"].elements["H_InDate"].options[document.forms["form1"].elements["H_InDate"].selectedIndex].value;			
	document.forms["ResPkgSearchForm"].cmbOutDt.value=document.forms["form1"].elements["H_OutDate"].options[document.forms["form1"].elements["H_OutDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].consumerRegionId.value 		= document.forms["form1"].H_Country.value;
	var OutMonth=document.forms["ResPkgSearchForm"].cmbOutMn.value;
	var InMonth=document.forms["ResPkgSearchForm"].cmbInMn.value;
	var cMonth=Number(_InDate.getMonth()+1);
	var d = new Date();
	var curr_year = d.getFullYear();
	var totalAdults 	= 0;
	var totalChildren	= 0;
	var occupancyStr	= "";
	if(document.forms["ResPkgSearchForm"].hotelCode_Hotels.value==""){
		document.forms["ResPkgSearchForm"].shtcd_Hotels.value="0";
	}
	if(document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value==""){
		document.forms["ResPkgSearchForm"].occupancy_Details_Hotels.value = "<room1Adult>1</room1Adults><room1Children>0</room1Children>";
	}
	document.forms["ResPkgSearchForm"].cmbtourOpt_Hotels.value="0";
	document.forms["ResPkgSearchForm"].pkgType.value	= "H";
	var currentDate 	= new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate());
	var checkinDate 	= new Date(Number(document.forms["ResPkgSearchForm"].cmbInYr.value),Number(document.forms["ResPkgSearchForm"].cmbInMn.value)-1,Number(document.forms["ResPkgSearchForm"].cmbInDt.value));
	var checkoutDate 	= new Date(Number(document.forms["ResPkgSearchForm"].cmbOutYr.value),Number(document.forms["ResPkgSearchForm"].cmbOutMn.value)-1,Number(document.forms["ResPkgSearchForm"].cmbOutDt.value));
	if (document.forms["ResPkgSearchForm"].consumerRegionId.value=="- Select -"){
		alert("Please Enter the Country!");
	}else if (searchStr==""){
		alert("Please Enter the Location!");
	}else if (checkinDate>checkoutDate || checkinDate<currentDate){
		alert("The Correct Date Should be Selected!");
	}else {
		befSubmit('H');
		document.forms["ResPkgSearchForm"].submit();
	}
}
//depend on the searchdetail() function type(A) passing values from Booking engine form to systms.
function loadDataNew_A(){
	setFields("A");
	document.forms["ResPkgSearchForm"].action=subURL+"/packaging/reservation/ResPkgSearchCriteria.do?ActionType=ResSearchActivities";
	if (chkDates()){showError();return;}
	var searchStr = document.forms["form1"].hid_H_Loc.value.split("|");
	document.forms["ResPkgSearchForm"].searchCityId.value	= searchStr[0];
	document.forms["ResPkgSearchForm"].searchCityName.value	= searchStr[1];
	document.forms["ResPkgSearchForm"].searchStateId.value	= searchStr[2];
	document.forms["ResPkgSearchForm"].searchCountryId.value	= searchStr[3];
	document.forms["ResPkgSearchForm"].cmbCty_Activities.value	= document.forms["ResPkgSearchForm"].searchCityId.value;
	document.forms["ResPkgSearchForm"].cityLookup_Activities.value	= document.forms["ResPkgSearchForm"].searchCityName.value;
	document.forms["ResPkgSearchForm"].cmbCtry_Activities.value	= document.forms["ResPkgSearchForm"].searchCountryId.value;
	document.forms["ResPkgSearchForm"].cmbInYr_Activities.value	= Number(document.forms["form1"].elements["activity_InYear"].options[document.forms["form1"].elements["activity_InYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbInMn_Activities.value	= Number(document.forms["form1"].elements["activity_InMonth"].options[document.forms["form1"].elements["activity_InMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbInDt_Activities.value	= document.forms["form1"].elements["activity_InDate"].options[document.forms["form1"].elements["activity_InDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutYr_Activities.value	= Number(document.forms["form1"].elements["activity_OutYear"].options[document.forms["form1"].elements["activity_OutYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbOutMn_Activities.value	= Number(document.forms["form1"].elements["activity_OutMonth"].options[document.forms["form1"].elements["activity_OutMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbOutDt_Activities.value	= document.forms["form1"].elements["activity_OutDate"].options[document.forms["form1"].elements["activity_OutDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbInMn.value=Number(document.forms["form1"].elements["activity_InMonth"].options[document.forms["form1"].elements["activity_InMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbInYr.value=document.forms["form1"].elements["activity_InYear"].options[document.forms["form1"].elements["activity_InYear"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutMn.value=Number(document.forms["form1"].elements["activity_OutMonth"].options[document.forms["form1"].elements["activity_OutMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbOutYr.value=document.forms["form1"].elements["activity_OutYear"].options[document.forms["form1"].elements["activity_OutYear"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbInDt.value=document.forms["form1"].elements["activity_InDate"].options[document.forms["form1"].elements["activity_InDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutDt.value=document.forms["form1"].elements["activity_OutDate"].options[document.forms["form1"].elements["activity_OutDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbNoOfAdults_Activities.value 	= document.forms["form1"].elements["R1occAdults_A"].value;
	document.forms["ResPkgSearchForm"].cmbNoOfChildren_Activities.value = document.forms["form1"].elements["R1occChi_A"].value;
	var roomChildren= Number(document.forms["ResPkgSearchForm"].cmbNoOfChildren_Activities.value);
	document.forms["ResPkgSearchForm"].gstChildAges_Activities.value = "";
	for(var childCount=0;childCount<Number(roomChildren);childCount++){
		document.forms["ResPkgSearchForm"].gstChildAges_Activities.value+=document.forms["form1"].elements["R1occAge"+(childCount+1)+"_A"].value;
		if(childCount!=(Number(roomChildren)-1)){
			document.forms["ResPkgSearchForm"].gstChildAges_Activities.value+=",";
		}
	}
	var OutMonth=document.forms["ResPkgSearchForm"].cmbOutMn.value;
	var InMonth=document.forms["ResPkgSearchForm"].cmbInMn.value;
	var cMonth=Number(_InDate.getMonth()+1);
	var d = new Date();
	var curr_year = d.getFullYear();
	document.forms["ResPkgSearchForm"].cmbNgt_Activities.value	= Number(document.forms["form1"].elements["activity_nights"].options[document.forms["form1"].elements["activity_nights"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].actType_Activities.value	= document.forms["form1"].elements["Act_type"].options[document.forms["form1"].elements["Act_type"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].pkgType.value	= "A";
	document.forms["ResPkgSearchForm"].consumerRegionId.value 		= document.forms["form1"].A_Country.value;
	var currentDate 	= new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate());
	var checkinDate 	= new Date(Number(document.forms["ResPkgSearchForm"].cmbInYr.value),Number(document.forms["ResPkgSearchForm"].cmbInMn.value)-1,Number(document.forms["ResPkgSearchForm"].cmbInDt.value));
	var checkoutDate 	= new Date(Number(document.forms["ResPkgSearchForm"].cmbOutYr.value),Number(document.forms["ResPkgSearchForm"].cmbOutMn.value)-1,Number(document.forms["ResPkgSearchForm"].cmbOutDt.value));
	if (searchStr==""){
		alert("Please Enter the Location!");
	}else if (checkinDate>checkoutDate || checkinDate<currentDate){
		alert("The Correct Date Should be Selected!");
	}else {
		befSubmit('A');
		document.forms["ResPkgSearchForm"].submit();
	}
}
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(7);
var _OutDate = new retDate(8);
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())+"");
// counting Max days in a month
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 monthOptsNew(setmonth){
  var myDate    = new Date();
  var optMonths ="";	
  if(browser=='Netscape'){
  var new_year  = myDate.getYear() + Number(1900);
  }else{
  var new_year  = myDate.getYear();
  }
  var new_month = Number(setmonth);
  var new_date  = myDate.getDate();
  var  m_months= new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
  var ixpb = new_month;
  var yrCnt = new_year;
  var cnt = 0;
  for(idx = ixpb; idx < 12; idx++){
        optMonths+="<option value=\""+idx+"-"+Number(yrCnt)+"\">"+m_months[idx]+" "+Number(yrCnt)+"</option>\n";  
        cnt++;
  }
  yrCnt = yrCnt+1;
  var rem = 12 - cnt;
  for(idx = 0; idx < rem; idx++){
        optMonths+="<option value=\""+idx+"-"+Number(yrCnt)+"\">"+m_months[idx]+" "+Number(yrCnt)+"</option>\n";    

  } 
  return optMonths;
}
//satting date, month and year for the drop down box.
function dateCombo(objNm,inout,year,month,date) {
	retStr="";
	if (inout=="_In"){
		retStr="<div style='width:300px;'>"+		
		"<div style='float:left;width:60px'><select class='desmid7' name=\""+objNm+inout+"Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+dateOpts(maxdays(month,year),date)+
		"</select></div>"+
	
		"<div style='float:left;width:70px;'><select class='desmid7' name=\""+objNm+inout+"Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+monthOpts(month)+
		"</select></div>"+
		
		"<div style='float:left;width:80px'><select  class='desmid7' name=\""+objNm+inout+"Year\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">";	
	}else{
		retStr="<div style='width:300px'>"+
		"<div style='float:left;width:60px'><select class='desmid7' name=\""+objNm+inout+"Date\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+dateOpts(maxdays(month,year),date)+
		"</select></div>"+
		
		"<div style='float:left;width:70px'><select class='desmid7' name=\""+objNm+inout+"Month\" onChange=\"setDtOptIn('"+objNm+"','"+inout+"',this);\">"+monthOpts(month)+
		"</select></div>"+
		
		"<div style='float:left;width:80px'><select  class='desmid7' 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></div>"+
	"<div style='float:left;width:50px;'><a href=\"JavaScript:void(0)\" onClick=\"loadixpCal('"+objNm+"','"+inout+"');\"><img name=\""+objNm+""+inout+"\" src=\"_images/date_magnify.png\"  hspace=\"5\" vspace=\"5\" width=\"32\" height=\"32\" border=\"0\"></a></div>"+
	"</div>";
    return retStr;
}

function loadixpCal(nm,inout){
activeDateObjNM=nm;
activeDateObjIO=inout;
setcalPos('show',""+nm+""+inout+"");
}
// Set the calender possition
function setcalPos(stat,obj){
	with(document.getElementById("calFrame")){
		if (stat=="show"){
		style.left=(getPosImg(obj,"left")+10)+"px";
		style.top=(getPosImg(obj,"top")+5)+"px";
		style.width=260+"px";style.height=240+"px";
		style.border="#CCC 1px solid";
		style.margin=0+"px";style.padding=0+"px";
		style.display="block";
		calShown=true;
		}else{
		style.display="none";
		style.left=0+"px";style.top=0+"px";style.width=0+"px";style.height=0+"px";
		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<=4; 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 getDtFromOriginalObjctsOut(type,inout){
	var monthCnt =document.forms["form1"].elements[""+(type+inout)+"Month"].options[document.forms["form1"].elements[""+(type+inout)+"Month"].selectedIndex].value;
	var YearVal = document.forms["form1"].elements[""+(type+inout)+"Year"].options[document.forms["form1"].elements[""+(type+inout)+"Year"].selectedIndex].value;
	tmpOutDate = new Date(document.forms["form1"].elements[""+(type+inout)+"Year"].options[document.forms["form1"].elements[""+(type+inout)+"Year"].selectedIndex].value,document.forms["form1"].elements[""+(type+inout)+"Month"].options[document.forms["form1"].elements[""+(type+inout)+"Month"].selectedIndex].value,document.forms["form1"].elements[""+(type+inout)+"Date"].options[document.forms["form1"].elements[""+(type+inout)+"Date"].selectedIndex].value,0,0,0,0);
	var yearDiff = Number(tmpOutDate.getFullYear())-Number(toDay.getFullYear());
        if(yearDiff > 0){
		monthCnt = Number(monthCnt)+12;}
	var otuValue = monthCnt+"-"+YearVal;	}
function getDtFromOriginalObjcts(type,inout){
	var monthCnt =document.forms["form1"].elements[""+(type+inout)+"Month"].options[document.forms["form1"].elements[""+(type+inout)+"Month"].selectedIndex].value;
	var YearVal = document.forms["form1"].elements[""+(type+inout)+"Year"].options[document.forms["form1"].elements[""+(type+inout)+"Year"].selectedIndex].value;
	tmpOutDate = new Date(document.forms["form1"].elements[""+(type+inout)+"Year"].options[document.forms["form1"].elements[""+(type+inout)+"Year"].selectedIndex].value,document.forms["form1"].elements[""+(type+inout)+"Month"].options[document.forms["form1"].elements[""+(type+inout)+"Month"].selectedIndex].value,document.forms["form1"].elements[""+(type+inout)+"Date"].options[document.forms["form1"].elements[""+(type+inout)+"Date"].selectedIndex].value,0,0,0,0);
	var yearDiff = Number(tmpOutDate.getFullYear())-Number(toDay.getFullYear());
        if(yearDiff > 0){
		monthCnt = Number(monthCnt)+12;
	}
	var otuValue = monthCnt+"-"+YearVal;	
}
function setDtToOriginalObjcts(type,inout){
	var selValue = document.forms["form1"].elements[""+(type+inout)+"MonthYr"].options[document.forms["form1"].elements[""+(type+inout)+"MonthYr"].selectedIndex].value;
	var monthCnt = selValue.substring(0,selValue.indexOf("-"));
	if( monthCnt>=12){
		monthCnt =  (monthCnt-12);
	}
	var YearVal = selValue.substring(selValue.indexOf("-")+1);
	document.forms["form1"].elements[""+(type+inout)+"Month"].value = monthCnt;
	document.forms["form1"].elements[""+(type+inout)+"Year"].value = YearVal;
}
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),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),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 crow =-1; //Current Selected Row Number of AJAX dropdown
var sendAjax = false;
var crowmax = 10;
//************** Add By KasunC For Keybord navigation feature of ajax dropdown
function submit_ctrl(){
	return sendAjax;
}
function $obj(id){
	return document.getElementById(id);	
}
document.onkeydown=function(evt){
	var keycode =0;
	if (evt && evt.keyCode) { //NS
			keycode = evt.keyCode;
		}else if(window.event && window.event.keyCode) { //IE
			keycode=window.event.keyCode;
		}
	
	if(keycode==40){
	   /* Go Down - Down Arow Key
		* setdatatr2 class is for selected row
  		* setdatatr1 class is for other rows
		*/
			//alert(keycode)
			try{
				crow++;
				sendAjax = false;
				try{
					if($obj('drpTr_'+(crow-1))!=null)
						$obj('drpTr_'+(crow-1)).className='stripe3';
				}catch(e){
								//		alert(e+" >> 1")
						}
				try{
					$obj('drpTr_'+crow).className='overclass';
				}catch(e){
					//alert(e+" >> 2")
					crow=-1;
				}
				//Show Hide results when current ro reaches 10
				//if(crow==10)
				//	showMore()
				
			}catch(e){
				sendAjax = true;
				crow =-1;
				alert(e)
			}
	}else if(keycode==38){
	//Go Up
		crow--;
		try{
			$obj('drpTr_'+(crow+1)).className='stripe3';
		}catch(e){}
		try{
			$obj('drpTr_'+(crow)).className='overclass';
		}catch(e){
			crow=crowmax;
			try{$obj('drpTr_'+(crow1)).className='stripe3';}catch(e){}
		}
		
	}else if(keycode==13){
					sendAjax = false;
//Press Enter
		if($obj('drpTr_'+crow)){
			try{

				$obj('drpTr_'+crow).onclick();
//				setVal((crow),drpObj,drpkey)
			}catch(e){
				alert(e+"---3")
				
				}
			}
		
	}else{
		sendAjax = true;
		crow =-1;
	}
}
// city drop down array for the city text box
var checkMore=0;
var count =0;
var checkMore=0;

function setChar(ch,img,pkgtyp){
	//alert(1)
	if(!sendAjax)
		return;

		
	count  = 0;
var tmpArr = new Array();
var flag =0;
if(pkgtyp=='H'||pkgtyp=='A'){
	for (var j=0; j<cityArr.length; j++){
			//console.log(cityArr[j]);
			if (cityArr[j][1].toUpperCase().indexOf(ch.value.toUpperCase())==0){
			if (!showAllLoc){checkMore++;if (checkMore>10){break;}}
			if(cityArr[j][4]!=""){
			tmpArr[tmpArr.length]="<tr><td id=\"drpTr_"+(count++)+"\" 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][4]+" / "+cityArr[j][5]+"</td></tr>";}
			else{
			tmpArr[tmpArr.length]="<tr><td id=\"drpTr_"+(count++)+"\" 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>"; }
			}
		
	}
	
}
	
	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\">&nbsp;&nbsp;&nbsp;<img src=\"./_images/morearrow.gif\" width=\"13\" height=\"13\" border=\"0\" hspace=\"10\" vspace=\"0\" alt=\"Show All\" align=\"absmiddle\">&nbsp;&nbsp;&nbsp;&nbsp;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;

crowmax = count;
}


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;
				}
		//alert(ixppos);
		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;
				}
		//alert(ixppos);
		return ixppos;
	}
}

function showRes(img,outSt,records){
setObjPos('ixpDataFrame',getPosImg(img,'left'),getPosImg(img,'top'),290,records,'block');
setObjPos('maskFrame',getPosImg(img,'left'),getPosImg(img,'top'),290,records,'block');
document.getElementById("ixpDataFrame").innerHTML=outSt;
}
function setObjPos(name,x,y,w,recs,stat){
	with(document.getElementById(name).style){
	left=x-10+'px';
	top=y-15+'px';
	width=w+'px';
	height=recs*23+'px';
	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'){
		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];
	}
	setObjPos('ixpDataFrame',0,0,180,0,'none');
	setObjPos('maskFrame',0,0,180,0,'none');
	showAllLoc=false;
}

function getSelVal(fr,nm){
try{
	return; 
}catch(exp){
	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|-|%|%@";
			}		
		}
	}
	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_A(val,rm){
setTimeout("showAgComset_A("+val+",'"+rm+"')",1);
}
// dta
function showAgComset_A(val,rm){
if (val==0){
try{document.getElementById("R"+rm+"ageTbl_A").style.display="none";}catch(ex){}
}else{
try{document.getElementById("R"+rm+"ageTbl_A").style.display="block";}catch(ex){}
}

	for (fgh=1; fgh<=3; fgh++){
		if (fgh<=val){
			document.getElementById("R"+rm+"chAgHd"+fgh+"_A").style.display="block";
			document.getElementById("R"+rm+"occAge"+fgh+"_A").style.display="block";
		}else{
			document.getElementById("R"+rm+"chAgHd"+fgh+"_A").style.display="none";
			document.getElementById("R"+rm+"occAge"+fgh+"_A").style.display="none";
		}
	}
}
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++){
			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++){
			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++){
			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++){
			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<6; oc++){
if(oc==0){_sty="block";}else{_sty="none";}
occStr+="<span id=\"occR"+(oc+1)+"\" style=\"display:"+_sty+";\"><div style='width:365px;float:right;'>\n"+
"<div>\n"+
"<div style='float:left;width:100px'>&nbsp;<br><br><br><span class='entxt'>Room&nbsp;"+(oc+1)+"</span></div>\n"+
"<div style='float:left;width:100px'><span class='entxt'>Adults</span><br><select class='desmidf' name=\"R"+(oc+1)+"occAdults\" style=\"width:50px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,9,1)+"</select></div>\n"+
"<div style='float:left;width:100px'><span class='entxt'>Children</span><br><select class='desmidf' name=\"R"+(oc+1)+"occChi\" style=\"width:50px;\" onChange=\"setSelRoomOcc();showAgCom(Number(this.options[this.selectedIndex].value),"+(oc+1)+");\">\n"+opts(0,3,0)+"</select></div>\n"+
"<div class=\"txt\">\n"+
"<span id=\"R"+(oc+1)+"ageTbl\" style=\"display:none;\"><div style=\"float:left;width:365px;height:28px;\">\n"+
"<div style='float:left;width:100px'>&nbsp;</div>\n"+
"<div style='float:left;width:98px'><span id=\"R"+(oc+1)+"chAgHd1\" class='entxt' style=\"display:none;\">Age 1</span></div>\n"+
"<div style='float:left;width:98px'><span id=\"R"+(oc+1)+"chAgHd2\" class='entxt' style=\"display:none;\">Age 2</span></div>\n"+
"<div style='float:left;width:50px'><span id=\"R"+(oc+1)+"chAgHd3\" class='entxt' style=\"display:none;\">Age 3</span></div>\n"+
"<div style='float:left;width:98px'><span id=\"R"+(oc+1)+"chAgHd4\" class='entxt' style=\"display:none;\">Age 4</span></div></div>\n"+
"<div>\n"+
"<div style='float:left;width:100px'>&nbsp;</div>\n"+
"<div style='float:left;width:98px;display:none;' id=\"R"+(oc+1)+"occAge1\"><select class='desmidf' name=\"R"+(oc+1)+"occAge1\" style=\"width:50px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></div>\n"+
"<div style='float:left;width:98px;display:none;' id=\"R"+(oc+1)+"occAge2\"><select class='desmidf'  name=\"R"+(oc+1)+"occAge2\" style=\"width:50px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></div>\n"+
"<div style='float:left;width:60px;display:none;'  id=\"R"+(oc+1)+"occAge3\"><select class='desmidf' name=\"R"+(oc+1)+"occAge3\" style=\"width:50px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></div>\n"+
"<div style='float:left;width:35x;display:none;' id=\"R"+(oc+1)+"occAge4\"><select class='desmidf'  name=\"R"+(oc+1)+"occAge4\" style=\"width:37px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,18,1)+"</select></div>\n"+
"</div></span></div>\n"+
"</div>\n";
"</div>\n";
}
return occStr;
}
// Activities Adults, childer details
function buildActivityOcc(){
var occStr="";
var _sty="";
var oc=0;
if(oc==0){_sty="block";}else{_sty="none";}
occStr+="<span id=\"occR"+(oc+1)+"_A\" style=\"display:"+_sty+";\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"1\">\n"+
"<tr>\n"+
"<td width=\"50\" valign='bottom'>Adults<br><select class='cormid' name=\"R"+(oc+1)+"occAdults_A\" style=\"width:37px;\" onChange=\"setSelRoomOcc();\">\n"+opts(1,4,1)+"</select></td>\n"+
"<td  width=\"50\"valign='bottom'>Children<br><select name=\"R"+(oc+1)+"occChi_A\" style=\"width:37px;\" onChange=\"showAgCom_A(Number(this.options[this.selectedIndex].value),"+(oc+1)+");\">\n"+opts(0,3,0)+"</select></td>\n"+
"<td class=\"txt\">\n"+
"<span id=\"R"+(oc+1)+"ageTbl_A\" style=\"display:none;\"><table width=\"120\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"+
"<tr>\n"+
"<td class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd1_A\" style=\"display:none;\">Age 1</span></td>\n"+
"<td class=\"txt\" ><span id=\"R"+(oc+1)+"chAgHd2_A\" style=\"display:none;\">Age 2</span></td>\n"+
"<td class=\"txt\"><span id=\"R"+(oc+1)+"chAgHd3_A\" style=\"display:none;\">Age 3</span></td>\n"+
"<td class=\"txt\" ><span id=\"R"+(oc+1)+"chAgHd4_A\" style=\"display:none;\">Age 4</span></td>\n"+
"</tr>\n"+
"<tr>\n"+
"<td ><select id=\"R"+(oc+1)+"occAge1_A\" name=\"R"+(oc+1)+"occAge1_A\" style=\"width:37px;display:none;\" onChange=\"\">\n"+opts(1,10,1)+"</select></td>\n"+
"<td ><select id=\"R"+(oc+1)+"occAge2_A\" name=\"R"+(oc+1)+"occAge2_A\" style=\"width:37px;display:none;\" onChange=\"\">\n"+opts(1,10,1)+"</select></td>\n"+
"<td ><select id=\"R"+(oc+1)+"occAge3_A\" name=\"R"+(oc+1)+"occAge3_A\" style=\"width:37px;display:none;\" onChange=\"\">\n"+opts(1,10,1)+"</select></td>\n"+
"<td ><select id=\"R"+(oc+1)+"occAge4_A\" name=\"R"+(oc+1)+"occAge4_A\" style=\"width:37px;display:none;\" onChange=\"\">\n"+opts(1,10,1)+"</select></td>\n"+
"</tr>\n"+
"</table></span></td></tr>\n"+
"</table>\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;
}

//  To display searched hotel detilas on the processing page
function befSubmit(pkgType){
	if(pkgType=='H'){
		var srhdates="<br>Arriving on <b>"+_month[Number(document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value+"</b>, Departing <b>"+_month[Number(document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value+"-"+document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value+"</b>";
			var rooms 	= document.forms["ResPkgSearchForm"].elements["cmbNoRm_Hotels"].value;
			var nignts 	= document.forms["ResPkgSearchForm"].cmbNgt_Hotels.value;			 
			var loc 	= document.forms["ResPkgSearchForm"].searchCityName.value;
var mnth = new Array ("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var inmonth=Number(document.forms["ResPkgSearchForm"].cmbInMn_Hotels.value);
var outmonth=Number(document.forms["ResPkgSearchForm"].cmbOutMn_Hotels.value);
			var arrDate = document.forms["ResPkgSearchForm"].cmbInDt_Hotels.value+"-"+mnth[inmonth]+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Hotels.value;
			var deptDate = document.forms["ResPkgSearchForm"].cmbOutDt_Hotels.value+"-"+mnth[outmonth]+"-"+document.forms["ResPkgSearchForm"].cmbOutYr_Hotels.value;
	searchMessage="<table width='700' id='plswait' class='plswait' border='0'  cellpadding='0' cellspacing='0' style='font-size:14px;'>\n"+
"<tr><td>&nbsp;</td></tr><tr>\n"+
"<td  class='reztoplease'><div align='center' style='color:#ff8400;'>We are processing your request.Please wait...</div></td></tr>\n"+
"<tr><td>&nbsp;</td></tr><tr>\n"+
"<td align='center'><div align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='300' height='30'>\n"+
"<param name='movie' value='./_images/rezimg/preloard.swf' />\n"+
"<param name='quality' value='high' />\n"+
"<embed src='./_images/rezimg/preloard.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='300' height='30'></embed>\n"+
"</object></div></td></tr>\n"+
"<tr><td>\n"+
"<div class='fam'><img src='http://www14.secure-reservation.com/rez2goholidays/admin/images/web_images/banners/50off-250x250.jpg' width='200' height='200'></div><div class='searchcont'><fieldset style='border:solid 1px #f99406;padding:5px;'><legend style='color:#666666;font-size:14px;'>&nbsp; Your Requested Search Criteria &nbsp;</legend><table width='350' border='0' align='center' cellpadding='5' cellspacing='5' class='dark'></td></tr>\n"+
"  <tr>\n"+
"    <td width='40%'></td>\n"+
"    <td width='60%'></td>\n"+
"  </tr>\n"+
"  <tr style='display:none;'>\n"+
"    <td align='right'>Selected Product :</td>\n"+
"    <td>&nbsp;Hotels</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Location :</td>\n"+
"    <td>&nbsp;"+loc+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Arrival Date :</td>\n"+
"    <td>&nbsp;"+arrDate+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Night(s) :</td>\n"+
"    <td>&nbsp;"+nignts+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Departure Date :</td>\n"+
"    <td>&nbsp;"+deptDate+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Room(s):</td>\n"+
"   <td>&nbsp;"+rooms+"</td>\n"+
" </tr>\n"+
"</table></fieldset></div>\n"+
"</td>\n"+
"</tr>\n"+
"</table>";
	}
//  To display searched hotel detilas on the processing page
	if(pkgType=='A'){
		var srhdates=_month[Number(document.forms["ResPkgSearchForm"].cmbInMn_Activities.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbInDt_Activities.value+"-"+document.forms["ResPkgSearchForm"].cmbInYr_Activities.value;
	var departda= _month[Number(document.forms["ResPkgSearchForm"].cmbOutMn_Activities.value)-1]+"-"+document.forms["ResPkgSearchForm"].cmbOutDt_Activities.value+"-"+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='100%' id='plswait' class='plswait' border='0' align='center' cellpadding='0' cellspacing='0' style='font-size:14px;'>\n"+
"<tr><td>&nbsp;</td></tr>\n"+
"<tr><td>&nbsp;</td></tr><tr>\n"+
"<td align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='275' height='32'>\n"+
"<param name='movie' value='images/preload_new.swf' />\n"+
"<param name='quality' value='high' />\n"+
"<embed src='images/preload_new.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='275' height='32'></embed>\n"+
"</object></td></tr><tr><td>&nbsp;</td></tr><tr>\n"+
"<td align='center'  class='bold'>We are processing your request.Please wait...</td></tr><tr><td>&nbsp;</td></tr></table>\n"+
"<tr><td><fieldset style='border:solid 1px #f99406;padding:5px;'><legend style='color:#000000;font-size:14px;background-color:#f99406'>&nbsp; Your Requested Search Criteria &nbsp;</legend>\n"+
"<table width='275' border='0' align='center' cellpadding='4' cellspacing='2' style='font-size:11px;color: #000000;font-weight:bold;border:none;'>\n"+
"  <tr>\n"+
"    <td width='40%'></td>\n"+
"    <td width='60%'></td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Activity type:</td>\n"+
"    <td>&nbsp;"+actTypeName+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'> Location:</td>\n"+
"    <td>&nbsp;"+loc+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Night(s):</td>\n"+
"    <td>&nbsp;"+nights+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Night(s):</td>\n"+
"    <td>&nbsp;"+srhdates+"</td>\n"+
"  </tr>\n"+
"  <tr>\n"+
"    <td align='right'>Night(s):</td>\n"+
"    <td>&nbsp;"+departda+"</td>\n"+
"  </tr>\n"+
"</table>\n"+
"</fieldset>\n"+
"</td>\n"+
"</tr>\n"+
"</table>";
}
	document.getElementById("searchMsg").innerHTML=searchMessage;
	document.getElementById("loading").style.display="block";
	//document.getElementById("bodycontent").style.display="block";
	set_to_center("loading");
	//document.getElementById("rezto").style.display="none";
	//document.getElementById("fullContent").style.display="none";
	//document.getElementById("waitMsg").style.display="block";
}

function onewayHide(val){
	if (val=="Air_TripType2"){
	document.getElementById("objgo").style.display="block";
	}else{
	document.getElementById("objgo").style.display="none";
	}
}
// radio buttons  hotel city values
function passvalue(val){
if (val=="MI"){
document.forms["form1"].elements["hid_H_Loc"].value="23802|Miami Beach - FL|11|55|Florida|USA";
document.forms["form1"].elements["H_Loc"].value="Miami Beach";
}else if (val=="LV"){
document.forms["form1"].elements["hid_H_Loc"].value="1344|Las Vegas - NV||55||USA";
document.forms["form1"].elements["H_Loc"].value="Las Vegas";
}else if (val=="NY"){
document.forms["form1"].elements["hid_H_Loc"].value="1350|New York - NY|36|55|New York|USA";
document.forms["form1"].elements["H_Loc"].value="New York City";
}else if (val=="OR"){
document.forms["form1"].elements["hid_H_Loc"].value="1240|Orlando|11|55|Florida|USA";
document.forms["form1"].elements["H_Loc"].value="Orlando";
}else if (val=="LA"){
document.forms["form1"].elements["hid_H_Loc"].value="1197|Los Angeles Area - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Los Angeles";
}else if (val=="CH"){
document.forms["form1"].elements["hid_H_Loc"].value="1271|Chicago - IL||55||USA";
document.forms["form1"].elements["H_Loc"].value="Chicago";
}else if (val=="BO"){
document.forms["form1"].elements["hid_H_Loc"].value="1288|Boston - MA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Boston";
}else if (val=="SF"){
document.forms["form1"].elements["hid_H_Loc"].value="1210|San Francisco Area - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="San Francisco";
}else if (val=="HA"){
document.forms["form1"].elements["hid_H_Loc"].value="1263|Hawaii||55||USA";
document.forms["form1"].elements["H_Loc"].value="Hawaii";
}else if (val=="SD"){
document.forms["form1"].elements["hid_H_Loc"].value="1208|San Diego - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="San Diego";
}else if (val=="WA"){
document.forms["form1"].elements["hid_H_Loc"].value="1227|Washington D.C. - DC||55||USA";
document.forms["form1"].elements["H_Loc"].value="Washington";
}else if (val=="AT"){
document.forms["form1"].elements["hid_H_Loc"].value="1255|Atlanta - GA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Atlanta";
}else if (val=="LO"){
document.forms["form1"].elements["hid_H_Loc"].value="1112|London||54||United Kingdom";
document.forms["form1"].elements["H_Loc"].value="London";
}else if (val=="PA"){
document.forms["form1"].elements["hid_H_Loc"].value="530|Paris||214||France";
document.forms["form1"].elements["H_Loc"].value="Paris";
}else if (val=="NE"){
document.forms["form1"].elements["hid_H_Loc"].value="688|Negril||88||Jamaica";
document.forms["form1"].elements["H_Loc"].value="Negril";
}else if (val=="MO"){
document.forms["form1"].elements["hid_H_Loc"].value="687|Montego Bay||88||Jamaica";
document.forms["form1"].elements["H_Loc"].value="Montego";
}
}
//Setting No of Rooms for the hotel
var roomComboData=
"<div style='width:450px;'><div style='width:80px;float:left;'><span class='entxt'>Rooms</span><br><select name='H_cmbNoOfRooms' class='desmidf' style='width:50px;' onChange='showRooms(Number(this.options[this.selectedIndex].value));'>"+opts(1,4,1)+
"</select></div>"+
"<div  style='float:left;width:350px;'> "+buildOcc()+"</div>"+
"</div>"+
"<div>"+
"<span id='adultsCombo' style='display:none;'></span>"+
"<span id='occBox' style='display:block;'></div>";
//City drop down function to load the correct cities
function citylookup(vlength,text,fieldname,imgname){
	if(vlength>1){
		setChar(text,imgname,'H',fieldname);
	}else{
	hide_things();
	}
}

//Setting some defoult values according to the selected product.
function setEngType(val){
	document.forms["form1"].pkgType.value = val;
	document.forms["ResPkgSearchForm"].pkgType.value = val;
	document.forms["ResPkgSearchForm"].elements["engineType"].value=val;
	if (val=="H"){
		document.getElementById("roomComboH").innerHTML=roomComboData;
		document.getElementById("hotelDisplay").style.display="block";
		document.getElementById("activityDisplay").style.display="none";		
		showRooms(1);
		document.forms["form1"].elements["H_nights"].value="1";
		document.forms["form1"].elements["hid_H_Loc"].value="";
		document.forms["form1"].elements["hid_A_Loc"].value="";
	}else if (val=="A"){
		document.getElementById("hotelDisplay").style.display="none";	
		document.getElementById("activityDisplay").style.display="block";
		document.forms["form1"].activity_Loc.value="";
		document.forms["form1"].elements["activity_nights"].value="1";
		document.forms["form1"].elements["Act_type"].value="0";
		document.forms["form1"].elements["hid_H_Loc"].value="";
		document.forms["form1"].elements["hid_A_Loc"].value="";
	}
}

//Search button function to changes the product type (Hotel or Activities)
function searchdetail(){
	document.forms["ResPkgSearchForm"].elements["pkgType"].value=document.forms["form1"].pkgType.value;
	eval("loadDataNew_"+document.forms["form1"].pkgType.value+"()");
}
//clear the city text box value when you place the cursor
function clearcityname(){
for (var i=0; i<document.form1.cityname.length; i++)
  document.form1.cityname[i].checked = false;
  document.form1.H_Loc.value="";
  }
// getValue function is using for some deep link cities
function passvalue(val){
if (val=="MI"){
document.forms["form1"].elements["hid_H_Loc"].value="23802|Miami Beach - FL|11|55|Florida|USA";
document.forms["form1"].elements["H_Loc"].value="Miami Beach";
}else if (val=="LV"){
document.forms["form1"].elements["hid_H_Loc"].value="1344|Las Vegas - NV||55||USA";
document.forms["form1"].elements["H_Loc"].value="Las Vegas";
}else if (val=="NY"){
document.forms["form1"].elements["hid_H_Loc"].value="1350|New York - NY|36|55|New York|USA";
document.forms["form1"].elements["H_Loc"].value="New York City";
}else if (val=="OR"){
document.forms["form1"].elements["hid_H_Loc"].value="1240|Orlando|11|55|Florida|USA";
document.forms["form1"].elements["H_Loc"].value="Orlando";
}else if (val=="LA"){
document.forms["form1"].elements["hid_H_Loc"].value="1197|Los Angeles Area - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Los Angeles";
}else if (val=="CH"){
document.forms["form1"].elements["hid_H_Loc"].value="1271|Chicago - IL||55||USA";
document.forms["form1"].elements["H_Loc"].value="Chicago";
}else if (val=="BO"){
document.forms["form1"].elements["hid_H_Loc"].value="1288|Boston - MA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Boston";
}else if (val=="SF"){
document.forms["form1"].elements["hid_H_Loc"].value="1210|San Francisco Area - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="San Francisco";
}else if (val=="HA"){
document.forms["form1"].elements["hid_H_Loc"].value="1263|Hawaii||55||USA";
document.forms["form1"].elements["H_Loc"].value="Hawaii";
}else if (val=="SD"){
document.forms["form1"].elements["hid_H_Loc"].value="1208|San Diego - CA||55||USA";
document.forms["form1"].elements["H_Loc"].value="San Diego";
}else if (val=="WA"){
document.forms["form1"].elements["hid_H_Loc"].value="1227|Washington D.C. - DC||55||USA";
document.forms["form1"].elements["H_Loc"].value="Washington";
}else if (val=="AT"){
document.forms["form1"].elements["hid_H_Loc"].value="1255|Atlanta - GA||55||USA";
document.forms["form1"].elements["H_Loc"].value="Atlanta";
}else if (val=="LO"){
document.forms["form1"].elements["hid_H_Loc"].value="1112|London||54||United Kingdom";
document.forms["form1"].elements["H_Loc"].value="London";
}else if (val=="PA"){
document.forms["form1"].elements["hid_H_Loc"].value="530|Paris||214||France";
document.forms["form1"].elements["H_Loc"].value="Paris";
}else if (val=="NE"){
document.forms["form1"].elements["hid_H_Loc"].value="688|Negril||88||Jamaica";
document.forms["form1"].elements["H_Loc"].value="Negril";
}else if (val=="MO"){
document.forms["form1"].elements["hid_H_Loc"].value="687|Montego Bay||88||Jamaica";
document.forms["form1"].elements["H_Loc"].value="Montego";
}
}
// Brows() function is calling to body onload to changes the DOCTYPE for the dropdown city list
function browsc(){
var nav=navigator.appName;
var uag=navigator.userAgent;
var brow="";
var errorMsg="";
if (uag.indexOf("Netscape/7")>-1){
brow="NS7";
brow=="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
}else if (uag.indexOf("Firefox")>-1){
brow="Firefox";
brow=="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>";
}else if (uag.indexOf("Opera")>-1){
brow="Opera";
brow=="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
}else if(uag.indexOf("IE")>-1){
brow="IE";
brow=="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
}else if(uag.indexOf("Safari")>-1){
brow="Safari";
brow=="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
}else{
brow=="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";	
}
}
function set_to_center(e){

  var divH = document.getElementById(e).offsetHeight;
  if(navigator.appName=='Netscape'){
   var screenH = window.innerHeight || document.body.offsetHeight;
  }else{
   var screenH = document.documentElement.clientHeight;
  }
  var scrollH = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
  var scrollW = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
  var divW = document.getElementById(e).offsetWidth;
  var screenW = document.documentElement.clientWidth;

  var top = scrollH + (screenH-divH)/2;
  var left = scrollW + (screenW - divW)/2;
  document.getElementById(e).style.top = top+'px';
  document.getElementById(e).style.left = left+'px'; 
  	
 }
 function hideBox(div)
{
    divObj = document.getElementById(div);
    divObj.style.display = 'none';
	//location.reload(true);

}
