function go_notsure() {	ht=$F('holidaytype'); at=$F('accommodationtype'); sl=$F('surfinglevel'); sl='';	window.location="/pages/surf-holiday"+((ht)?"-"+ht:"")+((at)?"-"+at:"")+((sl)?"-"+sl:"")+".html"}function go_gotaplan() {	re=$F('gap_region');de=$F('gap_destination');st=$F('gap_staying');	window.location="/locations/world-"+((re=='x'||re=='')?'':re)+((de=='x'||de=='')?'':'-'+de)+((st=='x'||st=='')?'':'-'+st)}function clearOptions(optionList) {   for (x = optionList.length; x >= 0; x--) { optionList[x] = null; }							// Always clear an option list from the last entry to the first}function addOption (optionList, optionValue, optionText) {	var strText = (optionText == '' | !optionText) ? optionValue : optionText;	if (optionValue != "") {		optionList.length++;		optionList.options[optionList.length-1].text=strText;		optionList.options[optionList.length-1].value=optionValue;	}	return true;}function populateOptions (strTarget, strView, strKey, iCol, str1stChoice, extra_option) {	if (strTarget=="" || strView=="") return;	var targetList = $(strTarget);	clearOptions(targetList);	addOption (targetList, '','** getting data **');	var url = '/'+strView + '!readviewentries&restricttocategory='+strKey 	new Ajax.Request(url, { 		onComplete: function (getObject) { 			var view = getObject.responseXML			var entries = view.getElementsByTagName("viewentry")			clearOptions(targetList);			str1stChoice.split(',').each(function(c){ addOption (targetList, 'x',c)});			for (i=0; i< entries.length; i++) {				addOption (targetList, entries[i].getElementsByTagName('text')[0].firstChild.data,'');			}			if (extra_option) addOption (targetList, extra_option);			$(strTarget).focus()			$(strTarget).select() 		}	});}function getRadioValue(radioObj) {	if(!radioObj) return "";	var radioLength = radioObj.length;	if(radioLength == undefined)		if(radioObj.checked)			return radioObj.value;		else			return "";	for(var i = 0; i < radioLength; i++) {		if(radioObj[i].checked) return radioObj[i].value;	}	return "";}function setSelected (objSel, strVal) {	var iret = '';	$A(objSel).each(function ( v, i ) {			if (v.text == strVal) {			iRet = i	 		}	});	return iRet;}var oldquicksend;function quickSend() {	oldquicksend = $('quicksend').innerHTML.replace(/\n/g,'');		oldquicksend = oldquicksend.replace(/\'/g,'\\\'');	if ($F('qstype') == 'Type of enquiry' || $F('qsname') == 'Your name' ||  $F('qsemail') == 'Your email' || $F('qsmessage') == 'Your enquiry ...') {		$('quicksend').update('<div style="font-weight:bold;color:#ffffff"><p>&nbsp</p><p>Please fill out all the fields on this form before submitting</p><p>You will be taken back to the form in a few seconds</p></div>')		setTimeout("$('quicksend').update('" + oldquicksend + "')",5000);	} else {		x = Form.serialize(document.forms['qsform']);		allNodes=(x != "") ? x + "&" : ""		allNodes += "uniquetime=" + new Date().getTime()		$('quicksend').update('<div style="text-align:center"><p>&nbsp</p><img src="/loader.gif" /><p style="text-align:center"><br /><br />s e n d i n g</p></div>');     	var myAjax = new Ajax.Request('/quicksend!openagent', {method: 'post', postBody: allNodes,	onComplete: quickSend_response });		return false;	}}function quickSend_response(req)	{	try { var reqJSON = eval('(' + req.responseText + ')') } catch(x) {  alert("NOT A NORMAL RETURN - \n" + req.responseText) }	if (reqJSON.returnCode == "Error") {		$('quicksend').update('<div style="text-align:center"><p>&nbsp;</p><p style="color: #fff;font-size:13px;font-weight:bold">Oops!</p><p>There has been a problem sending your message.</p><p>Please try again using our <a href="/contact.html">contact</a> page.</p>')	} else if (reqJSON.returnCode == "OK") {		$('quicksend').update('<div style="text-align:center"><p>&nbsp;</p><p style="color: #fff;font-size:13px;font-weight:bold">Thank you</p><p>Your message has been delivered.</p><p>We will get back to you as quickly as we can</p>')	} else {		alert("Invalid Response")	}}