//*************************************************************************************************************//
//Declare the strings to be used in the javascript error messages
var strerr1 =  "Username is invalid";
var strerr6 =  "Username is a maximum of 20 characters";

var strerr2 =  "Password is invalid";
var strerr42 = "Current Password is invalid";
var strerr43 = "New Password is invalid";
var strerr44 = "You did not confirm your new password correctly";

var strerr3 =  "Last name is invalid";
var strerr4 =  "First name is invalid";
var strerr5 =  "Email is invalid";		

var strerr7 =  "Birth Date Year is in invalid";
var strerr8 =  "Birth Date Year must be numeric";
var strerr9 =  "Birth Date Year must be in YYYY format";
var strerr10 = "Birth Date Year must be greater than 1900";
var strerr11 = "Birth Date Day is invalid";
var strerr12 = "Birth Date Month is invalid";

var strerr13 =  "Language is invalid";
var strerr14 =  "Zip/Postal Code is invalid";
var strerr15 =  "Country is invalid";
var strerr16 =  "State/Province is invalid";
var strerr17 =  "City is invalid";
var strerr18 =  "Address is invalid";
var strerr19 =  "Primary Phone is invalid";
var strerr_gender =  "Gender is invalid";

var strerr20 =  "Network Card 1 - Driver Version is invalid";
var strerr21 =  "Network Card 1 - Name is invalid";

var strerr22 =  "Audio Card 1 - Driver Provider is invalid";
var strerr23 =  "Audio Card 1 - Driver Version is invalid";
var strerr24 =  "Audio Card 1 - Name is invalid";

var strerr25 =  "Video Card 1 - Driver Provider is invalid";
var strerr26 =  "Video Card 1 - Driver Version is invalid";
var strerr27 =  "Video Card 1 - Name is invalid";

var strerr28 =  "Memory is invalid";
var strerr29 =  "Memory must be numeric";

var strerr30 =  "Processor Speed is in invalid";
var strerr31 =  "Processor Speed must be numeric";
var strerr32 =  "Processor Model is invalid";
var strerr33 =  "Processor Type is invalid";

var strerr34 =  "Motherboard Bios Version/Date is invalid";
var strerr35 =  "Motherboard Chipset is invalid";
var strerr36 =  "Motherboard Model is invalid";
var strerr37 =  "Motherboard Manufacturer is invalid";

var strerr38 =  "Direct X Version is invalid";

var strerr39 =  "OS Service Pack is invalid";
var strerr40 =  "OS is invalid";

var strerr41 =  "System Nickname is invalid";

var strerr45 =  "Problem is empty";
var strerr46 =  "Subject is empty";
var strerr47 =  "System is invalid";
var strerr48 =  "Product is invalid";
var strerr51 =  "FAQ ID is invalid";

var strerr49 =  "Age must be numeric";
var strerr50 =  "In order to comply with laws and regulations we do not collect information from children under the age of 16. Please ask your parent or legal guardian to represent and act for you.";


var confirmMsgtext = "Delete System:";

var messagestart = "The following error(s) occurred:";

//*****************************************************************************************************************//


function trim(inputString) 
{
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


function checkLoginform()
{
	// create error message string variable, with nothing in it

	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	//Checking for empty last name field
	trimmed_string = trim(document.login_form.username.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr1 + "\n";
	        //message = message + "Username is invalid\n";
			document.login_form.username.focus();
	}

	//Checking for empty last name field
	trimmed_string = trim(document.login_form.password.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr2 + "\n";
			document.login_form.password.focus();
	}

	form = checkMessage(message);
return form;

}


function checkLoginform2()
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	//Checking for empty last name field
	trimmed_string = trim(document.login_form2.username.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr1 + "\n";
			document.login_form2.username.focus();
	}

	//Checking for empty last name field
	trimmed_string = trim(document.login_form2.password.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr2 + "\n";
			document.login_form2.password.focus();
	}

	form = checkMessage(message);
return form;

}


