var taLoginSts = "";
var custLoginSts = "";
var campaign="";
var referalUrl="";
var childAge='';
var rarName='';
var sourceCd="";
var clickCd="";
var promoUrl="";
var isQuickSeach = "Y";
var eDur="";
var eDt = "";
var mStDt = "";
var eSlp="";
var mRad = "";
var mRes = "";
var mAr = "";
var mReg = "";
var eRadMap = "";
var eTwnNmMap = "";
var openCityList = "";
var emptyUserIdMsg = "";
var emtyPwdMsg = "";
var controlInnerHtml;
var pagePrefix = "";
var rarButtonPath = "";
function checkMandatoryAttr(ctrlnm,errormsg)
{
    var ctrl=document.getElementById(ctrlnm);
    if(ctrl!=null && ctrl.value==""  && ctrl.getAttribute("mandatory")=="Y")
    {
        alert(errormsg);
        ctrl.focus();
        return false;
    }
    return true;
}
function searchOnclick(searchName, propType)
{
	var url;
	url = "Search_DeepLink.aspx?IsInternalDeeplink=Y&SearchName=" + searchName;
	url = url + "&PropertyType=" + propType;
	var siteGuId=document.getElementById( "hdnSiteGuid" );
	if (siteGuId != null)
		url = url +  "&SiteGuid=" + siteGuId.value;
	location.href = url;
	return false;
}
function propRefSearchOnclick(propType)
{	
	var url = new Array();
	var propRef = "";
	url.push("http://localhost:1067/Cendant.VRG.Web.UserJourney-Relaunch/pages/PropRefResult.aspx?QS=");
	var siteGuId=document.getElementById( "hdnSiteGuid" );
	if (siteGuId != null)
		url.push(siteGuId.value);
	url.push("~");
	
	propertyRef = document.getElementById( "txtPropertyRef" );
	if(propertyRef != null)
	{
		propRef = propertyRef.value;
	}
	if( propRef.length >0 )
	{
		url.push(propRef);
	}
	url.push("~");
	
	url.push("~~~");
	
	url.push("SourceCode=W845800");
	
	location.href = url;
	return false;
}
function advancedSearchOnclick(propType, travelOption, countryCd, languageCd, currencyCd, propertyNm, discountCd, propertyRef, unitType, 
                                exactDateSearch, holidayStartDate, lengthOfStay, userPreference, stepPreference, regionCd, areaCd, resortCd, 
                                latitude, longitude,locationNm, radius,	sleeps, adults, children, child1, child2, infants, priceRange, 
                                highestPriceRangeInd, grade, showPropOnComplex, showPropWithDiscount, noOfBedrooms,showMapInResult,
							    departureAirport, arrivalAirport, childrenAges)
{
	var url;	
	var siteGuId=document.getElementById( "hdnSiteGuid" );
	var strArr=new Array ();
	strArr.push ( "SearchResult_DeepLink.aspx?IsInternalDeeplink=Y&PropertyType=" );
	strArr.push ( propType ) ;			
	if (siteGuId != null)
		strArr.push ( "&SiteGuid=" );
		strArr.push ( siteGuId.value );
	if( travelOption.length >0 )
	{
		strArr.push ( "&TravelOption=" );
		strArr.push ( travelOption );
	}
	if( countryCd.length >0 )
	{
		strArr.push ( "&CountryCd=" );
		strArr.push ( countryCd );
	}
	if( languageCd.length >0 )
	{
		strArr.push ( "&LanguageCd=" );
		strArr.push ( languageCd );
	}
	if( currencyCd.length >0 )
	{
		strArr.push ( "&CurrencyCd=" );
		strArr.push ( currencyCd );
	}
	if( propertyNm.length >0 )
	{
		strArr.push ( "&PropertyName=" );
		strArr.push ( propertyNm );
	}
	if( discountCd.length >0 )
	{
		strArr.push ( "&DiscountCd=" );
		strArr.push ( discountCd );
	}
	if( propertyRef.length >0 )
	{
		strArr.push ( "&PropertyRef=" );
		strArr.push ( propertyRef );
	}
	if( unitType.length >0 )
	{
		strArr.push ( "&UnitType=" );
		strArr.push ( unitType );
	}
	if( exactDateSearch.length >0 )
	{
		strArr.push ( "&ExactDateSearch=" );
		strArr.push ( exactDateSearch );
	}
	if( holidayStartDate.length >0 )
	{
		strArr.push ( "&StartDate=" );
		strArr.push ( holidayStartDate );
	}
	if( lengthOfStay.length >0 )
	{
		strArr.push ( "&LengthOfStay=" );
		strArr.push ( lengthOfStay );
	}
	if( userPreference.length >0 )
	{
		strArr.push ( "&UserPreferences=" );
		strArr.push ( userPreference );
	}
	if( stepPreference.length >0 )
	{
		strArr.push ( "&StepPreferences=" );
		strArr.push ( stepPreference );
	}
	if( regionCd.length >0 )
	{
		strArr.push ( "&RegionCd=" );
		strArr.push ( regionCd);
	}
	if( areaCd.length >0 )
	{
		strArr.push ( "&AreaCd=" );
		strArr.push ( areaCd );
	}
	if( resortCd.length >0 )
	{
		strArr.push ( "&ResortCd=" );
		strArr.push ( resortCd );
	}
	if( latitude.length >0 )
	{
		strArr.push ( "&Latitude=" );
		strArr.push ( latitude );
	}
	if( longitude.length >0 )
	{
		strArr.push ( "&Longitude=" );
		strArr.push ( longitude );
	}
	if( radius.length >0 )
	{
		strArr.push ( "&Radius=" ); 
		strArr.push ( radius );
	}
	if( sleeps.length >0 )
	{
		strArr.push ( "&Sleeps=" );
		strArr.push ( sleeps );
	}
	if( adults.length >0 )
	{
		strArr.push ( "&No_Adults=" );
		strArr.push ( adults );
	}
	if( children.length >0 )
	{
		strArr.push ( "&No_Children=" );
		strArr.push ( children );
	}
	if( child1.length >0 )
	{
		strArr.push ( "&No_Child1=" );
		strArr.push ( child1 );
	}
	if( child2.length >0 )
	{
		strArr.push ( "&No_Child2=" );
		strArr.push ( child2 );
	}
	if( infants.length >0 )
	{
		strArr.push ( "&No_Infants=");
		strArr.push ( infants );
	}
	if( priceRange.length >0 )
	{
		strArr.push ( "&PriceRange=" );
		strArr.push ( priceRange );
	}
	if( highestPriceRangeInd.length >0 )
	{
		strArr.push ( "&HighestPriceRangeIndicator=" );
		strArr.push ( highestPriceRangeInd );
	}
	if( grade.length >0 )
	{
		strArr.push ( "&Grade=" );
		strArr.push ( grade );
	}
	if( showPropWithDiscount.length >0 )
	{
		strArr.push ( "&ShowPropertyWithDiscount=" );
		strArr.push ( showPropWithDiscount );
	}
	if( showPropOnComplex.length >0 )
	{
		strArr.push ( "&ShowPropertyOnComplex=" );
		strArr.push ( showPropOnComplex );
	}
	if( noOfBedrooms.length >0 )
	{
		strArr.push ( "&No_Bedrooms=" );
		strArr.push ( noOfBedrooms );
	}
	if( showMapInResult.length >0 )
	{
		strArr.push ( "&ShowMap=" );
		strArr.push ( showMapInResult );
	}
	if( locationNm.length >0 )
	{
		strArr.push ( "&LocationName=" );
		strArr.push ( locationNm );
	}
	if( departureAirport.length >0 )
	{
		strArr.push ( "&DeparturePorts=" );
		strArr.push ( departureAirport );
	}
	if( arrivalAirport.length >0 )
	{
		strArr.push ( "&ArrivalPort=" );
		strArr.push ( arrivalAirport );
	}
	if( childrenAges.length >0 )
	{
		strArr.push ( "&ChildrenAge=" );
		strArr.push ( childrenAges );
	}
	url=strArr.join ( "" );
	location.href = url;
	return false;
}
function QuickSearch(searchResultAspx,propType,countryCd,currencyCd,sourceCd,clickCd,promoUrl,travelOption,showPropOnCmplx,regionCd,regionNm,
                        areaCd,areaNm,resortCd,resortNm,sleeps,adults,children,infants,campaign,referalUrl)
{
    var hdnSiteGuid = document.getElementById('hdnSiteGuid');
	
	var userInput = new Array();
	userInput.push("QS=");
	if(hdnSiteGuid != null && hdnSiteGuid.value.length > 0)
	{	
		userInput.push(hdnSiteGuid.value);
		userInput.push('~');  
	}
	else
			userInput.push('~');  
	if(propType != null && propType.length > 0)
	{	
		userInput.push(propType);  
		userInput.push('~');  
	}
	else
			userInput.push('~');  
	
    if(countryCd != null && countryCd.length > 0)
	{	
		userInput.push(countryCd);  
		userInput.push('~');  
	}
	else
		userInput.push('~'); 
		 
	if(currencyCd != null && currencyCd.length > 0)
	{	
		userInput.push(currencyCd); 
		userInput.push('~'); 
	}
	else
		userInput.push('~');  
		
	if(travelOption !=null && travelOption.length>0)
	    userInput.push(travelOption);
	userInput.push('~');  
	
	//start date
	userInput.push('~'); 
	
	//length of stay 
	userInput.push('~');  
	
	//exact date search
	userInput.push('~');  
	
	//feature code
	userInput.push('~~~~~~~~');
	
	//Hiearachial Feature Display Flag
	userInput.push('~');  
	
	//property with Discount
	userInput.push('~');  
	
	userInput.push(showPropOnCmplx);
	userInput.push('~');
		
	//userInput.push(regionCd);   
	userInput.push('~');   
	userInput.push(regionNm);   
	userInput.push('~');   
	//userInput.push(areaCd);   
	userInput.push('~');   
	userInput.push(areaNm);   
	userInput.push('~');   
	//userInput.push(resortCd);   
	userInput.push('~');   
	userInput.push(resortNm);   
	userInput.push('~');   
	userInput.push('~');   
	userInput.push(regionCd);
	userInput.push('~');   
	userInput.push(areaCd);
	userInput.push('~');   
	userInput.push(resortCd);  
	userInput.push('~');   
	//end of RAR
	//price range
	userInput.push('~~');
	//grading
	userInput.push('~');  
	//Town seach
	//lattitude longitude
	userInput.push('~~~~');
	//radius
	userInput.push('~');  
	//location name-undone
	//town name
	userInput.push('~');  
	//partner code
	userInput.push('~');  
	
	userInput.push(sleeps);  
	userInput.push('~');  
	
	
    userInput.push(adults);
    userInput.push('~');
	
			
	userInput.push(children);
	userInput.push('~');
		
	
	userInput.push(infants);
	userInput.push('~');
	
		
	//Bedroom
	userInput.push('~');  
	//Flying from
	userInput.push('~');  
	//flying to
	userInput.push('~');   
	//Child age	
    userInput.push('~'); 
    //Is Push Merchandising flag
    userInput.push('~');
		
	userInput.push('Y~~~1~~'); 
	
	var queryStrng;
	queryStrng = searchResultAspx + "?" + userInput.join('');
	location.href = queryStrng;
	return false;
}
function loginError ()
{
	initialize ();	
	var spnTALoginError = document.getElementById( "spnTALoginError" );
	if (spnTALoginError)
		spnTALoginError.style.display = "inline";
}
function loginSuccess ()
{
	//Login has been successful
	var spnTALoginSuccess = document.getElementById( "spnTALoginSuccess" );
	var spnTALoginSuccessMsg = document.getElementById( "spnTALoginSuccessMsg" );
	if (spnTALoginSuccess != null && spnTALoginSuccessMsg != null)
	{
	    var text = "";
	    
	    if(spnTALoginSuccessMsg.innerHTML != null)
	        text = spnTALoginSuccessMsg.innerHTML;
	        
		spnTALoginSuccess.innerHTML = text + document.getElementById( "hdnTAName" ).value;
		spnTALoginSuccess.style.display = "inline";
	}

    var divTALogin = document.getElementById( "divTALogin" );
	if(divTALogin != null)
		divTALogin.style.display = "none";

	var hypTALogout = document.getElementById( "hypTALogout" );
	if(hypTALogout != null)	
		hypTALogout.style.display = "inline";
}
function forgotPwdSuccess ()
{
	//Password sent succesfully

	initialize ();

	var spnTAPwdSentSuccess = document.getElementById( "spnTAPwdSentSuccess" );
	if (spnTAPwdSentSuccess != null)
		spnTAPwdSentSuccess.style.display = "inline";
}
function forgotPwdError ()
{
	//Error in sending password
	
	initialize ();
	
	var spnTAPwdSentError = document.getElementById( "spnTAPwdSentError" );
	if (spnTAPwdSentError != null)
		spnTAPwdSentError.style.display = "inline";
}
function logoutSuccess ()
{
	initialize ();
	
	var spnTALogoutSuccess = document.getElementById( "spnTALogoutSuccess" );
	if (spnTALogoutSuccess != null)
		spnTALogoutSuccess.style.display = "inline";
}
function initialize ()
{
	var divTALogin = document.getElementById( "divTALogin" );
	if(divTALogin != null)
		divTALogin.style.display = "inline";

	var hypTALogout = document.getElementById( "hypTALogout" );
	if(hypTALogout != null)	
		hypTALogout.style.display = "none";

	var spnTALoginSuccess = document.getElementById( "spnTALoginSuccess" );
	if (spnTALoginSuccess != null)
		spnTALoginSuccess.style.display = "none";

	var spnTALoginError = document.getElementById( "spnTALoginError" );
	if (spnTALoginError != null)
		spnTALoginError.style.display = "none";

	var spnTAPwdSentSuccess = document.getElementById( "spnTAPwdSentSuccess" );
	if (spnTAPwdSentSuccess != null)
		spnTAPwdSentSuccess.style.display = "none";

	var spnTAPwdSentError = document.getElementById( "spnTAPwdSentError" );
	if (spnTAPwdSentError != null)
		spnTAPwdSentError.style.display = "none";

	var spnTALogoutSuccess = document.getElementById( "spnTALogoutSuccess" );
	if (spnTALogoutSuccess != null)
		spnTALogoutSuccess.style.display = "none";
		
}
function btnTALogin_onclick()
{
    var txtTAUserId = document.getElementById( "txtTAUserId" );
    var txtTAPassword = document.getElementById( "txtTAPassword" );
    
	document.getElementById( "hdnUserAction" ).value = "1";
	document.getElementById( "hdnTAUserId" ).value = txtTAUserId.value ;
	document.getElementById( "hdnTAPwd" ).value = txtTAPassword.value ;
	
	if (TrimString(txtTAUserId.value).length == 0 || 
		TrimString(txtTAPassword.value).length == 0)
	{
		initialize ();
		
		var spnTALoginError = document.getElementById( "spnTALoginError" );
        if (spnTALoginError != null)
			spnTALoginError.style.display = "inline";
	}
	else
		document.getElementById( "frmHome" ).submit ();
			
}
function taForgotPwd()
{
	document.getElementById( "hdnUserAction" ).value = "2";
	document.getElementById( "hdnTAUserId" ).value = document.getElementById( "txtTAUserId" ).value ;
	document.getElementById( "frmHome" ).submit ();
}
function taLogout()
{
	document.getElementById( "hdnUserAction" ).value = "3";
	document.getElementById( "frmHome" ).submit ();
}
function loadHome ()
{
	if (taLoginSts == '1')
	{
		loginSuccess ();
	}

	else if (taLoginSts == '-1')
	{
		loginError ();
	}
	else if (taLoginSts == '2')
	{
		forgotPwdSuccess ();
	}
	else if (taLoginSts == '-2')
	{
		forgotPwdError ();
	}			
	else if (taLoginSts == '3')
	{
		logoutSuccess ();
	}
	else
	{
		initialize ();
	}	
	//for cust login
	/*if (custLoginSts == '1')
	{
		loginSuccessCust ();
	}

	else if (custLoginSts == '-1')
	{
		loginErrorCust();
	}
	else if (custLoginSts == '2')
	{
		forgotPwdSuccessCust ();
	}
	else if (custLoginSts == '-2')
	{
		forgotPwdErrorCust ();
	}			
	else if (custLoginSts == '3')
	{
		logoutSuccessCust ();
	}
	else
	{
		initializeCust ();
	}*/
		
	if(openCityList)
	{
	    windowProperties = 'height=' + 500 + ',width=' + 500 + ',left=270,top=180,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes';
	    window.open(pagePrefix+"CityList.aspx?siteGuid="+document.getElementById('hdnSiteGuid').value,"rar",windowProperties);
	}
	var startdate = document.getElementById("txtStartDate");
	if(startdate != null)
	{
	    startdate.value = startdate.value.replace(/&lt;/g,"<");
	}
	var town = document.getElementById("txtTown");
	if(town != null)
	{
	    town.value = town.value.replace(/&lt;/g,"<");
	}
}
//function loginSuccess ()
//{

