// Validata Data
function getYear(d) {
  return (d < 1000) ? d + 1900 : d;
  }

function isDate (year, month, day) {
  // month argument must be in the range 1 - 12
  month = month - 1;  // javascript month range : 0- 11
  if(year < 1900){
     return false
  } else {

     var tempDate = new Date(year,month,day);
     if ( (getYear(tempDate.getYear()) == year) &&
        (month == tempDate.getMonth()) &&
        (day == tempDate.getDate()) )
         return true;
     else
        return false
  }
}


// Validata Email
 function check_email(e) {
    ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

    for(i=0; i < e.length ;i++){
    if(ok.indexOf(e.charAt(i))<0){
    return (false);
    }
    }

    if (document.images) {
    re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
    re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
    if (!e.match(re) && e.match(re_two)) {
    return (-1);
    }
    }
 }
