// email validation script 

function validMail(obj)	{				
	var EmailOk  = true
	var Temp     = obj
	var AtSym    = Temp.value.indexOf('@')
	var Period   = Temp.value.lastIndexOf('.')
	var Space    = Temp.value.indexOf(' ')
	var Length   = Temp.value.length - 1   // Array is from 0 to length-1

	if(obj.value !=""){
		if ((AtSym < 1) ||                     // '@' cannot be in first position
		    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
		    (Period == Length ) ||             // Must be atleast one valid char after '.'
		    (Space  != -1))                    // No empty spaces permitted
			   {  
		      EmailOk = false
		      alert("Please enter a valid e-mail address!");
			      Temp.value="";
			      Temp.focus();
		      return EmailOk;
   			}
		}
	}

// user/newuser.php

function Form1_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
		//User Name
	theForm.userName.value = LTrim(theForm.userName.value);
	theForm.userName.value = RTrim(theForm.userName.value);
	if (!emptystring(theForm.userName.value))
		 {
			alert("Please enter the User Name");
			theForm.userName.focus();
			flag=false;
			return (false);
		}
  
	//Password
	theForm.password.value = LTrim(theForm.password.value);
	theForm.password.value = RTrim(theForm.password.value);
	if (!emptystring(theForm.password.value))
		 {
			alert("Please enter the Password");
			theForm.password.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form2_Validator(theForm)
{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	//Category Name
	theForm.selCat.value = LTrim(theForm.selCat.value);
	theForm.selCat.value = RTrim(theForm.selCat.value);
	if (!emptystring(theForm.selCat.value))
		 {
			alert("Please select Category Name");
			flag=false;
			return (false);
		}
		
	//Sub Category Name
	theForm.subCatName.value = LTrim(theForm.subCatName.value);
	theForm.subCatName.value = RTrim(theForm.subCatName.value);
	if (!emptystring(theForm.subCatName.value))
		 {
			alert("Please enter Sub Category Name");
			theForm.subCatName.focus();
			flag=false;
			return (false);
		}
			theForm.title.value = LTrim(theForm.title.value);
	theForm.title.value = RTrim(theForm.title.value);
	if (!emptystring(theForm.title.value))
		 {
			alert("Please Enter Title");
			theForm.title.focus();
			flag=false;
			return (false);
		}
	theForm.metades.value = LTrim(theForm.metades.value);
	theForm.metades.value = RTrim(theForm.metades.value);
	if (!emptystring(theForm.metades.value))
		 {
			alert("Please Enter Meta Description");
			theForm.metades.focus();
			flag=false;
			return (false);
		}
	theForm.keywords.value = LTrim(theForm.keywords.value);
	theForm.keywords.value = RTrim(theForm.keywords.value);
	if (!emptystring(theForm.keywords.value))
		 {
			alert("Please Enter Keywords");
			theForm.keywords.focus();
			flag=false;
			return (false);
		}

	//Set this return value to true when you want to submit the form
	return (flag);
}

function Form3_Validator(theForm)
{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	//Category Name
	theForm.subCatName.value = LTrim(theForm.subCatName.value);
	theForm.subCatName.value = RTrim(theForm.subCatName.value);
	if (!emptystring(theForm.subCatName.value))
		 {
			alert("Please Enter Sub Category Name");
			theForm.subCatName.focus();
			flag=false;
			return (false);
		}
	theForm.title.value = LTrim(theForm.title.value);
	theForm.title.value = RTrim(theForm.title.value);
	if (!emptystring(theForm.title.value))
		 {
			alert("Please Enter Title");
			theForm.title.focus();
			flag=false;
			return (false);
		}
	theForm.metades.value = LTrim(theForm.metades.value);
	theForm.metades.value = RTrim(theForm.metades.value);
	if (!emptystring(theForm.metades.value))
		 {
			alert("Please Enter Meta Description");
			theForm.metades.focus();
			flag=false;
			return (false);
		}
	theForm.keywords.value = LTrim(theForm.keywords.value);
	theForm.keywords.value = RTrim(theForm.keywords.value);
	if (!emptystring(theForm.keywords.value))
		 {
			alert("Please Enter Keywords");
			theForm.keywords.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form4_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	
  //Product Name
	theForm.selCat.value = LTrim(theForm.selCat.value);
	theForm.selCat.value = RTrim(theForm.selCat.value);
	if (!emptystring(theForm.selCat.value))
		 {
			alert("Please Select Category");
			flag=false;
			return (false);
		}
  
  	
  //selSubCat
	theForm.selSubCat.value = LTrim(theForm.selSubCat.value);
	theForm.selSubCat.value = RTrim(theForm.selSubCat.value);
	if (!emptystring(theForm.selSubCat.value))
		 {
			alert("Please Select Sub Category");
			flag=false;
			return (false);
		}
    //selSubCat
	theForm.productName.value = LTrim(theForm.productName.value);
	theForm.productName.value = RTrim(theForm.productName.value);
	if (!emptystring(theForm.productName.value))
		 {
			alert("Please Enter Product Name");
			flag=false;
			return (false);
		}
  
   	
	
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form5_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	
 //Company Name
	theForm.selPage.value = LTrim(theForm.selPage.value);
	theForm.selPage.value = RTrim(theForm.selPage.value);
	if (!emptystring(theForm.selPage.value))
		 {
			alert("Please select Page");
			theForm.selPage.focus();
			flag=false;
			return (false);
		}
					theForm.title.value = LTrim(theForm.title.value);
	theForm.title.value = RTrim(theForm.title.value);
	if (!emptystring(theForm.title.value))
		 {
			alert("Please Enter Title");
			theForm.title.focus();
			flag=false;
			return (false);
		}
	theForm.metades.value = LTrim(theForm.metades.value);
	theForm.metades.value = RTrim(theForm.metades.value);
	if (!emptystring(theForm.metades.value))
		 {
			alert("Please Enter Meta Description");
			theForm.metades.focus();
			flag=false;
			return (false);
		}
	theForm.keywords.value = LTrim(theForm.keywords.value);
	theForm.keywords.value = RTrim(theForm.keywords.value);
	if (!emptystring(theForm.keywords.value))
		 {
			alert("Please Enter Keywords");
			theForm.keywords.focus();
			flag=false;
			return (false);
		}

	
	//Set this return value to true when you want to submit the form
	return (flag);
}

function Form6_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }

		//Description Name
	theForm.description.value = LTrim(theForm.description.value);
	theForm.description.value = RTrim(theForm.description.value);
	if (!emptystring(theForm.description.value))
		 {
			alert("Please enter Description");
			theForm.description.focus();
			flag=false;
			return (false);
		}
		
	//Set this return value to true when you want to submit the form
	return (flag);
}