//	//Login has been successful
//	if (document.getElementById( "spnTALoginSuccess" ))
//	{
//		document.getElementById( "spnTALoginSuccess" ).innerHtml += document.getElementById( "hdnTAName" ).value;
//		document.getElementById( "spnTALoginSuccess" ).style.display = "inline";
//	}

//	if(document.getElementById( "divTALogin" ))
//		document.getElementById( "divTALogin" ).style.display = "none";

//	if(document.getElementById( "hypTALogout" ))	
//		document.getElementById( "hypTALogout" ).style.display = "inline";
//}
 function initializeCust()	
{		
	// for customer login
	var divCustLogin = document.getElementById( "divCustLogin" );
    if(divCustLogin)
		divCustLogin.style.display = "inline";

	var hypCustLogout = document.getElementById( "hypCustLogout" );
    if(hypCustLogout)	
		hypCustLogout.style.display = "none";

	var spnCustLoginSuccess = document.getElementById( "spnCustLoginSuccess" );
    if (spnCustLoginSuccess)
		spnCustLoginSuccess.style.display = "none";

	var spnCustLoginError = document.getElementById( "spnCustLoginError" );
    if (spnCustLoginError)
		spnCustLoginError.style.display = "none";

	var spnCustPwdSentSuccess = document.getElementById( "spnCustPwdSentSuccess" );
    if (spnCustPwdSentSuccess)
		spnCustPwdSentSuccess.style.display = "none";

	var spnCustPwdSentError = document.getElementById( "spnCustPwdSentError" );
    if (spnCustPwdSentError)
		spnCustPwdSentError.style.display = "none";

	var spnCustLogoutSuccess = document.getElementById( "spnCustLogoutSuccess" );
    if (spnCustLogoutSuccess)
		spnCustLogoutSuccess.style.display = "none";
		
}
//Cust Login segment begin
function btnCustLogin_onclick()
{
	document.getElementById( "hdnCustAction" ).value = "1";
		
	var custUserid=document.getElementById( "txtCustUserId" );
	var custPwd=document.getElementById( "txtCustPassword" );
	if(custUserid && custPwd)
	{
		if(custUserid.value=='')
			{
				alert(emptyUserIdMsg);
				custUserid.focus();
				return false;
					
			}
		if(custPwd.value=='')
			{
				alert(emtyPwdMsg);
				custPwd.focus();
				return false;
					
			}
		document.getElementById( "hdnCustUserId" ).value = custUserid.value ;
		document.getElementById( "hdnCustPwd" ).value = custPwd.value ;
		document.getElementById( "frmHome" ).submit ();
	}
		
		else
			document.getElementById( "frmHome" ).submit ();
				
	}
