
function buttonRollover(thisImgSrc) {
	return thisImgSrc.replace("_off.","_on.");
}
function buttonRolloff(thisImgSrc) {
	return thisImgSrc.replace("_on.","_off.");
}


function RedirectCountry(){
var vSelected = document.form1.HeaderAreaControl_CountrySelector1_ddListCountries.value;
var CountryURL = vSelected.substring(0, vSelected.indexOf("|"));
var CountryCode = vSelected.substring(vSelected.indexOf("|")+1);
CountryCode = CountryCode.substring(0, 2);
if(CountryCode=='CA' || CountryCode=='US'){
SetCookie ('CountryCode', CountryCode, null, '/', window.location.hostname);
}
location.href=CountryURL;
return false;
}

function SearchRedir() {
	var SearchTermText = document.form2.searchtext.value;
	var SearchTerm = SearchTermText.replace(" ", "+");
	window.location="http://www.hellobc.com/en-CA/SearchResults/BritishColumbia.htm?q="+SearchTerm+"&ie=utf8&site=TBCCW&output=xml_no_dtd&client=TBCCW&lr=&oe=utf8&requiredfields=CW_PAGE_TYPE%3aContent|CW_PAGE_TYPE%3aAccommodation|CW_PAGE_TYPE%3aNonAccomProduct&getfields=CW_PAGE_TYPE.Description.ProductSummary.BCEscapes&ip=&access=&start=0&filter=0&restrict=NA|NA_PROD";
}

function SetCookie(name,value){
	var argv=SetCookie.arguments;var argc=SetCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=name+"="+escape(value)+
	((expires==null)?"":("; expires="+expires.toGMTString()))+
	((path==null)?"":("; path="+path))+
	((domain==null)?"":("; domain="+domain))+
	((secure==true)?"; secure":"");
}
