	function keyDown()
	{
		var keycode = window.event.keyCode

		if (keycode=="13")
		{
			validData()
			
		}
	}
	document.onkeydown = keyDown;

	function Clear(FormControl, sInitValue)
	{
		if(FormControl.value == sInitValue) 
			FormControl.value = "";
	}

	function IfBlankRestore(oFormControl, sString)
	{
		oFormControl.value = ((oFormControl.value == "") ? sString : oFormControl.value);
		return;
	}

	function IsValidEMailAddress(sEMailAddress)
	{
		var regexpEMailAddressPattern = /^\w(\.?\w)*@\w(\.?[-\w])*\.([a-z]{3}(\.[a-z]{2})?|[a-z]{2}(\.[a-z]{2})?)$/i;
		var bIsValid = regexpEMailAddressPattern.test(sEMailAddress);
		return bIsValid;
	}

	//main validation function
	function validData()
	{
		var sError;
		var bValid;

		bValid = true;
		sError = "Please enter all requested information to continue:\n";
		
		
		if ((document.frmmediakit.name.value == "") | (document.frmmediakit.name.value == "Name"))
		{
			sError += "Name is missing\n"; 
			bValid = false;
		}
		if ((document.frmmediakit.email.value == "") | (document.frmmediakit.email.value == "E-Mail Address"))
		{
			sError += "E-mail address is missing\n"; 
			bValid = false;
		}
		if ((document.frmmediakit.email.value != "") && (document.frmmediakit.email.value != "E-Mail Address"))
		{
			if(!IsValidEMailAddress(document.frmmediakit.email.value))
			{
				sError += "You have entered an invalid e-mail format.  Please re-enter your e-mail address.  It must include the @ symbol and the domain (example: johndoe@yourdomain.com).\n"
				bValid = false;
			}
		}
		if ((document.frmmediakit.phone.value == "") | (document.frmmediakit.phone.value  == "Telephone"))
		{
			sError += "Phone number is missing\n"; 
			bValid = false;
		}

		if (!bValid)
		{
			alert(sError);	
		}
		else
		{
			document.frmmediakit.action = "thankyou.asp"

			//alert(document.frmmediakit.action)
			document.frmmediakit.submit();
		}
	}