function custForgotPwd()
{
	document.getElementById( "hdnCustAction" ).value = "2";
	var custUserid=document.getElementById( "txtCustUserId" );
	if(custUserid)
	{
		if(custUserid.value=='')
			{
				alert(emptyUserIdMsg);
				custUserid.focus();
				return false;
					
			}
		document.getElementById( "hdnCustUserId" ).value = custUserid.value ;
		document.getElementById( "frmHome" ).submit ();
	}
}
		
	
function custLogout ()
{
	
	document.getElementById( "hdnCustAction" ).value = "3";
	document.getElementById( "frmHome" ).submit ();
}
function custChngPwd()
{
	document.getElementById( "hdnCustAction" ).value = "3";
	document.getElementById( "frmHome" ).submit ();
}

function loginSuccessCust ()
{

	//Login has been successful
	var spnCustLoginSuccess=document.getElementById( "spnCustLoginSuccess" )
	if (spnCustLoginSuccess)
	{   
	    var text=spnCustLoginSuccess.innerHTML;
		spnCustLoginSuccess.innerHTML =text+ document.getElementById( "hdnCustName" ).value;;// need to decide later.
		spnCustLoginSuccess.style.display = "inline";
	}

	var divCustLogin=document.getElementById( "divCustLogin" )
	if(divCustLogin)
		divCustLogin.style.display = "none";

	var hypCustLogout=document.getElementById( "hypCustLogout" )
	if(hypCustLogout)	
		hypCustLogout.style.display = "inline";
}		


