/* *************************************************************
* General purpose form validator                 	           *
***************************************************************/

function valInput(field)
{
  var str = field.value;
  var result = true;

  for(j=0; j<str.length; j++)
	{
      if(str.charAt(j) == "*") 
		{
		 result = false;	              
		}
	}
  
  if (result == true)
  {
	for(j=0; j<str.length; j++)
		{
		  if(str.charAt(j) == "%") 
			{
			 result = false;	              
			}
		} 
  }	
  
 if (result == true)
  {
	for(j=0; j<str.length; j++)
		{
		  if(str.charAt(j) == '"') 
			{
			 result = false;	              
			}
		} 
  }
  
 if (result == true)
  {
	for(j=0; j<str.length; j++)
		{
		  if(str.charAt(j) == '<') 
			{
			 result = false;	              
			}
		} 
  }	

  if (result == true)
  {
	for(j=0; j<str.length; j++)
		{
		  if(str.charAt(j) == '>') 
			{
			 result = false;	              
			}
		} 
  }

  if (result == true)
  {
	for(j=0; j<str.length; j++)
		{
		  if(str.charAt(j) == '=') 
			{
			 result = false;	              
			}
		} 
  }
   
  if (result == false)
  {
	  alert("* or % or < or > or = or \" are invalid characters!");
	  field.focus();
	  field.value="";
  }
  else
  {
	  var x = /'/g
	  field.value = field.value.replace(x,"`"); 	
  }  
}