//***************************************************
//*  Created by J.P. Wilson on February 15th, 2007  *
//***************************************************

	if (document.images) {
		nav_home = new Image();
		nav_home.src = "images/nav_home.gif";
		nav_uadmin = new Image();
		nav_uadmin.src = "images/nav_uadmin.gif";
		nav_modules = new Image();
		nav_modules.src = "images/nav_modules.gif";
		nav_support = new Image();
		nav_support.src = "images/nav_support.gif";
		nav_demo = new Image();
		nav_demo.src = "images/nav_demos.gif";
		nav_comments = new Image();
		nav_comments.src = "images/nav_comments.gif";
		subnav_title = new Image();
		subnav_title.src = "images/subnav_title.gif";
		subnav_1 = new Image();
		subnav_1.src = "images/subnav_1.gif";
		subnav_2 = new Image();
		subnav_2.src = "images/subnav_2.gif";
		subnav_3 = new Image();
		subnav_3.src = "images/subnav_3.gif";
		subnav_4 = new Image();
		subnav_4.src = "images/subnav_4.gif";
		subnav_5 = new Image();
		subnav_5.src = "images/subnav_5.gif";
		subnav_6 = new Image();
		subnav_6.src = "images/subnav_6.gif";
		subnav_7 = new Image();
		subnav_7.src = "images/subnav_7.gif";
		subnav_8 = new Image();
		subnav_8.src = "images/subnav_8.gif";
		icon_1 = new Image();
		icon_1.src = "images/icon_1.gif";
		icon_2 = new Image();
		icon_2.src = "images/icon_2.gif";
		icon_3 = new Image();
		icon_3.src = "images/icon_3.gif";
		icon_4 = new Image();
		icon_4.src = "images/icon_4.gif";
		icon_5 = new Image();
		icon_5.src = "images/icon_5.gif";
		icon_6 = new Image();
		icon_6.src = "images/icon_6.gif";
	}
	function validateForm(theForm) {
		if (theForm._01_Company.value.replace(" ", "") == "") {
			alert("Please enter your company name!");
			theForm._01_Company.focus();
			return false;
		}
		if (theForm._02_Name.value.replace(" ", "") == "") {
			alert("Please enter your name!");
			theForm._02_Name.focus();
			return false;
		}
		if (theForm._03_Address.value.replace(" ", "") == "") {
			alert("Please enter your address!");
			theForm._03_Address.focus();
			return false;
		}
		if (theForm._04_City.value.replace(" ", "") == "") {
			alert("Please enter your city!");
			theForm._04_City.focus();
			return false;
		}
		if (theForm._05_State.value.replace(" ", "") == "") {
			alert("Please enter your state!");
			theForm._05_State.focus();
			return false;
		}
		if (theForm._06_Zip.value.replace(" ", "") == "") {
			alert("Please enter your zip code!");
			theForm._06_Zip.focus();
			return false;
		}
		if (theForm._07_Phone.value.replace(" ", "") == "") {
			alert("Please enter your phone number!");
			theForm._07_Phone.focus();
			return false;
		}
		if (theForm._09_Email.value.replace(" ", "") == "") {
			alert("Please enter your email address!");
			theForm._09_Email.focus();
			return false;
		}
		if (theForm._09_Email.value.replace(" ", "") != theForm.sender.value.replace(" ", "")) {
			alert("Your email addresses did not match!");
			theForm._09_Email.focus();
			return false;
		}
		if (theForm.str1.value == "") { 
			alert("Please enter the validation code!");
			theForm.str1.focus();
			return false;
		}
		if (theForm.str1.value != theForm.str2.value) {
			theForm.str1.value = "";
			alert("Please enter the validation code!");
			theForm.str1.focus();
			return false;
		}
		document.getElementById('pleasewait').innerHTML = 'Sending information, please wait...';
		return true;
	}
	function validateDemoJoin(theForm) {
		if (theForm.strFirstName.value.replace(" ", "") == "") {
			alert("First name is required!");
			theForm.strFirstName.focus();
			return false;
		}
		if (theForm.strLastName.value.replace(" ", "") == "") {
			alert("Last name is required!");
			theForm.strLastName.focus();
			return false;
		}
		if (theForm.strEmail.value.replace(" ", "") == "") {
			alert("Email address is required!");
			theForm.strEmail.focus();
			return false;
		}
		if (theForm.strCompanyName.value.replace(" ", "") == "") {
			alert("Company name is required!");
			theForm.strCompanyName.focus();
			return false;
		}
		if (theForm.strPassword1.value.replace(" ", "") == "") {
			theForm.strPassword1 = "";
			alert("Password is required!");
			theForm.strPassword1.focus();
			return false;
		}
		if (theForm.strPassword1.value != theForm.strPassword2.value) {
			theForm.strPassword1.value = "";
			theForm.strPassword2.value = "";
			alert("Passwords do not match!");
			theForm.strPassword1.focus();
			return false;
		}
		if (theForm.str1.value.replace(" ", "") == "") {
			alert("Please enter the validation code!");
			theForm.str1.focus();
			return false;
		}
		if (theForm.str1.value != theForm.str2.value) {
			theForm.str1.value = "";
			alert("Please enter the correct validation code!");
			theForm.str1.focus();
			return false;
		}
		return true;
	}
	function validateDemoLogin(theForm) {
		if (theForm.strEmail.value.replace(" ", "") == "") {
			alert("Please enter your email address!");
			theForm.strEmail.focus();
			return false;
		}
		if (theForm.strPassword.value.replace(" ", "") == "") {
			alert("Please enter your password!");
			theForm.strPassword.focus();
			return false;
		}
		return true;
	}
	function formatPhone(field) 
	{
		var temp = field.value.replace(/[^0-9_]/g, "");
		var cursor = temp.length;
		temp = temp.replace(/^([0-9_]{0,3})([0-9_]{0,3})([0-9_]{0,4})([0-9_]*)/, "($1) $2-$3 x $4");
		if (cursor < 11)
				temp = temp.replace(/\s*x\s*$/, "");
		if (cursor < 7)
			temp = temp.replace(/\-\s*$/, "");
		if (cursor < 3)
			temp = temp.replace(/\)\s*$/, "");
		if (! cursor)
			temp = "";

		field.value = temp;
		return true;
	}
	function handleEnterSubmission (field, evt) {
	  var keyCode = evt.which ? evt.which : evt.keyCode;
	  if (keyCode == 13) {
		field.form.submit();
		return false;
	  } else 
		return true;
	}