function loginErrorCust ()
{

	//Login has failed
	
	initializeCust ();
	
	var spnCustLoginError=document.getElementById( "spnCustLoginError" )
	if (spnCustLoginError)
		spnCustLoginError.style.display = "inline";

}


function forgotPwdSuccessCust ()
{
	//Password sent succesfully

	initializeCust ();

	var spnCustPwdSentSuccess=document.getElementById( "spnCustPwdSentSuccess" )
	if (spnCustPwdSentSuccess)
		spnCustPwdSentSuccess.style.display = "inline";
}


function forgotPwdErrorCust ()
{
	//Error in sending password
	
	initializeCust ();
	
	var spnCustPwdSentError=document.getElementById( "spnCustPwdSentError" )
	if (spnCustPwdSentError)
		spnCustPwdSentError.style.display = "inline";

}

function logoutSuccessCust ()
{
	initializeCust ();
	
	var spnCustLogoutSuccess=document.getElementById( "spnCustLogoutSuccess" )
	if (spnCustLogoutSuccess)
		spnCustLogoutSuccess.style.display = "inline";
} 
function fetchUserInputOnPostback()
{
	var cmbCountry = document.getElementById('cmbCountry');
	var cmbRegion = document.getElementById('cmbRegion');
	var cmbArea = document.getElementById('cmbArea');
	var cmbResort = document.getElementById('cmbResort');
	var cmbRadius = document.getElementById('cmbRadius');
	var cmbSleeps = document.getElementById('cmbSleeps');
	var cmbLengthofStay = document.getElementById('cmbLengthofStay');
	var hdnRegionInfo = document.getElementById('hdnRegionInfo');
	var hdnAreaInfo = document.getElementById('hdnAreaInfo');
	var hdnResortInfo = document.getElementById('hdnResortInfo');
	var hdnRadius = document.getElementById('hdnRadius');
	var hdnPartyComp = document.getElementById('hdnSleep');
	var hdnDur = document.getElementById('hdnDur');	
	var hdnCountryCd = document.getElementById('hdnCountryCd');	
	if(hdnCountryCd != null && cmbCountry != null && cmbCountry.length > 0)
	{	
		hdnCountryCd.value = cmbCountry.value;
	}
	if(hdnRegionInfo != null && cmbRegion != null && cmbRegion.length > 0)
	{	
		hdnRegionInfo.value = cmbRegion.value;
	}
	if(hdnAreaInfo != null && cmbArea != null && cmbArea.length > 0)
	{	
		hdnAreaInfo.value = cmbArea.value;
	}
	if(hdnResortInfo != null && cmbResort != null && cmbResort.length > 0)
	{	
		hdnResortInfo.value = cmbResort.value;
	}
	if(hdnRadius != null && cmbRadius != null && cmbRadius.length > 0)
	{	
		hdnRadius.value = cmbRadius.value;
	}
	if(hdnPartyComp != null && cmbSleeps != null && cmbSleeps.length > 0)
	{	
		hdnPartyComp.value = cmbSleeps.value;
	}
	if(hdnDur != null && cmbLengthofStay != null && cmbLengthofStay.length > 0)
	{	
		hdnDur.value = cmbLengthofStay.value;
	}
	ValidateMessage("txtStartDate");
	ValidateMessage("txtTown");   	    
}
function regionOnClick() 
{
	var regionClickInd= document.getElementById( "hdnRegionClickedInd" ) ; 
	var cmbCountry = document.getElementById( "cmbCountry" ) ; 
	if(regionClickInd != null)
	{	
		regionClickInd.value = "1";
	}
	if(cmbCountry != null)
		cmbCountry.disabled = true ;
	fetchUserInputOnPostback();
	
}
function areaOnClick() 
{
	var areaClickInd= document.getElementById( "hdnAreaClickedInd" ) ;
	
	if(areaClickInd != null)
	{
		areaClickInd.value = "1";
	}      
   fetchUserInputOnPostback();
}
function countryOnChage() 
{
	var countryClickInd= document.getElementById( "hdnCountryClickedInd" ) ;
	
	if(countryClickInd != null)
	{
		countryClickInd.value = "1";
	}      
   fetchUserInputOnPostback();
}
//Function to open calendar window
function ShowCal(controlName)
{
	var url;
	var windowProperties;	
	var controlStartDate = document.getElementById(controlName);
	
	if(!ValidateDate(controlStartDate))
		return false;
	ValidateMessage("txtTown");
	OpenCalendar(controlName) ;
	var town = document.getElementById("txtTown");
	if(town != null)
	{
	    town.value = town.value.replace(/&lt;/g,"<");
	}
	
	return false;
}

