<!--
if(self!=top)  {
  alert("Framing of this site is not permitted.");
  parent.top.document.location.href="http://www.boatingevents.com";
}
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if((browserName == "Netscape" && browserVer >= 4) || (browserName == "Microsoft Internet Explorer" && browserVer >= 4))
  version = 4;
else
  if((browserName == "Netscape" && browserVer >= 3) || (browserName == "Microsoft Internet Explorer" && browserVer >= 3))
    version = 3;
  else version = 2;
if (version >= 3) {
  iXLogoOn = new Image();
  iXLogoOn.src = "/images/ixlogoon.gif";
  iXLogoOff = new Image();
  iXLogoOff.src = "/images/ixlogooff.gif";
  CharCountOff = new Image();
  CharCountOff.src = "/images/charcountoff.gif";
  CharCountOn = new Image();
  CharCountOn.src = "/images/charcounton.gif";
  ViewOff = new Image();
  ViewOff.src = "/images/viewoff.gif";
  ViewOn = new Image();
  ViewOn.src = "/images/viewon.gif";
  CancelOff = new Image();
  CancelOff.src = "/images/canceloff.gif";
  CancelOn = new Image();
  CancelOn.src = "/images/cancelon.gif";
}
function ImgOn(imgName,imgSrc) {
if (version >= 3) {
    document.images[imgName].src=eval(imgSrc+".src");
  }
}
function ImgOff(imgName,imgSrc) {
if (version >= 3) {
    document.images[imgName].src=eval(imgSrc+".src");
  }
}
function click(){
  if(event.button==2)
    alert("Disabled");
}document.onmousedown=click// --]
function swJump(Loc) {
  document.location=Loc;
}

function CharCount(sString) {
  var charString=sString.value;
  alert(charString.length + " Characters.");
  sString.focus()
  }
function swCancel(Loc) {
  if(confirm("Confirm Cancel. . ."))
    document.location=Loc;
  return;
  }

