
   function changeSecure()
   {
		   hypertext = "http:";
		   securetext = "https:";
		   loc = window.location.toString();
		   index = loc.indexOf(hypertext);
		   if(index == 0)
		   {
   		   newloc = (securetext + loc.substring(hypertext.length));
   		   window.location = newloc;
         }
   }
   changeSecure();
  
function checkParticipantForm(oForm)
{
   var retVal = true;
   
   if(oForm.txtCompany.value.length == 0)
   {
      alert("Please enter the company name.");
      oForm.txtCompany.focus();
      retVal = false;
   }
   else if(oForm.txtName1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtName1.focus();
      retVal = false;
   }
   
   else if(oForm.Fee_Choice.value.length == 0)
   {
      alert("Please choose one type of fee.");
      oForm.txtName1.focus();
      retVal = false;
   }

   else if(oForm.txtAddress1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtAddress1.focus();
      retVal = false;
   }
   else if(oForm.txtTitle1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtTitle1.focus();
      retVal = false;
   }
   else if(oForm.txtPhone1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtPhone1.focus();
      retVal = false;
   }
   else if(oForm.txtEmail1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtEmail1.focus();
      retVal = false;
   }
   else if(!verifyCard(oForm))
   {
      retVal = false;
   }
   
   return retVal;
}

function checkSponsorForm(oForm)
{
   var retVal = true;
   
   if(oForm.txtCompany.value.length == 0)
   {
      alert("Please enter the company name.");
      oForm.txtCompany.focus();
      retVal = false;
   }
   else if(oForm.txtContact.value.length == 0)
   {
      alert("Please enter a contact name.");
      oForm.txtContact.focus();
      retVal = false;
   }
   else if(oForm.txtContactPosition.value.length == 0)
   {
      alert("Please enter a contact position.");
      oForm.txtContactPosition.focus();
      retVal = false;
   }
   else if(oForm.txtContactEmail.value.length == 0)
   {
      alert("Please enter a contact email.");
      oForm.txtContactEmail.focus();
      retVal = false;
   }
   else if(oForm.txtContactPhone.value.length == 0)
   {
      alert("Please enter a contact phone number.")
      oForm.txtContactPhone.focus();
      retVal = false;
   }
   else if(oForm.txtCompany1.value.length == 0)
   {
      alert("Please enter at least one attendee's contact information.");
      oForm.txtCompany1.focus();
      retVal = false;
   }
   else if(oForm.txtContact1.value.length == 0)
   {
      alert("Please enter at least one attendee's contact information.");
      oForm.txtContact1.focus();
      retVal = false;
   }
   else if(oForm.txtPhone1.value.length == 0)
   {
      alert("Please enter at least one attendee's contact information.");
      oForm.txtPhone1.focus();
      retVal = false;
   }
   else if(oForm.txtEmail1.value.length == 0)
   {
      alert("Please enter at least one attendee's contact information.");
      oForm.txtEmail1.focus();
      retVal = false;
   }
   else if (!verifyCard(oForm))
   {
      retVal = false;
   }
   
   return retVal;
}

function checkBreakfastForm(oForm)
{
   var retVal = true;
   
   if(oForm.txtCompany.value.length == 0)
   {
      alert("Please enter the company name.");
      oForm.txtCompany.focus();
      retVal = false;
   }
   else if(oForm.txtName1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtName1.focus();
      retVal = false;
   }
   else if(oForm.txtAddress1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtAddress1.focus();
      retVal = false;
   }
   else if(oForm.txtTitle1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtTitle1.focus();
      retVal = false;
   }
   else if(oForm.txtPhone1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtPhone1.focus();
      retVal = false;
   }
   else if(oForm.txtEmail1.value.length == 0)
   {
      alert("Please enter at least one participant's contact information.");
      oForm.txtEmail1.focus();
      retVal = false;
   }
   
   return retVal;
}
   
function verifyCard(oForm)
{
   var retVal = true;
   
   if((oForm.txtCardNumber.value.length == 0) || ((oForm.selCardType.value == "AMEX") &&
      (oForm.txtCardNumber.value.length != 15)) || ((oForm.selCardType.value != "AMEX") && 
      (oForm.txtCardNumber.value.length != 16)) || (isNaN(oForm.txtCardNumber.value)))
   {
      alert("Please enter a valid credit card number.");
      oForm.txtCardNumber.focus();
      retVal = false;
   }
   else if(!validDate(oForm.selCardMonth.value, oForm.selCardYear.value))
   {
      alert("Your credit card is expired.");
      oForm.selCardMonth.focus();
      retVal = false;
   }
   else if(oForm.txtCardName.value.length == 0)
   {
      alert("Please enter the name that appears on the credit card.");
      oForm.txtCardName.focus();
      retVal = false;
   }
   else if(oForm.txtCardAddress.value.length == 0)
   {
      alert("Please enter the billing address for the credit card.");
      oForm.txtCardAddress.focus();
      retVal = false;
   }
   else if(oForm.txtCardCity.value.length == 0)
   {
      alert("Please enter the city for the credit card.");
      oForm.txtCardCity.focus();
      retVal = false;
   }
   else if(oForm.txtCardState.value.length == 0)
   {
      alert("Please enter the state for the credit card.");
      oForm.txtCardState.focus();
      retVal = false;
   }
   else if (oForm.txtCardZip.value.length == 0 || isNaN(oForm.txtCardZip.value))
   {
      alert("Please enter a valid zip code for the credit card.");
      oForm.txtCardZip.focus();
      retVal = false;
   }
  
   return retVal;
}

function validDate(month, year)
{
   retVal = true;
   
   var now = new Date();
   if((now.getYear() > year) || ((now.getYear() == year) && (now.getMonth() >= month * 1)))
   {
      retVal = false; 
   }
   
   return retVal;
}