//************************Customer Registration Step 1 validation**********************
//Take in mind that every error is checked to ensure user friendly error messages
//I understand that these if stmts can easily be combined
function checkCUSTREG1()
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false	

	//Checking for empty last name field
	trimmed_string = trim(document.customer_reg_step1.lastname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr3 + "\n";
			document.customer_reg_step1.lastname.focus();
	}

	//Checking for empty first name field
	trimmed_string = trim(document.customer_reg_step1.firstname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr4 + "\n";
			document.customer_reg_step1.firstname.focus();
	}

	//Check the email address
	if (!isEmailAddr(document.customer_reg_step1.email.value))
	{
		message = message + strerr5 + "\n";		
		document.customer_reg_step1.email.focus();
	}

	//Checking for blank username field
	trimmed_string = trim(document.customer_reg_step1.username.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr1 + "\n";
			document.customer_reg_step1.username.focus();
	}
	else
	{
		//Maximum of 12 characters
		if(trimmed_string.length > 20)
		{
			message = message + strerr6 + "\n";
			document.customer_reg_step1.username.focus();
		}
	}

	//Validate the age
	//trimmed_string = trim(document.customer_reg_step1.age.value);

	//If the string is age year
	//if(trimmed_string.length == 0)
	//{
	//	message = message + strerr49 + "\n"
	//	document.customer_reg_step1.age.focus();
	//}
	//else
	//{
		//if the age is numeric
	//	if(isNaN(document.customer_reg_step1.age.value) == true)
	//	{ 
	//		message = message + strerr49 + "\n";
	//		document.customer_reg_step1.age.focus();
	//	}
	//	else
	//	{
			//if the age is over 16
	//		if(document.customer_reg_step1.age.value < 16)
	//		{
	//			message = strerr50 + "\n";
	//			document.customer_reg_step1.age.focus();
	//		}			
	//	}
	//}
	
	//Language check
	if(document.customer_reg_step1.lang_id.value == 0)
	{
		message = message + strerr13 + "\n";
		document.customer_reg_step1.lang_id.focus();		
	}

	//Zip postal check
	trimmed_string = trim(document.customer_reg_step1.zip_postal.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr14 + "\n";
			document.customer_reg_step1.zip_postal.focus();
	}

	//Country id check
	if(document.customer_reg_step1.country_id.value == 0)
	{
		message = message + strerr15 + "\n";
		document.customer_reg_step1.country_id.focus();		
	}

	//State and Province check
	
    var isIE=document.all?true:false;
    var isDOM=document.getElementById?true:false;
    
    if( isIE )
    {
    	if( divstatetext.style.visibility == "visible" )
    	    document.customer_reg_step1.state_prov.value = document.customer_reg_step1.statetext.value;
        else
    	    document.customer_reg_step1.state_prov.value = document.customer_reg_step1.statelist.options[document.customer_reg_step1.statelist.selectedIndex].value;
    }
    else if( isDOM )
    {
    	if( document.getElementById("divstatetext").style.visibility == "visible" )
    	    document.customer_reg_step1.state_prov.value = document.customer_reg_step1.statetext.value;
        else
    	    document.customer_reg_step1.state_prov.value = document.customer_reg_step1.statelist.options[document.customer_reg_step1.statelist.selectedIndex].value;
    }

	trimmed_string = trim(document.customer_reg_step1.state_prov.value);

	if (trimmed_string.length == 0)
	{
	        message = message + strerr16 + "\n";
			//document.customer_reg_step1.state_prov.focus();
	}

	//City check
	trimmed_string = trim(document.customer_reg_step1.city.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr17 + "\n";
			document.customer_reg_step1.city.focus();
	}

	//Address check
	trimmed_string = trim(document.customer_reg_step1.address.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr18 + "\n";
			document.customer_reg_step1.address.focus();
	}

	//Primary phone 1
	trimmed_string = trim(document.customer_reg_step1.phone1.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr19 + "\n";
			document.customer_reg_step1.phone1.focus();
	}

	//Gender
	// set var radio_choice to false
	var radio_choice = false;

	// Loop from zero to the one minus the number of radio button selections
	for (counter = 0; counter < document.customer_reg_step1.gender.length; counter++)
	{
	// If a radio button has been selected it will return true
	// (If not it will return false)
		if (document.customer_reg_step1.gender[counter].checked)
			radio_choice = true; 
	}
	
	if (!radio_choice)
	{
		message = message + strerr_gender + "\n";
		document.customer_reg_step1.gender.focus();
	}

	form = checkMessage(message);
