var fieldstocheck = new Array();
    fieldnames = new Array();

function set(tagname, attr, val) {
var e = document.getElementsByTagName(tagname)[0];
e.setAttribute(attr, val);
e = document.getElementsByTagName(tagname)[1];
e.setAttribute(attr, val);
}

function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
      alert("Please enter your "+fieldnames[i]);
      eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
      return false;
    }
  }

  return true;
}


function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

function cleartext(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function resettext(thefield){
if (thefield.value=="")
thefield.value = thefield.defaultValue
}

function nlsubwin()
{
LeftPosition = (screen.width) ? (screen.width-750)/2 : 0;
TopPosition = (screen.height) ? (screen.height-200)/2 : 0;
settings = 'height=200,width=750,top='+TopPosition+',left='+LeftPosition+',scrollbars=no,screenx=0,screeny=0';
window.open('/blank.html','win',settings);
}

function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert("Invalid email address. Please re-enter.")
return (false)
}
