
function validateEmail( strValue) {
  var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
  //check for valid email
  return objRegExp.test(strValue);
}
function trimAll( strValue ) {
  objRegExp = /^\s+/;
  if(objRegExp.test(strValue)) {
    return strValue.replace(objRegExp, '');
  }
  return strValue;
}
function validateNotEmpty( strValue ) {

   return (trimAll(strValue).length > 0 )
}
function validateValue( strValue) {

var objRegExp = /^[A-Za-z0-9\_\-\.\s]*$/

 //check if string matches pattern
 return objRegExp.test(strValue);
}
function validateNumber( strValue) {
  var objRegExp = /^[0-9\.]*$/
  return objRegExp.test(strValue);
}
function validateUSDate( strValue ) {

    //Ex. mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy

  var objRegExp = /^\d{1,2}(\/)\d{1,2}\1\d{4}$/

  //check to see if in correct format
  if(!objRegExp.test(strValue))
    return false; //doesn't match pattern, bad date
  else{
    var arrayDate = strValue.split(RegExp.$1); //split date into month, day, year
	var intDay = parseInt(arrayDate[1],10);
	var intYear = parseInt(arrayDate[2],10);
    var intMonth = parseInt(arrayDate[0],10);

	//check for valid month
	if(intMonth > 12 || intMonth < 1) {
		return false;
	}

    //create a lookup for months not equal to Feb.
    var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,
                        '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}

    //check if month value and day value agree
    if(arrayLookup[arrayDate[0]] != null) {
      if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0)
        return true; //found in lookup table, good date
    }

    //check for February
	var booLeapYear = (intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0));
    if( ((booLeapYear && intDay <= 29) || (!booLeapYear && intDay <=28)) && intDay !=0)
      return true; //Feb. had valid number of days
  }
  return false; //any other values, bad date
}
function validateSameValue(strVal1,strVal2)
{
  if (strVal1 == strVal2 )
    return true;
  else
    return false
}