
	//Field Background Color Change Function
	function oFocus(theField){
		theField.style.backgroundColor='lightyellow';
	}

	function oBlur(theField){
		theField.style.backgroundColor='#FFFFFF';
	}

	//Regular Expression to detect non-valid symbols
	function isProper(string) {

		if (!string) return false;
			var iChars = "*|^+=~_?\"<:>[]{}`;()@$#%";
			for (var i = 0; i < string.length; i++) {
    			if (iChars.indexOf(string.charAt(i)) != -1)
				return false;
				}
			return true;
		}

	//Installers Form Validation
	function Literature_Validator(theForm){

		if (theForm.Name.value.length < 3){
		    alert("Please enter a valid value in the \"Name\" field.");
		    theForm.Name.focus();
			return (false);
		}

		if (isProper(theForm.Name.value) == false) {
			alert("The \"Name\" field may contain a non-valid symbol or character.\nPlease re-enter your Name.");
			theForm.Name.focus();
			return false;
		}

		//Name
		if (theForm.Name.value == ""){
		    alert("Please enter a value for the \"Name\" field.");
		    theForm.Name.focus();
			return (false);
		}

		if (theForm.Name.value.length < 3){
		    alert("Please enter a valid value in the \"Name\" field.");
		    theForm.Name.focus();
			return (false);
		}

		if (isProper(theForm.Name.value) == false) {
			alert("The \"Name\" field may contain a non-valid symbol or character.\nPlease re-enter your Name.");
			theForm.Name.focus();
			return false;
		}

		//Title
		if (theForm.Title.value == ""){
		    alert("Please enter a value for the \"Title\" field.");
		    theForm.Title.focus();
			return (false);
		}

		if (theForm.Title.value.length < 3){
		    alert("Please enter a valid value in the \"Title\" field.");
		    theForm.Title.focus();
			return (false);
		}

		if (isProper(theForm.Title.value) == false) {
			alert("The \"Title\" field may contain a non-valid symbol or character.\nPlease re-enter your Title.");
			theForm.Title.focus();
			return false;
		}

		//Company
		if (theForm.Company.value == ""){
		    alert("Please enter a value for the \"Company\" field.");
		    theForm.Company.focus();
			return (false);
		}

		if (theForm.Company.value.length < 3){
		    alert("Please enter a valid value in the \"Company\" field.");
		    theForm.Company.focus();
			return (false);
		}

		if (isProper(theForm.Company.value) == false) {
			alert("The \"Company\" field may contain a non-valid symbol or character.\nPlease re-enter your Company name.");
			theForm.Company.focus();
			return false;
		}

		//Address
		if (theForm.Address_1.value == ""){
		    alert("Please enter a value for the \"Address\" field.");
		    theForm.Address_1.focus();
			return (false);
		}

		if (theForm.Address_1.value.length < 8){
		    alert("Please enter a valid value in the \"Address\" field.");
		    theForm.Address_1.focus();
			return (false);
		}

		if (isProper(theForm.Address_1.value) == false) {
			alert("The \"Address\" field may contain a non-valid symbol or character.\nPlease re-enter your Address.");
			theForm.Address_1.focus();
			return false;
		}

		//City
		if (theForm.City.value == ""){
		    alert("Please enter a value for the \"City\" field.");
		    theForm.City.focus();
			return (false);
		}

		if (theForm.City.value.length < 3){
		    alert("Please enter a valid value in the \"City\" field.");
		    theForm.City.focus();
			return (false);
		}

		if (isProper(theForm.City.value) == false) {
			alert("The \"City\" field may contain a non-valid symbol or character.\nPlease re-enter your City.");
			theForm.City.focus();
			return false;
		}

		//State or Province
		if (theForm.StateProvince.value == ""){
		    alert("Please enter a value for the \"State\/Province\" field.");
		    theForm.StateProvince.focus();
			return (false);
		}

		if (theForm.StateProvince.value.length < 2){
		    alert("Please enter a value for the \"State\/Province\" field.");
		    theForm.StateProvince.focus();
			return (false);
		}

		if (isProper(theForm.StateProvince.value) == false) {
			alert("The \"StateProvince\" field may contain a non-valid symbol or character.\nPlease re-enter your State\/Province.");
			theForm.StateProvince.focus();
			return false;
		}

		//Zip Code
		if (theForm.Zip.value == ""){
		    alert("Please enter a value for the \"Zip Code\" field.");
		    theForm.Zip.focus();
			return (false);
		}

		if (theForm.Zip.value.length < 5){
		    alert("Please enter a valid value in the \"Zip Code\" field.");
		    theForm.Zip.focus();
			return (false);
		}

		//Country
		if (isProper(theForm.Country.value) == false) {
			alert("The \"Country\" field may contain a non-valid symbol or character.\nPlease re-enter your Country.");
			theForm.Country.focus();
			return false;
		}

		//Phone
		if (theForm.Phone.value == ""){
		    alert("Please enter a value for the \"Phone\" field.");
		    theForm.Phone.focus();
			return (false);
		}

		if (theForm.Phone.value.length < 10){
		    alert("Please enter a value for the \"Phone\" field.");
		    theForm.Phone.focus();
			return (false);
		}

		//Email
		if (theForm.Email.value == ""){
			alert("Please enter a value for the \"Email\" field.");
    		theForm.Email.focus();
			return (false);
		}

		if (theForm.Email.value.length < 7){
			alert("Please enter a valid value for the \"Email\" field.");
			theForm.Email.focus();
			return (false);
		}

		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@-_.";
		var checkStr = theForm.Email.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++){
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
				if (j == checkOK.length){
					allValid = false;
					break;
				}
			}
			if (!allValid){
				alert("Please enter a valid value for the \"Email\" field.");
				theForm.Email.focus();
				return (false);
			}

		var CheckRegExp = /[^@_\.\w\d]|@@|\.\.|__|^@|^\.|^_|@$|\.$|_$|@\.|\.@|@_|_@|\._|_\.|(@)[^@]*\1/g;
		var string = theForm.Email.value;
			if ( ( ( ( string.match(/@/) ) && ( string.match(/\./) ) ) == null ) ||
					 ( string.match( CheckRegExp ) != null ) ) {
						alert("Please enter a valid value for the \"Email\" field.");
						theForm.Email.focus();
				return ( false );
			}

		//THE FOLLOWING IS THE ACTUAL LITERATURE STUFF

