/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 *	JumpTo() 
 *	Jump to a section on current page.
 *  Uses a select box named "section" 
 *	
 *	Javascript version of HTML functionality...
 *	Example:	<a href='#TravelInsurance'>Travel Insurance</a>
 *						<a name='TravelInsurance'>Travel Insurance</a> is available at time of booking
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
function JumpTo(){
	var currentUrl = new String(window.location);
	var startUrl = currentUrl.lastIndexOf("http:",0);
	var endUrl = currentUrl.lastIndexOf(".asp") + 4;
	var fixedUrl = currentUrl.slice(startUrl,endUrl);
	
	window.location.reload(fixedUrl + "#" + jump.section.value)
	return false;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * popWin()
 * Open new window without toolbars
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
function popWin(strURL){
	window.open(strURL,'','resizable=1,scrollbars=1,toolbar=1, status=1,menubar=1,location=0,directories=0')
}



/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * VALIDATE()
 * Validate Search Form
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
function VALIDATE(FormName){
	var s = FormName.month.value + "/" + FormName.day.value + "/" + FormName.year.value;
	var e = FormName.emonth.value + "/" + FormName.eday.value + "/" + FormName.eyear.value;
	
	FormName.start_date.value = s;
	FormName.end_date.value = e;
	
	var sd = new Date();
			sd.setFullYear(Number(FormName.year.value));
			sd.setMonth(Number(FormName.month.value)-1);
			sd.setDate(Number(FormName.day.value));
	
	var ed = new Date();
			ed.setFullYear(Number(FormName.eyear.value));
			ed.setMonth(Number(FormName.emonth.value)-1);
			ed.setDate(Number(FormName.eday.value));
	
	var cd = new Date();
	
	if(FormName.start_date.value=='' || FormName.end_date.value==''){
		alert('Please select a check in and check out date.');
		return false;
	}
	else{
		if (sd <= cd) {
			alert('Please enter a check in date at least 3 days after today.');
			return false;		
		}
		else {
			if (ed <= sd) {
				alert('Please enter a check out date at least 1 day after the check in date.');
				return false;
			}
			else {
				return true;
			}
		}
	}
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * SetEDate()
 * Used to set end date control on search form
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
function SetEDate(FormName) {
	var d7 = new Date(0,0,7);
	
	var sd = new Date();
			sd.setFullYear(Number(FormName.year.value));
			sd.setMonth(Number(FormName.month.value)-1);
			sd.setDate(Number(FormName.day.value));
	
	var ed = new Date();
			ed = sd;
			ed.setDate(ed.getDate()+7);

	FormName.eyear.value = ed.getFullYear()
	FormName.emonth.selectedIndex = ed.getMonth();
	FormName.eday.selectedIndex = ed.getDate()-1;
}	