function PreValidate(OP,ID) {
  var checkOK = "0123456789.-() ";
  var numOK = "0123456789";
  var alphaOK="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var tnum = "";
  var cnum = "";
  var missinginfo = "";
  isValid = true;
  var tnum;
  if(document.eForm.lCategories.selectedIndex==0)
    missinginfo += "\n     -  Event Category";
  if(document.eForm.tEventName.value=="")
    missinginfo += "\n     -  Event Name";
  if(document.eForm.tStartDate.value=="")
    missinginfo += "\n     -  Start Date ofEvent";
  if(document.eForm.tCity.value=="")
    missinginfo += "\n     -  City Name";
  if(document.eForm.tCountry.value=="")
    missinginfo += "\n     -  Country";
  else
  {
    var CountryCode=document.eForm.tCountry.value.toUpperCase();
    if(CountryCode.length<2)
      missinginfo += "\n     -  Invalid Country";
    else
    {
      isValid=true;
      for(i=0; i < CountryCode.length; i++)
      {
        ch = CountryCode.charAt(i);
        for(j=0;j<alphaOK.length; j++)
          if(ch==alphaOK.charAt(j))
            break;
        if(j == alphaOK.length) {
          missinginfo += "\n     -  Invalid Country Code";
          isValid=false;
        break;
        }
      }
     if(isValid==true)
      if(CountryCode=="US" || CountryCode=="USA")
        if(!document.eForm.lStates.selectedIndex)
          missinginfo += "\n     -  State (US Only)";
    }
  }
  var Phone = document.eForm.tPhone.value;
  var FAX = document.eForm.tFAX.value;
  document.eForm.hPhone.value = "";
  document.eForm.hFAX.value = "";
  if(Phone == "")
    missinginfo += "\n     -  Contact Phone Number";

  if(Phone.length > 0)  {
    tnum="";
    for(i=0; i < Phone.length; i++)  {
      ch = Phone.charAt(i);
      for(j=0; j<checkOK.length; j++)
        if(ch==checkOK.charAt(j))
          break;
      if(j==checkOK.length) {
        missinginfo += "\n     -  Invalid Day Phone Number";
        isValid=false;
        break;
      }
    }
    if(isValid==true) {
      for(i=0; i<Phone.length; i++) {
        ch=Phone.charAt(i);
        for(j=0; j<numOK.length; j++)
          if(ch==numOK.charAt(j)) {
            tnum += Phone.charAt(i);
            break;
          }
      }
      if(tnum.length < 7)
        missinginfo += "\n     -  Invalid Day Phone Number";
      else
        if(tnum.length == 7 )
          missinginfo += "\n     -  Day Phone Missing Area Code";
        else
          if(tnum.length == 10 )
            document.eForm.hPhone.value=tnum.substring(0,3) +"."+ tnum.substring(3,6) +"."+ tnum.substring(6,10);
          else
            if(tnum.length == 11)
              document.eForm.hPhone.value = tnum.substring(0,2)+"."+tnum.substring(2,4)+"."+tnum.substring(4,7)+"."+tnum.substring(7,11);
            else
              if(tnum.length == 12)
                document.eForm.hPhone.value = tnum.substring(0,2)+"."+tnum.substring(2,5)+"."+tnum.substring(5,8)+"."+tnum.substring(8,12);
              else
                missinginfo += "\n     -  Invalid Day Phone Number";
    }
  }

  if(FAX.length > 0)  {
    tnum="";
    for(i=0; i < FAX.length; i++)  {
      ch = FAX.charAt(i);
      for(j=0; j<checkOK.length; j++)
        if(ch==checkOK.charAt(j))
          break;
      if(j==checkOK.length) {
        missinginfo += "\n     -  Invalid FAX Number";
        isValid=false;
        break;
      }
    }
    if(isValid==true) {
      for(i=0; i<FAX.length; i++) {
        ch=FAX.charAt(i);
        for(j=0; j<numOK.length; j++)
          if(ch==numOK.charAt(j)) {
            tnum += FAX.charAt(i);
            break;
          }
      }
      if(tnum.length < 7)
        missinginfo += "\n     -  Invalid FAX Number";
      else
        if(tnum.length == 7 )
          missinginfo += "\n     -  FAX Missing Area Code";
        else
          if(tnum.length == 10 )
            document.eForm.hFAX.value=tnum.substring(0,3) +"."+ tnum.substring(3,6) +"."+ tnum.substring(6,10);
          else
            if(tnum.length == 11)
              document.eForm.hFAX.value = tnum.substring(0,2)+"."+tnum.substring(2,4)+"."+tnum.substring(4,7)+"."+tnum.substring(7,11);
            else
              if(tnum.length == 12)
                document.eForm.hFAX.value = tnum.substring(0,2)+"."+tnum.substring(2,5)+"."+tnum.substring(5,8)+"."+tnum.substring(8,12);
              else
                missinginfo += "\n     -  Invalid FAX Number";
    }
  }

  if(document.eForm.cBoatAccess.checked==true)
    document.eForm.hBoatAccess.value=1;
  else
    document.eForm.hBoatAccess.value=0;
  if(document.eForm.cAutoAccess.checked==true)
    document.eForm.hAutoAccess.value=1;
  else
    document.eForm.hAutoAccess.value=0;
  if(document.eForm.cTaxiAccess.checked==true)
    document.eForm.hTaxiAccess.value=1;
  else
    document.eForm.hTaxiAccess.value=0;
//  if(document.eForm.tFirstName.value == "")
//    missinginfo += "\n     -  Contact First Name";
//  if(document.eForm.tLastName.value == "")
//    missinginfo += "\n     -  Contact Last Name";
  var tmail=document.eForm.teMail.value.toLowerCase();
  if(tmail != "") {
    if((tmail.length < 6) || (tmail.indexOf('@') == -1) || (tmail.indexOf('.') == -1)) {
      missinginfo += "\n     -  Invalid eMail address";
      missinginfo += "\n          -FORM: user@home.com";
    }
  }
  if (missinginfo != "") {
    missinginfo ="_____________________________\n" +
    "You failed to correctly provide your:\n" +
    missinginfo + "\n_____________________________" +
    "\nPlease re-enter and submit again!";
    alert(missinginfo);
    return;
  }
  document.eForm.ID.value=ID;
  document.eForm.OP.value=OP;
  document.eForm.submit();
}
//-->