return form;

} // end of the function checkform()


//************************Customer Registration Step 2 validation**********************
function checkCUSTREG2() 
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false	


	//Product validation for "[N/A]"
	//trimmed_string = trim(document.customer_reg_step2.products.value);
	//if (trimmed_string == "[N/A]") 
	//{
	//        message = message + "Select a valid product" + "\n";
	//		document.customer_reg_step1.products.focus();
	//}
	
	form = checkMessage(message);
return form;
} // end of the function checkform()


function checkADDSYSTEM()
{
	if(document.customer_reg_step3.testbutton.value == 2)
	{
		// create error message string variable, with nothing in it
		var message = ""; 
		var trimmed_string;
		var form = "";      //The form return of true or false
	
		//Nickname
		trimmed_string = trim(document.customer_reg_step3.nickname.value);
		if (trimmed_string.length == 0) 
		{
				message = message + strerr41 + "\n";
				document.customer_reg_step3.nickname.focus();
				
		}
	
		form = checkMessage(message);
		return form;
	}
	else
	{
		return true;
	}
} // end of the function checkADDSYSTEM()

//*******************************Customer Registration Step 3 - Manual system**********************
function checkCUSTREG3()
{
//Os check
if(document.customer_reg_step3.testbutton.value == 2)
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	//Network Driver Version
	//trimmed_string = trim(document.customer_reg_step3.elements['network[0][driver_ver]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr20 + "\n";
	//		document.customer_reg_step3.elements['network[0][driver_ver]'].focus();
	//}

	//Network Name
	//trimmed_string = trim(document.customer_reg_step3.elements['network[0][name]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr21 + "\n";
	//		document.customer_reg_step3.elements['network[0][name]'].focus();
	//}

	//Audio Driver Provider
	//trimmed_string = trim(document.customer_reg_step3.elements['audio[0][driver_prov]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr22 + "\n";
	//		document.customer_reg_step3.elements['audio[0][driver_prov]'].focus();
	//}

	//Audio Driver Version
	//trimmed_string = trim(document.customer_reg_step3.elements['audio[0][driver_ver]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr23 + "\n";
	//		document.customer_reg_step3.elements['audio[0][driver_ver]'].focus();
	//}

	//Audio Name
	//trimmed_string = trim(document.customer_reg_step3.elements['audio[0][name]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr24 + "\n";
	//		document.customer_reg_step3.elements['audio[0][name]'].focus();
	//}

	//Video Driver Provider
	//trimmed_string = trim(document.customer_reg_step3.elements['video[0][driver_prov]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr25 + "\n";
	//		document.customer_reg_step3.elements['video[0][driver_prov]'].focus();
	//}

	//Video Driver Version
	//trimmed_string = trim(document.customer_reg_step3.elements['video[0][driver_ver]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr26 + "\n";
	//		document.customer_reg_step3.elements['video[0][driver_ver]'].focus();
	//}

	//Video Name
	//trimmed_string = trim(document.customer_reg_step3.elements['video[0][name]'].value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr27 + "\n";
	//		document.customer_reg_step3.elements['video[0][name]'].focus();
	//}

	//Memory
	//trimmed_string = trim(document.customer_reg_step3.memory_num.value);
	//if(trimmed_string.length == 0)
	//{
	//	message = message + strerr28 + "\n"
	//	document.customer_reg_step3.memory_num.focus();
	//}
	//else
	//{
		//Memory is numeric
	//	if(isNaN(document.customer_reg_step3.memory_num.value) == true)
	//	{ 
	//		message = message + strerr29 + "\n";
	//		document.customer_reg_step3.memory_num.focus();
	//	}
	//}

	//Processor Speed
	//trimmed_string = trim(document.customer_reg_step3.processor_speed_num.value);
	//if(trimmed_string.length == 0)
	//{
	//	message = message + strerr30 + "\n"
	//	document.customer_reg_step3.processor_speed_num.focus();
	//}
	//else
	//{
	//	//Processor Speed is numeric
	//	if(isNaN(document.customer_reg_step3.processor_speed_num.value) == true)
	//	{ 
	//		message = message + strerr31 + "\n";
	//		document.customer_reg_step3.processor_speed_num.focus();
	//	}
	//}

	//Processor Model
	//trimmed_string = trim(document.customer_reg_step3.processor_model.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr32 + "\n";
	//		document.customer_reg_step3.processor_model.focus();
	//}

	//Processor Type
	//trimmed_string = trim(document.customer_reg_step3.processor_type.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr33 + "\n";
	//		document.customer_reg_step3.processor_type.focus();
	//}

	//Motherboard Bios Version Date
	//trimmed_string = trim(document.customer_reg_step3.mboard_bios_ver.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr34 + "\n";
	//		document.customer_reg_step3.mboard_bios_ver.focus();
	//}

	//Motherboard Chipset
	//trimmed_string = trim(document.customer_reg_step3.mboard_chipset.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr35 + "\n";
	//		document.customer_reg_step3.mboard_chipset.focus();
	//}

	//Motherboard Model
	//trimmed_string = trim(document.customer_reg_step3.mboard_model.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr36 + "\n";
	//		document.customer_reg_step3.mboard_model.focus();
	//}

	//Motherboard Manufacturer
	//trimmed_string = trim(document.customer_reg_step3.mboard_manufac.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr37 + "\n";
	//		document.customer_reg_step3.mboard_manufac.focus();
	//}

	//Direct X Version
	//trimmed_string = trim(document.customer_reg_step3.directx_ver.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr38 + "\n";
	//		document.customer_reg_step3.directx_ver.focus();
	//}

	//Service Pack
	//trimmed_string = trim(document.customer_reg_step3.os_spack.value);
	//if (trimmed_string.length == 0) 
	//{
	//        message = message + strerr39 + "\n";
	//		document.customer_reg_step3.os_spack.focus();
	//}

	//OS ID
	//if(document.customer_reg_step3.os_id.value < 1)
	//{
	//	message = message + strerr40 + "\n";
	//	document.customer_reg_step3.os_id.focus();		
	//}

	//Nickname
	trimmed_string = trim(document.customer_reg_step3.nickname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr41 + "\n";
			document.customer_reg_step3.nickname.focus();
	}

	form = checkMessage(message);
	return form;
}
else
{
	return true;
}

} // end of the function checkform()