//		var radioSelected = false;
//		for (i = 0;  i < theForm.Catalog_requested.length;  i++){
//			if (theForm.Catalog_requested[i].checked)
//		        radioSelected = true;
//		}

//		if (!radioSelected){
//			alert("Please select one of the \"Please select which catalog you would like us to send to you\" options.");
//			return (false);
//		}	

		if (theForm.role.selectedIndex < 0){
		    alert("Please select one of the \"What is your company's role relative to Ortronics products?\" options.");
		    theForm.role.focus();
		    return (false);
		}

		if (theForm.role.selectedIndex == 0){
		    alert("The first \"What is your company's role relative to Ortronics products?\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.role.focus();
		    return (false);
		}

		if (theForm.pbusiness.selectedIndex < 0){
		    alert("Please select one of the \"What is your company's primary business?\" options.");
		    theForm.pbusiness.focus();
		    return (false);
		}

		if (theForm.pbusiness.selectedIndex == 0){
		    alert("The first \"What is your company's primary business?\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.pbusiness.focus();
		    return (false);
		}

		if (theForm.jobfunction.selectedIndex < 0){
		    alert("Please select one of the \"What is your job function?\" options.");
		    theForm.jobfunction.focus();
		    return (false);
		}

		if (theForm.jobfunction.selectedIndex == 0){
		    alert("The first \"What is your job function?\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.jobfunction.focus();
		    return (false);
		}

		var radioSelected = false;
		for (i = 0;  i < theForm.mpdecision.length;  i++){
	  		if (theForm.mpdecision[i].checked)
		        radioSelected = true;
		}

		if (!radioSelected){
		    alert("Please select one of the \"Do you make specifying or purchasing decisions for structured cabling products?\" options.");
		    return (false);
		}

		var radioSelected = false;
		for (i = 0;  i < theForm.currentp.length;  i++){
	  		if (theForm.currentp[i].checked)
		        radioSelected = true;
		}

		if (!radioSelected){
		    alert("Please select one of the \"New Project\" options.");
		    return (false);
		}

		var radioSelected = false;
		for (i = 0;  i < theForm.upgradep.length;  i++){
	  		if (theForm.upgradep[i].checked)
	        radioSelected = true;
		}

		if (!radioSelected){
		    alert("Please select one of the \"Upgrade Project\" options.");
		    return (false);
		}

		if (theForm.drops.selectedIndex < 0){
		    alert("Please select one of the \"How many workstations or drops are being installed on the networ\" options.");
		    theForm.drops.focus();
		    return (false);
		}

		if (theForm.drops.selectedIndex == 0){
		    alert("The first \"How many workstations or drops are being installed on the networ\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.drops.focus();
		    return (false);
		}

		if (theForm.pstage.selectedIndex < 0){
		    alert("Please select one of the \"Project Stage\" options.");
		    theForm.pstage.focus();
		    return (false);
		}

		if (theForm.pstage.selectedIndex == 0){
		    alert("The first \"Project Stage\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.pstage.focus();
		    return (false);
		}

		if (theForm.timeframe.selectedIndex < 0){
		    alert("Please select one of the \"Purchasing Timeframe\" options.");
		    theForm.timeframe.focus();
		    return (false);
		}

		if (theForm.timeframe.selectedIndex == 0){
		    alert("The first \"Purchasing Timeframe\" option is not a valid selection.  Please choose one of the other options.");
		    theForm.timeframe.focus();
		    return (false);
		}

		var radioSelected = false;
		for (i = 0;  i < theForm.budget.length;  i++){
	  		if (theForm.budget[i].checked)
		        radioSelected = true;
		}

		if (!radioSelected){
			alert("Please select one of the \"Do you have an approved budget?\" options.");
		    return (false);
		}

	return (true);
	}

