// JavaScript Document

function curPage() <!--When the logo is clicked the page will go back to the index.html page. -->
{
	window.location = "index.html"

	
}

function showLayer() <!--This function comes into effect if the id called "hiddenlayer" is invisible, making it visible. -->

{
	document.getElementById("hiddenlayer").style.visibility ="visible";	
}

function hideLayer() <!--This function comes into effect if the id called "hiddenlayer" is visible, making it invisible. -->

{
	document.getElementById("hiddenlayer").style.visibility = "hidden";
}




function getFocus() <!-- When the contact page is rendered the cursor is automatically displayed in the first textbox on the page. -->
{
	document.getElementById('name').focus()
}






function confirmSubmit() <!--This function makes sure the infomation entered is valid before being submitted.-->
	
	{
	
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   
  	var email= document.forms[0].elements[1].value;
   
 	var submitForm = window.confirm("Are you sure you want to submit the form?");

	if (document.forms[0].elements[0].value == '')

	{
		alert("Please enter Your First Name.");
		document.forms[0].name.focus();
		
		return false;
	}
	
	else if(reg.test(email) == false || document.forms[0].elements[1].value == '')
	
	{
		alert("Please enter a valid E-mail address.");
		document.forms[0].email_address.focus();
		
		return false;
		
		
	}

	if (document.forms[0].elements[9].value == "")
	
	{
		alert("Please leave your comments in the text box provided.");
		document.forms[0].comments.focus();
		
		return false;
		
	}

	else if (submitForm == true)

	
	document.forms[0].submit();

	

}




	function confirmReset() <!--This function checks to make sure the user really wants to reset the form.  If yes, then the form will be clear of all its content. -->

{
	var resetForm = window.confirm("Are you sure you want to reset the form?");
	
	if (resetForm == true)

		document.forms[0].reset();
		
}