function CheckSendLogin()
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var form = "";      //The form return of true or false	

	//Check the email address
	if (!isEmailAddr(document.sendlogin.useremail.value))
	{
		message = message + strerr5 + "\n";		
		document.sendlogin.useremail.focus();
	}

	form = checkMessage(message);
return form;

}

function CheckSysAuto()
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	//Check nickname
	trimmed_string = trim(document.system.nickname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr41 + "\n";
			document.system.nickname.focus();
	}

	form = checkMessage(message);
return form;

}

function checkEDITPROF()
{
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false	

	//Language check
	if(document.edit_prof.lang_id.value == 0)
	{
		message = message + strerr13 + "\n";
		document.edit_prof.lang_id.focus();		
	}

	//Zip postal check
	trimmed_string = trim(document.edit_prof.zip_postal.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr14 + "\n";
			document.edit_prof.zip_postal.focus();
	}

	//Country id check
	if(document.edit_prof.country_id.value == 0)
	{
		message = message + strerr15 + "\n";
		document.edit_prof.country_id.focus();		
	}

	//State and Province check
    var isIE=document.all?true:false;
    var isDOM=document.getElementById?true:false;
    if( isIE )
    {
    	if( divstatetext.style.visibility == "visible" )
    	    document.edit_prof.state_prov.value = document.edit_prof.statetext.value;
        else
    	    document.edit_prof.state_prov.value = document.edit_prof.statelist.options[document.edit_prof.statelist.selectedIndex].value;
    }
    else if( isDOM )
    {
    	if( document.getElementById("divstatetext").style.visibility == "visible" )
    	    document.edit_prof.state_prov.value = document.edit_prof.statetext.value;
        else
    	    document.edit_prof.state_prov.value = document.edit_prof.statelist.options[document.edit_prof.statelist.selectedIndex].value;
    }
	trimmed_string = trim(document.edit_prof.state_prov.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr16 + "\n";
			//document.edit_prof.state_prov.focus();
	}

	//City check
	trimmed_string = trim(document.edit_prof.city.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr17 + "\n";
			document.edit_prof.city.focus();
	}

	//Address check
	trimmed_string = trim(document.edit_prof.address.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr18 + "\n";
			document.edit_prof.address.focus();
	}

	//Primary phone 1
	trimmed_string = trim(document.edit_prof.phone1.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr19 + "\n";
			document.edit_prof.phone1.focus();
	}

	//Checking for empty last name field
	trimmed_string = trim(document.edit_prof.lastname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr3 + "\n";
			document.edit_prof.lastname.focus();
	}

	//Checking for empty first name field
	trimmed_string = trim(document.edit_prof.firstname.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr4 + "\n";
			document.edit_prof.firstname.focus();
	}

	form = checkMessage(message);
return form;

}


