/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: wsabstract.com | http://www.wsabstract.com */
function checkrequired(which) {
  var pass=true;
  for (i=0;i<which.length;i++) {
    var tempobj=which.elements[i];
    if (tempobj.id.substring(0,8)=="required") {
      if (((tempobj.type=="text"||tempobj.type=="textarea")&&
          tempobj.value=='' || tempobj.value== null ||  /^\s+$/.test(tempobj.value) )||(tempobj.type.toString().charAt(0)=="s"&&
          tempobj.selectedIndex==0)) {
        pass=false;
        break;
      }
    }
  }
  if (!pass) {
    shortFieldName=tempobj.id.substring(9,30).toUpperCase();
    alert("[Informacion]   El campo: "+shortFieldName+" es obligatorio.");
    return false;
	
	
	
  } else {
  return true;
  }
}


function Validate_Email_Address(email_address)
	{
		//Assumes that valid email addresses consist of user_name@domain.tld
		at = email_address.indexOf('@');
		dot = email_address.indexOf('.');
        
		if(at == -1 || dot == -1 || dot <= at + 1 || dot == 0 || dot == email_address.length - 1)
			return(false);
           
		user_name = email_address.substr(0, at);
		domain_name = email_address.substr(at + 1, email_address.length);                  
        
		if(Validate_String(user_name) === false || Validate_String(domain_name) === false)
			return(false);                     
        
		return(true);
	}

