//JQuery calls
$(document).ready(function(){
	Cufon.replace('li.phone');
	Cufon.replace('li.email');
	Cufon.replace('li.date');
	Cufon.replace('h1');
	Cufon.replace('h2');
	Cufon.replace('h3');
	$('li.headlink').hover(
	function() { $('ul', this).css('display', 'block'); },
	function() { $('ul', this).css('display', 'none'); });
});

//View date
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();

// Validate the form
function isReady(form_id,name,email,phone,resort,enquiry)
{	
	if (document.forms[form_id].elements[name].value == false)
	{
		document.all.idItemsmarked.style.color="#FF0000";
		document.all.idName.style.color="#FF0000";
		document.all.formError.innerText="Please enter your name";
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = document.forms[form_id].elements[email].value;
	if(reg.test(address) == false) 
	{
		document.getElementById("idItemsmarked").style.color="#FF0000";
		document.getElementById("idEmail").style.color="#FF0000";
		document.getElementById("formError").innerText="Please enter a valid email address";
		return false;    
	}
	if (document.forms[form_id].elements[phone].value == false)
	{
		document.all.idItemsmarked.style.color="#FF0000";
		document.all.idPhone.style.color="#FF0000";
		document.all.formError.innerText="Please enter your Phone number";
		return false;
	}
	if (document.forms[form_id].elements[resort].value == "")
	{
		document.all.idItemsmarked.style.color="#FF0000";
		document.all.idResort.style.color="#FF0000";
		document.all.formError.innerText="Please select your resort";
		return false;
	}
	if (document.forms[form_id].elements[enquiry].value == false)
	{
		document.all.idItemsmarked.style.color="#FF0000";
		document.all.formError.innerText="Please answer the question";
		document.all.idEnquiry.style.color="#FF0000";
		return false;
	}

}
function displayChalet()
{
	if(document.getElementById("selHere").value == "Chalet")
	{
		document.getElementById("idChalet01").style.display = "block";
		document.getElementById("idChalet02").style.display = "block";
	}
	else
	{
		document.getElementById("idChalet01").style.display = "none";
		document.getElementById("idChalet02").style.display = "none";
	}
}

$(document).ready(function () {
  $('#txtEmail').bind('paste', function (e) {
	 e.preventDefault();
	 alert("You cannot paste your email address into this textbox.");
  });
});