function fetchUserInputOnSubmit()
{
	
	var partyComp;
	var hdnPropType = document.getElementById('hdnPropType');
	var countryCd = document.getElementById('cmbCountry');
	var currencyCd = document.getElementById('hdnCurrencyCd');
	var hdnLangCd = document.getElementById('hdnLanguageCode');
	var hdnSiteGuid = document.getElementById('hdnSiteGuid');
	var cmbRegion = document.getElementById('cmbRegion');
	var cmbArea = document.getElementById('cmbArea');
	var cmbResort = document.getElementById('cmbResort');
	var cmbRadius = document.getElementById('cmbRadius');
	var cmbSleeps = document.getElementById('cmbSleeps');
	var txtStartDate = document.getElementById('txtStartDate');
	var cmbLengthofStay = document.getElementById('cmbLengthofStay');
	var hdnTrvlOpt = document.getElementById('hdnDefTravelOpt');
	var regionCd="", regionNm="",areaCd="",areaNm="",resortCd="",resortNm="";
	var rarInfo='',regionInfo='',areaInfo='',resortInfo='',dynamicMapInfo="",dynamicScaleInfo='',peripheryInfo='',selectedPreference='',passengerind='', noChild='';
	var selectedSearchInfo="";
	var selectedTravelOpt = "";
	var userInput = new Array();
	userInput.push("QS=");
	if(hdnSiteGuid != null && hdnSiteGuid.value.length > 0)
	{	
		userInput.push(hdnSiteGuid.value);
		userInput.push('~');  
		
	}
	else
			userInput.push('~');  
	if(hdnPropType != null && hdnPropType.value.length > 0)
	{	
		userInput.push(hdnPropType.value);  
		userInput.push('~');  
		
	}
	else
			userInput.push('~');  
	
    if(countryCd != null && countryCd.value.length > 0)
	{	
		userInput.push(countryCd.value);  
		userInput.push('~');  
	}
	else
			userInput.push('~');  
	if(currencyCd != null && currencyCd.value.length > 0)
	{	
		userInput.push(currencyCd.value); 
		userInput.push('~'); 
		
	}
	else
			userInput.push('~');  	
	if(hdnTrvlOpt != null)
	{
		selectedTravelOpt = hdnTrvlOpt.value;
		if(userInput.length > 0)
		{
			userInput.push(selectedTravelOpt);
			userInput.push('~');
		}
		else
			userInput.push('~');  
	}
	else
			userInput.push('~');  
	if(txtStartDate != null && txtStartDate.value.length > 0)
	{	
	    isQuickSeach = "N";
		var startDate = txtStartDate.value;
		var dateComp = startDate.split("/");
		if(userInput.length > 0)
		{
			userInput.push(dateComp[1]);  
			userInput.push('-');  
			userInput.push(dateComp[0]);  
			userInput.push('-');  
			userInput.push(dateComp[2]);  
			userInput.push('~');  
		}
		dateComp = null;
	} 
	else
			userInput.push('~');  
	if(cmbLengthofStay != null && cmbLengthofStay.length > 0 && cmbLengthofStay.value != "0")
	{	
		userInput.push(cmbLengthofStay.value);
		userInput.push('~'); 
		
	} 
	else
			userInput.push('~');  
			
	userInput.push('~');	
	userInput.push('~~~~~~~~');
	userInput.push('~');		
	userInput.push('~');  
	userInput.push('~');   
	var resortSelected=false;
	if(cmbResort != null && cmbResort.length > 0 && cmbResort.value != "0")
	{	
		resortInfo=cmbResort.value;
		resortCd= resortInfo.split(",")[2] ;
		resortNm=escape(cmbResort.options[cmbResort.selectedIndex].text.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		resortInfo = escape(resortInfo.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		
	}
	else if(cmbArea != null && cmbArea.length > 0 && cmbArea.value != "0")
	{	
		hdnRARInfo = document.getElementById('hdnRARInfo');
		if(hdnRARInfo != null && hdnRARInfo.value.length > 0)
		{
			var rarInfo = hdnRARInfo.value.split(",");
			if(rarInfo.length > 2)
			{
				if(rarInfo[2].length > 0)
				{
					resortCd= rarInfo[2] ;
					resortSelected=true;
				}
				else if(rarInfo[1].length > 0)
				{
					areaCd= rarInfo[1];
				}
				else if(rarInfo[0].length > 0)
				{
					regionCd=rarInfo[0];
				}
			}
			if(rarInfo.length > 3)
			    rarName = escape(PopulateRARName(rarInfo).replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
			else if(rarInfo.length == 2 && rarInfo[0]==-1)
			{
			    rarName = rarInfo[1];
			}
		}	
		else
		{
		    var areaInfo = cmbArea.value.split(",");
		    areaCd= areaInfo[1];
		    areaNm=escape(cmbArea.options[cmbArea.selectedIndex].text.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		    areaInfo= escape(cmbArea.value.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		}
	}
	else if(cmbRegion != null && cmbRegion.length > 0 && cmbRegion.value != "0")
	{	
		hdnRARInfo = document.getElementById('hdnRARInfo');
		if(hdnRARInfo != null && hdnRARInfo.value.length > 0)
		{
			
			var rarInfo = hdnRARInfo.value.split(",");
			if(rarInfo.length > 2)
			{
				if(rarInfo[2].length > 0)
				{
					resortCd= rarInfo[2] ;
				}
				else if(rarInfo[1].length > 0)
				{
					areaCd= rarInfo[1];
				}
				else if(rarInfo[0].length > 0)
				{
					regionCd=rarInfo[0];;
				}
			}
			if(rarInfo.length > 3)
			    rarName = escape(PopulateRARName(rarInfo).replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
			else if(rarInfo.length == 2 && rarInfo[0]==-1)
			{
			    rarName = rarInfo[1];
			}
		}			
	}
	if(cmbArea != null && cmbArea.length > 0 && cmbArea.value != "0")
	{	
		    areaInfo=escape(cmbArea.value.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		    if(!resortSelected)
		        areaNm=escape(cmbArea.options[cmbArea.selectedIndex].text.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		    else
		        resortNm=escape(cmbArea.options[cmbArea.selectedIndex].text.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
			
	}
	if(cmbRegion != null && cmbRegion.length > 0 && cmbRegion.value != "0")
	{	
		regionInfo=escape(cmbRegion.value.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));
		regionNm=escape(cmbRegion.options[cmbRegion.selectedIndex].text.replace(/&/g,'_**_').replace(/'/gi,'%quot%'));		
	}
	userInput.push(regionCd);   
	userInput.push('~');   
	userInput.push(regionNm);   
	userInput.push('~');   
	userInput.push(areaCd);   
	userInput.push('~');   
	userInput.push(areaNm);   
	userInput.push('~');   
	userInput.push(resortCd);   
	userInput.push('~');   
	userInput.push(resortNm);   
	userInput.push('~');   
	userInput.push(rarName);   
	userInput.push('~~~~');   
	userInput.push('~~');
	userInput.push('~');  
	if( town!=null && town.value!=null && town.value.length>0)
	{	
	    isQuickSeach = "N";
	    userInput.push('%LAT~');
	    userInput.push('~');
	    userInput.push('%LON~');
	    userInput.push('~');	
	
	}
	else
		userInput.push('~~~~');
	if(cmbRadius != null && cmbRadius.length > 0 && cmbRadius.value != "0")
	{	
		userInput.push(cmbRadius.value);	
		userInput.push('~');	
		
	}
	else
		userInput.push('~');  
	//location name-undone
	if( town!=null && town.value!=null && town.value.length>0)
	{
		userInput.push('%TNM');
		userInput.push('~');
	}
	else
		userInput.push('~'); 
	
	userInput.push('~');  
		
    if(cmbSleeps != null && cmbSleeps.length > 0 && cmbSleeps.value != "0")
    {
        userInput.push(cmbSleeps.value);  
	    userInput.push('~');  
	}		
	else
		userInput.push('~');  
	userInput.push('~~~'); 	
	userInput.push('~');  
	userInput.push('~');  
	userInput.push('~');
    userInput.push('~~'); 		
	//populating selected search info
	selectedSearchInfo=selectedSearchInfo+escape(document.getElementById('hdnRARInfo').value.replace(/&/g,'_**_').replace(/'/gi,'%quot%'))+'^'+regionInfo+'^'+areaInfo+'^'+resortInfo+'^^^^^^';
	userInput.push(isQuickSeach);	
	
	//appending guid from Search page to avoid new search on browser back after opening a popup.
    var newGuid = guid();
	userInput.push('~~');
	userInput.push(newGuid);
	userInput.push('~1~~~H~'); 
	userInput.push(selectedSearchInfo);  
	var queryStrng;
	if(hdnPropType != null && hdnPropType.value.length > 0)
	{		
		queryStrng = pagePrefix+"SearchResult_" + hdnPropType.value + "_NoMap.aspx?" + userInput.join('');		
	}
	var finalQueryString = new Array();
	finalQueryString.push(queryStrng);
	
	
	return finalQueryString.join('');
}
//Function to hide the RAR hierchical display frame
function HideSearch(searchWindow)
{
	var hdnTownLatLong = parent.document.getElementById("hdnTownLatLong");
	var hdnRARInfo = parent.document.getElementById("hdnRARInfo");
	if(hdnTownLatLong != null)
	{
		hdnTownLatLong.value = "";
	}
	if(hdnRARInfo != null)
	{
		hdnRARInfo.value = "";
	}
    opener.fetchUserInputOnPostback();
	opener.SelfPostback();
	self.close();
	return false;
}
//Function to check whether all the search parameters are filled or not
function ValidateSearch()
{
	var status =true;
	var startDate = document.getElementById("txtStartDate");
	var lengthofStay = document.getElementById("cmbLengthofStay");
	var travelOptions = document.getElementById("rdbTravelOptions");
	var cmbSleeps = document.getElementById("cmbSleeps");
	var txtTown = document.getElementById("txtTown");
	if(!ValidateMandatoryFiled())
	{
		return false;
	}
	if(startDate != null && lengthofStay != null)
	{
		//if user has selected holiday start date, has not selected any length of stay					
		if ((startDate.value.length != 0 && lengthofStay.value == "0")
		||(startDate.value.length != 0 && lengthofStay.length == 0))
		{	
			alert(eDur);								
			lengthofStay.focus();
			return false; 
		}
		//if user has selected length of stay, has not selected any holiday start date			
		if (startDate.value.length ==0 && lengthofStay.value != "0" && lengthofStay.value.length != 0)
		{	
			alert(eDt);								
			startDate.focus();
			return false; 
		}
		//if user has opted for dated search, but has not selected any no of adults/sleeps 
		if (startDate.value.length != 0  && lengthofStay.value != "0" && lengthofStay.value.length != 0)
		{	
			if(cmbSleeps != null && cmbSleeps.value == "0")
			{	
				alert(eSlp);					
				cmbSleeps.focus();
				return false; 
			}	
		}				
	}
	if(!ValidateDate(startDate))
		return false;
	
	if(!GetLocationLonLat())
	{
		return false;
	}
	if(txtTown != null && txtTown.value.length > 0)
	{
		fetchUserInputOnPostback();	
		var hdnQueryString = document.getElementById("hdnQueryString");
		if(hdnQueryString!=null)
		{
		    hdnQueryString.value = fetchUserInputOnSubmit();
		}
	}
	else
	{   fetchUserInputOnPostback();
		var strRedirectUrl = fetchUserInputOnSubmit();
		//document.write(strRedirectUrl);
		location.href=strRedirectUrl;
		return false;
	}	
	return true;		
}
function GetLocationLonLat()
{
	var callLatLon = 0;
	var cityName;
	town = document.getElementById("txtTown");
	var radius = document.getElementById("cmbRadius")	
	if(town!=null && radius!=null)
	{
		if(radius.length>1)
		{
			if(Trim(town.value).length>0 && radius.value!="0")
			{
				cityName = town.value;
				callLatLon = 1;
			}	
			else if(Trim(town.value) .length>0 && radius.value=="0")
			{
				alert(eRadMap);
				return false;
			}
			else if(Trim(town.value).length==0 && radius.value!="0")
			{
				alert(eTwnNmMap);
				return false;
			}
		}		
	}	
	return true;
}
//Function to check whether user has given any input for a mandatory field set by Site-Admin
function ValidateMandatoryFiled() 
{ 	
	var region= document.getElementById( "cmbRegion" ) ;
    if(region!=null)   
    {      
        if(region.getAttribute("mandatory") == "Y" && (region.value.length == 0 ||region.value=="0"))
        {
            alert(mReg);
            region.focus();
            return false;
        }
    }   
    var area= document.getElementById( "cmbArea" ) ; 
    if( area!=null) 
    {    
        if( area.getAttribute("mandatory") == "Y" && ( area.value.length == 0 ||area.value=="0"))
        {
            alert(mAr);
            area.focus();
            return false;
        }
    }    
    var resort= document.getElementById( "cmbResort" ) ; 
    if( resort!=null)  
    {          
        if( resort.getAttribute("mandatory") == "Y" && ( resort.value.length == 0 || resort.value=="0"))
        {
            alert(mRes);
            resort.focus();
            return false;
        }
    }   
    var town = document.getElementById( "txtTown" ) ; 
    if(town!=null)
    { 
        if(town.getAttribute("mandatory") == "Y" && Trim(town.value).length==0)
        {
            alert(mTwn);
            town.focus();
            return false;
        }
    }    
	var radius= document.getElementById( "cmbRadius" ) ;   
    if( radius!=null)  
    {          
        if( radius.getAttribute("mandatory") == "Y" && ( radius.value.length == 0 || radius.value=="0"))
        {
            alert(mRad);
            radius.focus();
            return false;
        }
    }  
    var sleeps= document.getElementById( "cmbSleeps" ) ;   
    if( sleeps!=null)  
    {          
        if( sleeps.getAttribute("mandatory") == "Y" && ( sleeps.value.length == 0 || sleeps.value=="0"))
        {
            alert(eSlp);
            sleeps.focus();
            return false;
        }
    }    
    var lengthOfStay= document.getElementById( "cmbLengthofStay" ) ;        
    if( lengthOfStay!=null)   
    {        
        if( lengthOfStay.getAttribute("mandatory") == "Y" && ( lengthOfStay.value.length == 0 ||lengthOfStay.value=="0"))
        {
            alert(eDur);
            lengthOfStay.focus();
            return false;
        }
    }   
    var startDate = document.getElementById( "txtStartDate" ) ;        
    if(startDate!=null)
    { 
        if(startDate.getAttribute("mandatory") == "Y" && startDate.value.length == 0)
        {
            alert(mStDt);
            startDate.focus();
            return false;
        }
    } 
	return true;
}
function Trim(Value)
{	
	var len=Value.length;
	var i;
	for ( i=0;i<len;i++)
	{	
		if (Value.charAt(0)==" ")
		{
			Value=Value.substr(1);
		}
		else
		{
			break;
		}
	}
	if (Value!=null)
	{
		len=Value.length;
		for (i=len;i!=-1;i--)
		{
			len1=Value.length;
			if (Value.charAt(len1-1)==" ")
			{
				Value=Value.substr(0,len1-1);
			}
			else
				break;
		}
	}	
	return Value;
}
//Function to show the frame with RAR mapping info
function ShowSearchCriteria(searchWindow,countryCd)
{
	fetchUserInputOnPostback();
	var control = document.getElementById("spncmbRegion");
	if(control == null)
	    control= document.getElementById("spncmbArea");
	
	controlInnerHtml = control.innerHTML;
	control.style.display="none";
			
	var controlAS = document.getElementById("spncmbairportSearch");
	if(controlAS != null)
	{
		controlASInnerHtml = controlAS.innerHTML;
		controlAS.style.display="none";
	}
	var controlCountry = document.getElementById("spncmbCountry");
	if(controlCountry != null)
	{
		controlCountryInnerHtml = controlCountry.innerHTML;
		controlCountry.style.display="none";
	}
	var controlCurrency = document.getElementById("spncmbCurrency");
	if(controlCurrency != null)
	{
		controlCurrencyInnerHtml = controlCurrency.innerHTML;
		controlCurrency.style.display="none";
	}
	var controlPropertyType = document.getElementById("spncmbPropertyType");
	if (controlPropertyType != null)
	{
		controlPropertyTypeInnerHtml = controlPropertyType.innerHTML;
		controlPropertyType.style.display="none";
	}
	var ddl = new Array("cmbGrading","cmbPriceRange","cmbNoBedroom","cmbRegion","cmbArea","cmbResort","cmbRadius","cmbSleeps","cmbAdults","cmbChildren","cmbInfants","cmbLengthofStay","cmbFlyingTo","cmbFlyingFrom","cmbCountry", "cmbairportSearch",  "cmbPropertyType");
	for (var i = 0; i < ddl.length; i++)
	{
	    var span = document.getElementById("spn"+ddl[i]);
	    if(span!= null && ddl[i] != null)
	    {
	        ddlList = document.getElementById(ddl[i]);
                if( ddlList != null && ddlList.selectedIndex >0)
	        span.innerHTML = ddlList.options[ddlList.selectedIndex].text;
	    }
	}
	
	if (controlAS != null)
	{		
		controlAS.innerHTML = "";
	}
	if (controlCountry != null)
	{		
		controlCountry.innerHTML = "";
	}
	if (controlCurrency != null)
	{		
		controlCurrency.innerHTML = "";
	}
	if (controlPropertyType != null)
	{		
		controlPropertyType.innerHTML = "";
	}
	if (control != null)
	{		
		control.innerHTML = "";
	}
	launch_file_upload_internal_dialog();	
	if (control != null)
	{		
		control.innerHTML = controlInnerHtml;
	}
	if (controlAS != null)
	{
		controlAS.innerHTML = controlASInnerHtml;
	}

	if (controlCountry != null)
	{
		controlCountry.innerHTML = controlCountryInnerHtml;
	}
	if (controlCurrency != null)
	{
		controlCurrency.innerHTML = controlCurrencyInnerHtml;
	}
	if (controlPropertyType != null)
	{
		controlPropertyType.innerHTML = controlPropertyTypeInnerHtml;
	}
}


//Function to capture the selected value for RAR 
function SelectValue(text,value)
{
    
	var control = document.getElementById("cmbRegion");
	if(control == null)
	    control =document.getElementById("cmbArea");
	text = text.replace(/~/g,"'");
	control.options[0].text = text;
	control.options[0].value = value;
	document.getElementById("hdnRARInfo").value = value.replace(/_/g,",") + "," + text;
    //fetchUserInputOnPostback();
	SelfPostback();	
}
//Function to do an auto postback for the saerch page
function SelfPostback()
{
   document.getElementById("frmHome").submit();	
}
//Function to Save the latitude and longitude of the selected place
function SelectCity(lat,lon,city)
{
    var txtTown = parent.document.getElementById("txtTown");
	parent.document.getElementById("hdnTownLatLong").value = lat + '^' + lon + '^' + city;
    if(txtTown != null)
		txtTown.value = city;
    parent.fetchUserInputOnPostback();
    parent.SelfPostback();
}
//Function to populate the property reference search query string
function populatePropResSearchUrl(propRef)
{
    var url = new Array();
    var hdnSiteGuid = document.getElementById('hdnSiteGuid');
    var currencyCd = document.getElementById('hdnCurrencyCd');
    var countryCd = document.getElementById('cmbCountry');
    url.push(pagePrefix);
    url.push("PropRefResult.aspx?QS=");
    // site guid
    if(hdnSiteGuid != null && hdnSiteGuid.value.length > 0)
	{	
		url.push(hdnSiteGuid.value);
		url.push('~'); 		
	}
	else
	    url.push('~');
	// property reference    
	url.push(propRef);
	url.push('~');	
	//Currency Code
	if(currencyCd != null && currencyCd.value.length > 0)
	{	
		url.push(currencyCd.value); 
		url.push('~'); 		
	}
	else
		url.push('~');  
	//IsMerChandising
	url.push('~');  	
	//Guid
	url.push('~');
	//From Search
	url.push('H');	
	
	return url.join('');  
}
//Function to check whether all the search parameters are filled or not
function ValidatePropRefSearch()
{
	var propertyRef = document.getElementById( "txtPropRef") ;	
	
    var url = populatePropResSearchUrl(propertyRef.value);
    location.href = url;
	
	
}
function ValidateRetrivePassword()
{
    var valid =checkMandatoryAttr("txtUserId",emptyUserIdMsg);
    return valid;    
}  
function ValidateLogin()
{	
    var valid=checkMandatoryAttr("txtUserId",emptyUserIdMsg)&& checkMandatoryAttr("txtPassword",emptyPwdMsg);
	return valid;	
}
function PopulateRARName(rarVal)
{
    var rarName = "";
    for (var i=3;i<rarVal.length; i++)
    {
        rarName += rarVal[i];
        rarName += ",";        
    }
    rarName = rarName.substring(0,rarName.length -1);
    return rarName;
}
var content_shield = null;
var modal_dialog = null;

function getPageSize(){
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
// for small pages with total height less then height of the viewport
if(yScroll < windowHeight){
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
// for small pages with total width less then width of the viewport
if(xScroll < windowWidth){
pageWidth = windowWidth;
} else {
pageWidth = xScroll;
}
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;
}

function launch_file_upload_internal_dialog() {

var dialog_html = "<input type='image' src = '" + rarButtonPath + "images/close.gif' value='close' onclick='hide_modal_dialog()'/>";
show_modal_dialog(dialog_html);
}

function body_onscroll() {
window.status = getScrollXY();
}

function show_modal_dialog(dialog_html) {
show_modal_dialog_Extender();
if (content_shield == null) {
content_shield = document.createElement("div");
//content_shield.style.height = getPageSize()[1];
document.body.appendChild(content_shield);
content_shield.className = "content_faded";
window.status="disabled";
//Because the div is only ever going to be the height of the displayable area of the browser (100%),
//it needs to move with the scrollbars (width will always be 100%). We could instead explicitly set
//div height to the complete height of the page including non-visible scrollable areas, but then
//we would need to handle window resize events as well.
//eg. addEvent(document.body, "onscroll", body_onscroll);
}
modal_dialog = document.getElementById("divModalFrame");
var rardetails = modal_dialog.innerHTML;
modal_dialog.innerHTML =  modal_dialog.innerHTML = "<table><tr><td class='RARCloseButton'>"+ dialog_html + "</td></tr><tr><td>" + modal_dialog.innerHTML + "</td></tr><tr><td class='RARCloseButton'>" + dialog_html +"</tr></td></table>" ;
modal_dialog.style.display = "block";
modal_dialog.className="RARModal";
modal_dialog.focus();

}
function hide_modal_dialog() {
modal_dialog.style.display = "none";
if (content_shield != null) {
document.body.removeChild(content_shield);
content_shield = null;
}
}

function addEvent(obj, evType, fn, useCapture){
if (obj.addEventListener){
 obj.addEventListener(evType, fn, useCapture);
 return true;
} else if (obj.attachEvent){
 var r = obj.attachEvent("on"+evType, fn);
 return r;
} else {
 alert("Handler could not be attached");
}
}

function getScrollXY() {
var scrOfX = 0, scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
 //Netscape compliant
 scrOfY = window.pageYOffset;
 scrOfX = window.pageXOffset;
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
 //DOM compliant
 scrOfY = document.body.scrollTop;
 scrOfX = document.body.scrollLeft;
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
 //IE6 standards compliant mode
 scrOfY = document.documentElement.scrollTop;
 scrOfX = document.documentElement.scrollLeft;
}
return [ scrOfX, scrOfY ];
}
function show_modal_dialog_Extender()
{
 var flashTD = document.getElementById("homeFlash");
 if (flashTD != null)
 {
  flashTD.innerHTML = "<img src=\"images/woofer.jpg\" alt=\"We want a holiday that...\" width=\"339\" height=\"270\" />";
 }
}

function S4()
{
    return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function guid() 
{
   return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()).toUpperCase();
}