function toDate() {
	today = new Date();

	vToday = new Date();
	vTomorrow = new Date();
	vEightDays = new Date();

	vTomorrow.setDate(vTomorrow.getDate()+1);
	vEightDays.setDate(vEightDays.getDate()+10);
	
	d = vTomorrow.getDate();
	m = vTomorrow.getMonth();
	y = vTomorrow.getFullYear();
	
	document.getElementById("arrivalDay").value = d;
	document.getElementById("arrivalMonthYear").value = m+1 + "/" + y;
	
	d = vEightDays.getDate();
	m = vEightDays.getMonth();
	y = vEightDays.getFullYear();
	
	document.getElementById("returnday").value = d;
	document.getElementById("returnmonthyear").value = m+1 + "/" + y;
	
		
	
}

function LoadingQuote() {
	
	//alert("function found");
	
	// Validate First
	
	var today = new Date();
	
	
	var arrivalday = document.getElementById("arrivalDay").value;
	var arrivalmonthyear = document.getElementById("arrivalMonthYear").value;
	var arrivalmonthyear = arrivalmonthyear.split("/");
	var arrivalmonth = arrivalmonthyear[0]-1;
	var arrivalyear = arrivalmonthyear[1];
	
	
	var arrivaldate = new Date();
	arrivaldate.setFullYear(arrivalyear, arrivalmonth, arrivalday);

	var returnday = document.getElementById("returnday").value;
	var returnmonthyear = document.getElementById("returnmonthyear").value;
	var returnmonthyear = returnmonthyear.split("/");
	var returnmonth = returnmonthyear[0]-1;
	var returnyear = returnmonthyear[1];
	
	var returndate = new Date();
	returndate.setFullYear(returnyear, returnmonth, returnday);
	
	if ((parseInt(returnday) == parseInt(arrivalday)) && (parseInt(returnmonth) == parseInt(arrivalmonth)) && (parseInt(returnyear) == parseInt(arrivalyear)) ) {
		alert("Your car collection date must be after your hotel check in date. Please amend.");
		return false;
	
	} else if (arrivaldate < today) {
		alert("You cannot book before todays date. Please amend your arrival date.");
		return false;
	
	} else if (document.getElementById("ParkingDisplay").value != "without") {
						
		if (returndate < arrivaldate) {
			alert("If you require holiday parking BEFORE your hotel stay, please call reservations on 0871 360 2592.");
			// 0871 360 2218
			return false;
			
		}else{
			// Load Quote
			$('#content').css('display','none')
			$('#quotecontainer').css('display','block')	
			setTimeout('document.images["loadinggif"].src = "http://www.airport-parking-quote.co.uk/images/global/loading.gif"', 400); 
			return true;
		}
	
	} else {
		
		// Load Quote
		$('#content').css('display','none')
		$('#quotecontainer').css('display','block')	
		setTimeout('document.images["loadinggif"].src = "http://www.airport-parking-quote.co.uk/images/global/loading.gif"', 400); 
		return true;
	
	}

	
}
function StopLoadingQuote() {
	
	try {document.execCommand("Stop");}
	catch(err){}
	
	try {window.stop()	;}
	catch(err){}
	
	$('#quotecontainer').css('display','none')
	$('#content').css('display','block')
	
	setTimeout('document.images["loadinggif"].src = "http://www.airport-parking-quote.co.uk/images/global/loading.gif"', 400); 
	

	//document.getElementById("quotecontainer").style.display = "none";
	//document.getElementById("main").style.display = "block";
}


function hideFlash() {
	if (document.getElementById('sales-flash')) {
		document.getElementById('sales-flash').style.display = "none";
		//document.getElementById('flashReplace').style.display = "block";
	}
}

function showFlash() {
	if (document.getElementById('sales-flash')) {
		document.getElementById('sales-flash').style.display = "block";
		//document.getElementById('flashReplace').style.display = "none";
	}
}
