today=new Date(); // Initialize Date in raw form
date=today.getDate(); // Get the numerical date
year=today.getFullYear(); // Get the year
day = today.getDay(); // Get the day in number form (0,1,2,3,etc.)
month=today.getMonth()+1; // Get the month

// Make day number value correspond to actual day name
var dayName=new Array(7)
dayName[0]="Sunday";
dayName[1]="Monday";
dayName[2]="Tuesday";
dayName[3]="Wednesday";
dayName[4]="Thursday";
dayName[5]="Friday";
dayName[6]="Saturday";

// Add suffix to date (1st, 2nd, 4th, etc.)
if (date==1) suffix=("st");
else if (date==2) suffix=("nd");
else if (date==3) suffix=("rd");
else if (date==21) suffix=("st");
else if (date==22) suffix=("nd");
else if (date==23) suffix=("rd");
else if (date==31) suffix=("st");
else suffix=("th");

// Make month number correspond to month name
if (month==1) monthName=("January");
else if (month==2) monthName=("February");
else if (month==3) monthName=("March");
else if (month==4) monthName=("April");
else if (month==5) monthName=("May");
else if (month==6) monthName=("June");
else if (month==7) monthName=("July");
else if (month==8) monthName=("August");
else if (month==9) monthName=("September");
else if (month==10) monthName=("October");
else if (month==11) monthName=("November");
else monthName=("December");


function abnlive() {
window.open("allabn.htm","window2","width=1024,height=768,status=0,resizable=0,scrollbars=no,toolbar=no,menubar=no,top=100,left=10");
}



var RE_EMAIL = /^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/;
var RE_PASSWORD = /^[A-Za-z\d]{6,20}$/;


function validate(form){
 var email = form.Email.value;
 var password = form.Password.value;
 var errors = [];
  
 if (!RE_EMAIL.test(email)) {
  errors[errors.length] = "You must enter a valid email address.";
 }
 
 if (!RE_PASSWORD.test(password)) {
  errors[errors.length] = "You must enter a valid password.";
 }
 
 if (errors.length > 0) {
  reportErrors(errors);
  return false;
 }
 
 return true;
}

function reportErrors(errors){
 var msg = "There were some problems...\n";
 for (var i = 0; i<errors.length; i++) {
  var numError = i + 1;
  msg += "\n" + numError + ". " + errors[i];
 }
 alert(msg);
}

function validate1(form){
 var email = form.Email.value;
 var txn_id = form.txn_id.value;
 var errors = [];
  
 if (!RE_EMAIL.test(email)) {
  errors[errors.length] = "You must enter a valid email address.";
 }
 
 if (!RE_PASSWORD.test(txn_id)) {
  errors[errors.length] = "You must enter a txn_id from your subscription mail.";
 }
 
 if (errors.length > 0) {
  reportErrors(errors);
  return false;
 }
 
 return true;
}


function validate2(form){
 var oldpassword = form.oldpassword.value;
 var password = form.password.value;

 var password2 = form.password2.value;
 var errors = [];
  
 if (!RE_PASSWORD.test(oldpassword)) {
  errors[errors.length] = "You must enter a old password here.";
 }
 
 if (!RE_PASSWORD.test(password)) {
  errors[errors.length] = "You must enter a valid password here.";
 }
 
  if (!RE_PASSWORD.test(password2)) {
  errors[errors.length] = "You must enter a valid password here.";
 }
 
 if (errors.length > 0) {
  reportErrors(errors);
  return false;
 }
 
 return true;
}
