function feedback_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.uname.value = LTrim(theForm.uname.value);
	theForm.uname.value = RTrim(theForm.uname.value);
	if (!emptystring(theForm.uname.value))
		 {
			alert("Please enter your User Name");
			theForm.uname.focus();
			flag=false;
			return (false);
		}
		
	//password

	theForm.pass.value = LTrim(theForm.pass.value);
	theForm.pass.value = RTrim(theForm.pass.value);
	if (!emptystring(theForm.pass.value))
		 {
			alert("Please enter your password");
			theForm.pass.focus();
			flag=false;
			return (false);
		}
			
//Set this return value to true when you want to submit the form
	
	return (flag);
}

