<!--
function blockError(){return true;}
window.onerror = blockError;
// -->

<!-- Form field verify function -->
function verify() 
  {
  var themessage = "Please correct the following before the registration form can be submitted:";
  if (document.registration.courseName.value=="") {
  themessage = themessage  + "  \n\nCourse Name is a required field";
  }
  if (document.registration.courseDate.value=="") {
  themessage = themessage + "  \n\nCourse Date is a required field";
  }
  if (document.registration.courseFee.value=="") {
  themessage = themessage + "  \n\nCourse Fee is a required field";
  }
  if (document.registration.courseLocation.value=="") {
  themessage = themessage + "  \n\nCourse Location is a required field";
  }
  
  
  if (document.registration.courseLocation.value=="Other") {
  if (document.registration.otherLocation.value=="") {
  themessage = themessage + "  \n\nOther Course Location is a required field";
  }
  }
  
  
  if (document.registration.attendeeFirst.value=="") {
  themessage = themessage + "  \n\nAttendee First Name is a required field";
  }
  if (document.registration.attendeeLast.value=="") {
  themessage = themessage + "  \n\nAttendee Last Name is a required field";
  }
  if (document.registration.attendeeTitle.value=="") {
  themessage = themessage + "  \n\nAttendee Title is a required field";
  }
  
  
  if (document.registration.attendeeAddress.value=="") {
  themessage = themessage + "  \n\nAttendee Address is a required field";
  }
  if (document.registration.attendeeCity.value=="") {
  themessage = themessage + "  \n\nAttendee City is a required field";
  }
  if (document.registration.attendeeCompany.value=="") {
  themessage = themessage + "  \n\nAttendee Company is a required field";
  }
  
  
  
  
  
  if (document.registration.attendeeState.value=="") {
  themessage = themessage + "  \n\nAttendee State is a required field";
  }
  if (document.registration.attendeeZip.value=="") {
  themessage = themessage + "  \n\nAttendee Zip is a required field";
  }
  if (document.registration.attendeePhone.value=="") {
  themessage = themessage + "  \n\nAttendee Phone is a required field";
  }
  if (document.registration.attendeeFax.value=="") {
  themessage = themessage + "  \n\nAttendee Fax is a required field";
  }
  
  
  
  if (document.registration.attendeeEmail1.value=="") {
  themessage = themessage + "  \n\nAttendee Primary Email Address is a required field";
  }
  if (document.registration.attendeeEmail2.value=="") {
  themessage = themessage + "  \n\nAttendee Alternate Email Address is a required field";
  }
  
  
  if (document.registration.billingFirst.value=="") {
  themessage = themessage + "  \n\nBilling First Name is a required field";
  }
  if (document.registration.billingLast.value=="") {
  themessage = themessage + "  \n\nBilling Last Name is a required field";
  }
  if (document.registration.billingTitle.value=="") {
  themessage = themessage + "  \n\nBilling Title is a required field";
  }
  
  
  if (document.registration.billingAddress.value=="") {
  themessage = themessage + "  \n\nBilling Address is a required field";
  }
  if (document.registration.billingCity.value=="") {
  themessage = themessage + "  \n\nBilling City is a required field";
  }
  
  
  
  
  
  
  if (document.registration.billingState.value=="") {
  themessage = themessage + "  \n\nBilling State is a required field";
  }
  if (document.registration.billingZip.value=="") {
  themessage = themessage + "  \n\nBilling Zip is a required field";
  }
  if (document.registration.billingPhone.value=="") {
  themessage = themessage + "  \n\nBilling Phone is a required field";
  }
  if (document.registration.billingFax.value=="") {
  themessage = themessage + "  \n\nBilling Fax is a required field";
  }
  
  
  
  if (document.registration.attendeeEmail1.value=="") {
  themessage = themessage + "  \n\nBilling Primary Email Address is a required field";
  }
  if (document.registration.attendeeEmail2.value=="") {
  themessage = themessage + "  \n\nBilling Alternate Email Address is a required field";
  }
  
  
  if (document.registration.paymentAmount.value=="") {
  themessage = themessage + "  \n\nPayment Amount is a required field";
  }
  if (document.registration.paymentMethod.value=="") {
  themessage = themessage + "  \n\nPayment Method is a required field";
  }
  
  
  
  
  //alert if fields are empty and cancel form submit
  if (themessage == "Please correct the following before the registration form can be submitted:") 
  {
  document.registration.submit();
  }
  else 
  {
  alert(themessage);
  return false;
  }
  }


function validate_email(field)
  {
  with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {return false;}
  else {return true;}
  }
  }



function billingSameClick()
  {
  if(document.registration.billingSame.checked)
  {
  document.registration.billingFirst.value = document.registration.attendeeFirst.value;
  document.registration.billingLast.value = document.registration.attendeeLast.value;
  document.registration.billingCompany.value = document.registration.attendeeCompany.value;
  document.registration.billingAddress.value = document.registration.attendeeAddress.value;
  document.registration.billingCity.value = document.registration.attendeeCity.value;
  document.registration.billingState.value = document.registration.attendeeState.value;
  document.registration.billingZip.value = document.registration.attendeeZip.value;
  document.registration.billingCountry.value = document.registration.attendeeCountry.value;
  document.registration.billingPhone.value = document.registration.attendeePhone.value;
  document.registration.billingEmail.value = document.registration.attendeeEmail.value;
  }
  else
  {
  document.registration.billingFirst.value = "";
  document.registration.billingLast.value = "";
  document.registration.billingCompany.value = "";
  document.registration.billingAddress.value = "";
  document.registration.billingCity.value = "";
  document.registration.billingState.value = "";
  document.registration.billingZip.value = "";
  document.registration.billingCountry.value = "";
  document.registration.billingPhone.value = "";
  document.registration.billingEmail.value = "";
  } 
  }
                  
				  
				  
function paymentClick()
  {
  var thediv=document.getElementById('paymentInfo');
  thediv.style.display = "";
  Item = document.registration.paymentMethod.selectedIndex;
  Result = document.registration.paymentMethod.options[Item].text;
  if(Result=='Purchase Order')
  { 
  thediv.innerHTML = "<div class='registration_212'> \
  <span class='form_required'>*</span>Purchase Order Number<input type='text' name='poNumber' size='40'> \
  </div><div class='registration_650'>Please mail the Purchase Order to:  <br>Mallett Technology, Inc., 400 Technology Dr., Suite 200, Canonsburg, PA 15317 <br>or fax it to (724) 746-7001 \
  </div>";
  }
  else
  {
  thediv.innerHTML = "<div class='registration_212'> \
  <span class='form_required'>*</span>Credit Card Number<input type='text' name='ccNumber' size='25'> \
  </div> \
  <div class='registration_120'> \
  <span class='form_required'>*</span>Expiration Date<input type='text' name='expirationDate' size='9'> \
  </div>";
  }
  var newHTML = "";
  document.getElementById('').innerHTML = newHTML;
  }
				  
     
function locationClick()
  {
  var thediv=document.getElementById('classLocation');
  thediv.style.display = "";
  Item = document.registration.courseLocation.selectedIndex;
  Result = document.registration.courseLocation.options[Item].text;
  if(Result=='Other')
  { 
  thediv.innerHTML = "<div class='registration_150'> \
  <span class='form_required'>*</span>Specify Location \
  <input type='text' name='otherLocation' size='24'></div>"; 
  }
  else
  {
  thediv.innerHTML = "";
  }
  var newHTML = "";
  document.getElementById('').innerHTML = newHTML;
  }
  
  
  
  
				  
				  
				  
				  


     