function Form7_Validator(theForm)
{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	//Ship Name
	theForm.shipName.value = LTrim(theForm.shipName.value);
	theForm.shipName.value = RTrim(theForm.shipName.value);
	if (!emptystring(theForm.shipName.value))
		 {
			alert("Please enter the Ship Name");
			theForm.shipName.focus();
			flag=false;
			return (false);
		}
		
	//Client Desc Name
	theForm.clientDesc.value = LTrim(theForm.clientDesc.value);
	theForm.clientDesc.value = RTrim(theForm.clientDesc.value);
	if (!emptystring(theForm.clientDesc.value))
		 {
			alert("Please enter the Client Description");
			theForm.clientDesc.focus();
			flag=false;
			return (false);
		}
	
	//Set this return value to true when you want to submit the form
	return (flag);
}


//Login
function Form8_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 //Company code
	theForm.clientId.value = LTrim(theForm.clientId.value);
	theForm.clientId.value = RTrim(theForm.clientId.value);
	if (!emptystring(theForm.clientId.value))
		 {
			alert("Please enter the Company code");
			theForm.clientId.focus();
			flag=false;
			return (false);
		}
  

	//User Name
	theForm.userName.value = LTrim(theForm.userName.value);
	theForm.userName.value = RTrim(theForm.userName.value);
	if (!emptystring(theForm.userName.value))
		 {
			alert("Please enter the User Name");
			theForm.userName.focus();
			flag=false;
			return (false);
		}
  
	//Password
	theForm.password.value = LTrim(theForm.password.value);
	theForm.password.value = RTrim(theForm.password.value);
	if (!emptystring(theForm.password.value))
		 {
			alert("Please enter the Password");
			theForm.password.focus();
			flag=false;
			return (false);
		}
	 
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form9_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
  
	   else {

           var checkOk = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .";
			if (!(validate(theForm.name.value,checkOk)))
				{ 
				alert("Please enter the Name properly");
				theForm.name.focus();
				flag=false;
				return (false);
				}
		}
	//Message
	theForm.message.value = LTrim(theForm.message.value);
	theForm.message.value = RTrim(theForm.message.value);
	if (!emptystring(theForm.message.value))
		 {
			alert("Please enter the Message");
			theForm.message.focus();
			flag=false;
			return (false);
		}
	//Email
	theForm.email.value = LTrim(theForm.email.value);
	theForm.email.value = RTrim(theForm.email.value);
	if (!emptystring(theForm.email.value))
		 {
			alert("Please enter the E-mail");
			theForm.email.focus();
			flag=false;
			return (false);
		}
		
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form10_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
  
	   else {

           var checkOk = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .";
			if (!(validate(theForm.name.value,checkOk)))
				{ 
				alert("Please enter the Name properly");
				theForm.name.focus();
				flag=false;
				return (false);
				}
		}
	//Address1
	theForm.Address1.value = LTrim(theForm.Address1.value);
	theForm.Address1.value = RTrim(theForm.Address1.value);
	if (!emptystring(theForm.Address1.value))
		 {
			alert("Please enter the Address1");
			theForm.Address1.focus();
			flag=false;
			return (false);
		}
		
	//Email
	theForm.Email.value = LTrim(theForm.Email.value);
	theForm.Email.value = RTrim(theForm.Email.value);
	if (!emptystring(theForm.Email.value))
		 {
			alert("Please enter the E-mail");
			theForm.Email.focus();
			flag=false;
			return (false);
		}
	//Message
	theForm.Comments.value = LTrim(theForm.Comments.value);
	theForm.Comments.value = RTrim(theForm.Comments.value);
	if (!emptystring(theForm.Comments.value))
		 {
			alert("Please enter the Comments");
			theForm.Comments.focus();
			flag=false;
			return (false);
		}
		
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form11_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	//User Name
	theForm.userName.value = LTrim(theForm.userName.value);
	theForm.userName.value = RTrim(theForm.userName.value);
	if (!emptystring(theForm.userName.value))
		 {
			alert("Please enter the User Name");
			theForm.userName.focus();
			flag=false;
			return (false);
		}
  
	//Password
	theForm.password.value = LTrim(theForm.password.value);
	theForm.password.value = RTrim(theForm.password.value);
	if (!emptystring(theForm.password.value))
		 {
			alert("Please enter the Password");
			theForm.password.focus();
			flag=false;
			return (false);
		}
	 
	//Set this return value to true when you want to submit the form
	return (flag);
}
//Document validation
function Form12_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	//User Name
	theForm.textdocumentName1.value = LTrim(theForm.textdocumentName1.value);
	theForm.textdocumentName2.value = LTrim(theForm.textdocumentName2.value);
	theForm.textdocumentName3.value = LTrim(theForm.textdocumentName3.value);
	theForm.textdocumentName4.value = LTrim(theForm.textdocumentName4.value);
	theForm.textdocumentName5.value = LTrim(theForm.textdocumentName5.value);
	theForm.textdocumentName6.value = LTrim(theForm.textdocumentName6.value);
	theForm.textdocumentName7.value = LTrim(theForm.textdocumentName7.value);
	theForm.textdocumentName8.value = LTrim(theForm.textdocumentName8.value);
	theForm.textdocumentName9.value = LTrim(theForm.textdocumentName9.value);
	theForm.textdocumentName10.value = LTrim(theForm.textdocumentName10.value);
	theForm.textdocumentName11.value = LTrim(theForm.textdocumentName11.value);
	theForm.textdocumentName12.value = LTrim(theForm.textdocumentName12.value);
	theForm.textdocumentName13.value = LTrim(theForm.textdocumentName13.value);
	theForm.textdocumentName14.value = LTrim(theForm.textdocumentName14.value);
	theForm.textdocumentName15.value = LTrim(theForm.textdocumentName15.value);
	theForm.textdocumentName1.value = RTrim(theForm.textdocumentName1.value);
	theForm.textdocumentName2.value = RTrim(theForm.textdocumentName2.value);
	theForm.textdocumentName3.value = RTrim(theForm.textdocumentName3.value);
	theForm.textdocumentName4.value = RTrim(theForm.textdocumentName4.value);
	theForm.textdocumentName5.value = RTrim(theForm.textdocumentName5.value);
	theForm.textdocumentName6.value = RTrim(theForm.textdocumentName6.value);
	theForm.textdocumentName7.value = RTrim(theForm.textdocumentName7.value);
	theForm.textdocumentName8.value = RTrim(theForm.textdocumentName8.value);
	theForm.textdocumentName9.value = RTrim(theForm.textdocumentName9.value);
	theForm.textdocumentName10.value = RTrim(theForm.textdocumentName10.value);
	theForm.textdocumentName11.value = RTrim(theForm.textdocumentName11.value);
	theForm.textdocumentName12.value = RTrim(theForm.textdocumentName12.value);
	theForm.textdocumentName13.value = RTrim(theForm.textdocumentName13.value);
	theForm.textdocumentName14.value = RTrim(theForm.textdocumentName14.value);
	theForm.textdocumentName15.value = RTrim(theForm.textdocumentName15.value);

	 if ((!emptystring(theForm.textdocumentName1.value)) && (!emptystring(theForm.textdocumentName2.value)) && (!emptystring(theForm.textdocumentName3.value)) && (!emptystring(theForm.textdocumentName4.value)) && (!emptystring(theForm.textdocumentName5.value))
		&& (!emptystring(theForm.textdocumentName6.value)) && (!emptystring(theForm.textdocumentName7.value)) && (!emptystring(theForm.textdocumentName8.value)) && (!emptystring(theForm.textdocumentName9.value))
			&& (!emptystring(theForm.textdocumentName10.value)) && (!emptystring(theForm.textdocumentName11.value)) && (!emptystring(theForm.textdocumentName12.value)) && (!emptystring(theForm.textdocumentName13.value))
				&& (!emptystring(theForm.textdocumentName14.value)) && (!emptystring(theForm.textdocumentName15.value)))
	 { 
	 		alert("Please Upload the document");
			theForm.textdocumentName1.focus();
			flag=false;
			return (false);
	}			
	 
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form13_Validator(theForm) {
function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
		
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
		
	//email
	 
	theForm.eMail.value = LTrim(theForm.eMail.value);
	theForm.eMail.value = RTrim(theForm.eMail.value);
	if (!emptystring(theForm.eMail.value))
		 {
			alert("Please enter Email Address");
			theForm.eMail.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form14_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 //Old Password
	theForm.oldPassword.value = LTrim(theForm.oldPassword.value);
	theForm.oldPassword.value = RTrim(theForm.oldPassword.value);
	if (!emptystring(theForm.oldPassword.value))
		 {
			alert("Please enter the Current Password");
			theForm.oldPassword.focus();
			flag=false;
			return (false);
		}
	
	//New Password
	theForm.newPassword.value = LTrim(theForm.newPassword.value);
	theForm.newPassword.value = RTrim(theForm.newPassword.value);
	if (!emptystring(theForm.newPassword.value))
		 {
			alert("Please enter the New Password");
			theForm.newPassword.focus();
			flag=false;
			return (false);
		}
	//Confirm Password
	theForm.confirmPassword.value = LTrim(theForm.confirmPassword.value);
	theForm.confirmPassword.value = RTrim(theForm.confirmPassword.value);
	if (!emptystring(theForm.confirmPassword.value))
		 {
			alert("Please enter the Confirm Password");
			theForm.confirmPassword.focus();
			flag=false;
			return (false);
		}
		
	
	//Compare password
	theForm.newPassword.value = LTrim(theForm.newPassword.value);
	theForm.newPassword.value = RTrim(theForm.newPassword.value);
	theForm.confirmPassword.value = LTrim(theForm.confirmPassword.value);
	theForm.confirmPassword.value = RTrim(theForm.confirmPassword.value);

	if (theForm.newPassword.value != theForm.confirmPassword.value)
		 {
			alert("Password mismatching....");
			theForm.newPassword.value="";
			theForm.confirmPassword.value="";
			theForm.newPassword.focus();
			flag=false;
			return (false);
		}
	
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form15_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
	//Email
	theForm.eMail.value = LTrim(theForm.eMail.value);
	theForm.eMail.value = RTrim(theForm.eMail.value);
	if (!emptystring(theForm.eMail.value))
		 {
			alert("Please enter the Email Address");
			theForm.eMail.focus();
			flag=false;
			return (false);
		}
	//Feedback
	theForm.feedBack.value = LTrim(theForm.feedBack.value);
	theForm.feedBack.value = RTrim(theForm.feedBack.value);
	if (!emptystring(theForm.feedBack.value))
		 {
			alert("Please enter the FeedBack");
			theForm.feedBack.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form16_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
	//Email
	theForm.eMail.value = LTrim(theForm.eMail.value);
	theForm.eMail.value = RTrim(theForm.eMail.value);
	if (!emptystring(theForm.eMail.value))
		 {
			alert("Please enter the Email Address");
			theForm.eMail.focus();
			flag=false;
			return (false);
		}
	//Comments
	theForm.comments.value = LTrim(theForm.comments.value);
	theForm.comments.value = RTrim(theForm.comments.value);
	if (!emptystring(theForm.comments.value))
		 {
			alert("Please enter the Comments");
			theForm.comments.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form14_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 //Old Password
	theForm.oldPassword.value = LTrim(theForm.oldPassword.value);
	theForm.oldPassword.value = RTrim(theForm.oldPassword.value);
	if (!emptystring(theForm.oldPassword.value))
		 {
			alert("Please enter the Current Password");
			theForm.oldPassword.focus();
			flag=false;
			return (false);
		}
	
	//New Password
	theForm.newPassword.value = LTrim(theForm.newPassword.value);
	theForm.newPassword.value = RTrim(theForm.newPassword.value);
	if (!emptystring(theForm.newPassword.value))
		 {
			alert("Please enter the New Password");
			theForm.newPassword.focus();
			flag=false;
			return (false);
		}
	//Confirm Password
	theForm.confirmPassword.value = LTrim(theForm.confirmPassword.value);
	theForm.confirmPassword.value = RTrim(theForm.confirmPassword.value);
	if (!emptystring(theForm.confirmPassword.value))
		 {
			alert("Please enter the Confirm Password");
			theForm.confirmPassword.focus();
			flag=false;
			return (false);
		}
		
	
	//Compare password
	theForm.newPassword.value = LTrim(theForm.newPassword.value);
	theForm.newPassword.value = RTrim(theForm.newPassword.value);
	theForm.confirmPassword.value = LTrim(theForm.confirmPassword.value);
	theForm.confirmPassword.value = RTrim(theForm.confirmPassword.value);

	if (theForm.newPassword.value != theForm.confirmPassword.value)
		 {
			alert("Password mismatching....");
			theForm.newPassword.value="";
			theForm.confirmPassword.value="";
			theForm.newPassword.focus();
			flag=false;
			return (false);
		}
	
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form15_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
	//Email
	theForm.eMail.value = LTrim(theForm.eMail.value);
	theForm.eMail.value = RTrim(theForm.eMail.value);
	if (!emptystring(theForm.eMail.value))
		 {
			alert("Please enter the Email Address");
			theForm.eMail.focus();
			flag=false;
			return (false);
		}
	//Feedback
	theForm.feedBack.value = LTrim(theForm.feedBack.value);
	theForm.feedBack.value = RTrim(theForm.feedBack.value);
	if (!emptystring(theForm.feedBack.value))
		 {
			alert("Please enter the FeedBack");
			theForm.feedBack.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}
function Form17_Validator(theForm)
	{
	//Validate Function 
	function validate(value,checkOk)
	{
	var checkStr = 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) {
		return (false);
	  }
	else { return (true); }
  }

		//Trim script
		function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
		}

		function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
		STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
		}

		function LTrim(STRING){
		while(STRING.charAt(0)==" "){
		STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
		}
	 // emptycheck
	 var flag=true;
	 function emptystring(value)
	 {
	   if (value=="") return (false);
	   else return(true);
	 }
	 
	
	//Name
	theForm.name.value = LTrim(theForm.name.value);
	theForm.name.value = RTrim(theForm.name.value);
	if (!emptystring(theForm.name.value))
		 {
			alert("Please enter the Name");
			theForm.name.focus();
			flag=false;
			return (false);
		}
	//Email
	theForm.eMail.value = LTrim(theForm.eMail.value);
	theForm.eMail.value = RTrim(theForm.eMail.value);
	if (!emptystring(theForm.eMail.value))
		 {
			alert("Please enter the Email Address");
			theForm.eMail.focus();
			flag=false;
			return (false);
		}
	//Set this return value to true when you want to submit the form
	return (flag);
}


