// starts the timer on the home page
function startAdTimerOnHomePage() {
	window.setTimeout("Spry.Utils.updateContent('hp_camofday-div','hp_includes/inc_hp-cam-camofday.cfm');", 16000);
}

// opens a new window
function OpenWin(URL,width,height) {
	var Features ="'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+ width +",height="+ height +"'";
	var NewWin = window.open(URL,"win",Features);
NewWin.focus();
}

// google search box
function doGoogleSearch(context,searchString) {
	// alert('searching' + searchString +"in" + context);
	if ( context == 'surfline' ) {
	var url = 'http://www.surfline.com/find/index.cfm?q=' + escape(searchString)+"&ie=&site=entire_surfline_site&output=xml_no_dtd&client=entire_surfline_site&lr=&proxystylesheet=entire_surfline_site&oe=";
		window.location = url;
	} else {
		var url = 'http://store.surfline.com/store/mySearchResult.cfm?filterFor=' + escape(searchString);
		redirect( url, 'SEARCH', 'STORE', 'http://store.surfline.com/store/mySearchResult.cfm' );
	}
}

// travel search box
function doGoogleSearchTravel() {
	document.location = 'http://www.surfline.com/find/?q='+document.hp_travel_form.hp_travel_field.value+'+more:travel';
}

// clears form field
function clearText(thefield){
	if (thefield.defaultValue == thefield.value)
		thefield.value = ""
}

// clears find form field
function clearFindText(thefield){
	if (thefield.value == "Enter a surf spot, zip or city")
		thefield.value = ""
	document.getElementById("livesearch").innerHTML="";
	document.getElementById("livesearch").style.padding="0px";
}

// reset the find text
function resetFindText() {
	document.getElementById("txt1").value="";
	document.getElementById("livesearch").innerHTML="";
	document.getElementById("livesearch").style.padding="0px";
	document.getElementById("livesearch").style.display="none";
}

// sets the defaultcam cookie
function setDefaultcamCookie(value) {
	var expires = '13/06/2036 00:00:00';
	document.cookie = "DEFAULTCAM=" + value + "; expires=" + expires + "; domain=.surfline.com; path=/";
}