function ValidateForm(theForm)
{
 var error="";
 var FoundError = false;
 
 for (i = 0;  i < theForm.length;  i++){
 
 //alert('got here');
 	if(theForm[i].value=="" && theForm[i].name.indexOf('RQ_') >= 0 ){
 	error+="Please enter a value for the \"" +theForm[i].name.replace('RQ_', '') + "\" field.\n";
	
 
 	if(FoundError==false)
 	theForm[i].focus();
	
 	FoundError=true;
 	}
 else if(theForm[i].name.toLowerCase()=="rq_email" && ( theForm[i].value.indexOf('@') < 0 || theForm[i].value.indexOf('.') < 0 )){
	error+="Please enter a valid Email Address for the \"" +theForm[i].name.replace('RQ_', '') + "\" field.\n";
 	
	theForm[i].focus();
	FoundError=true;
	}
	
 
}


if(FoundError==false){
 for (i = 0;  i < theForm.length;  i++){
    if( theForm[i].name.indexOf('RQ_') >= 0 )
        theForm[i].name =  theForm[i].name.replace('RQ_', '');
	   }
  }
  
  
  if(FoundError == true){
      alert(error);
  
  return false;
  }
  
 
  theForm.submit();
  return true;
}

function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

