function preloadImages(urls){
 var img = new Array();
 for (var i=0; i<urls.length; i++) {
 img[img.length] = new Image();
 img[img.length - 1].src = urls[i]; 
 }
}

function StartSequencesContact(){
var img = new Array("button_images/about_button_hover.png", "button_images/home_button_hover.png", "button_images/projects_button_hover.png", "button_images/events_button_hover.png", "button_images/shop_button_hover.png", "button_images/contact_button_hover.png", "button_images/submit_standard.jpg", "button_images/submit_hover.jpg", "button_images/reset_standard.jpg", "button_images/reset_hover.jpg" );
preloadImages(img);
window.scrollTo(95, 0);
var timeform = document.getElementById("timecontact");
timeform.onsubmit = ValidateForm;
}

function ChangeBG(name, url){
if (document.getElementById(name)){
	document.getElementById(name).style.backgroundImage = url;
}
}

function ValidateForm(){
	if( this.elements["name"].value === "")
	{alert("Please enter your name into the \"Name\" box.");
	this.elements["name"].focus();
	return false;}
	else if( ( this.elements["email"].value === "")
	|| ( this.elements["email"].value.indexOf("@") === -1)
	|| ( this.elements["email"].value.indexOf(".") === -1))
	{alert("Please enter a valid email address into the \"Email\" box.");
	this.elements["email"].focus();
	return false;}
	else if( (this.elements["conemail"].value !== this.elements["email"].value))
	{alert("Please enter the same email address into the \"Confirm Email\" box.");
	this.elements["conemail"].focus();
	return false;}
	else if( (this.elements["code"].value !== "time2"))
	{alert("Please enter the correct security code into the \"Security Code\" box.");
	this.elements["code"].focus();
	return false;}
}