function checkChangePass()
{
	
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	trimmed_string = trim(document.changepass.cur_pass.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr42 + "\n";
			document.changepass.cur_pass.focus();
	}

	trimmed_string = trim(document.changepass.new_pass.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr43 + "\n";
			document.changepass.new_pass.focus();
	}

	if(document.changepass.cnew_pass.value != document.changepass.new_pass.value)
	{
		message = message + strerr44 + "\n";
		document.changepass.cnew_pass.focus();
	}
	
	form = checkMessage(message);
return form;

}


function confirmLink(theLink, strQuery)
{
	confirmMsg = confirmMsgtext;
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + '\n' + strQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';		
    }

    return is_confirmed;
} // end of the 'confirmLink()' function


function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function checkEMAILSUP()
{
	
	// create error message string variable, with nothing in it
	var message = ""; 
	var trimmed_string;
	var form = "";      //The form return of true or false

	trimmed_string = trim(document.email_support.problem.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr45 + "\n";
			document.email_support.problem.focus();
	}

	trimmed_string = trim(document.email_support.subject.value);
	if (trimmed_string.length == 0) 
	{
	        message = message + strerr46 + "\n";
			document.email_support.subject.focus();
	}

	if(document.email_support.system.value < 1)
	{
		message = message + strerr47 + "\n";
		document.email_support.system.focus();
	}
	
	if(document.email_support.product.value < 1)
	{
		message = message + strerr48 + "\n";
		document.email_support.product.focus();
	}

	form = checkMessage(message);
return form;

}

  
function checkMessage(message)
{
	// is there an error message?   		
	if ( message.length > 0 ) 
	{ 
		   message = messagestart + "\n\n" + message;	
		   alert( message ); // display error message 
	       return false; // return false, not ok to process 
    }
	else 
	{
		   return true; // no error message to display, return ok to process 
	} 

}

function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  var winpops = window.open(theURL,winName,features);
  winpops.moveTo(0,0);
}

function checkSearchFAQ()
{
	
	var message = ""; 
	var form = "";      //The form return of true or false

	if( document.search_faq.FAQProductID.value < 1 && document.search_faq.faqid.value == '' )
	{
		message = strerr48 + "\n";
		document.search_faq.FAQProductID.focus();
	}
    if( document.search_faq.faqid.value != '' && isNaN( document.search_faq.faqid.value ) )
    {
        message = strerr51 + "\n";
		document.search_faq.faqid.focus();
    }
	
	form = checkMessage(message);
return form;
}
