<!--
if (self!=top)  {
  alert("Framing of this site is not permitted.");
  parent.top.document.location.href="http://www.boatpix.com";
}
var message="Copyright © BOATPIX.com, Inc. 1994 - 2006. All rights reserved.";
if (document.layers) {
		document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
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) {
  SearchOn = new Image();
  SearchOn.src = "/images/searchon.gif";
  SearchOff = new Image();
  SearchOff.src = "/images/searchoff.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(e)
{
  if(document.all)  {
    ppcXC = window.event.offsetX;
    ppcYC = window.event.offsetY;
    if (event.button == 2) {
      alert(message);
      return false;}}
  if(document.layers)  {
    ppcXC = e.x;
    ppcYC = e.y;
    if (e.which == 3) {
      alert(message);
      return false;}}
}
function swSelectEvent(OP, EID) {
  document.cForm.OP.value=OP;
  document.cForm.EID.value=EID;
  document.cForm.submit();
}
function swClickSearch(OP) {
  var missinginfo = "";
  var sp = /^\s+|\s+$/;
  var wc = /[.?\*.?]+/;
  var us = /([a-zA-Z0-9]{3,}\*)|(\*[a-zA-Z0-9]{3,})/;
  var rs = document.bForm.tVesselId.value;
  var ss = rs.replace(sp, '');
  if(ss.length==0)
    missinginfo += "\n     -  Invalid search string.";
  if(wc.test(ss)) {
    if(!us.test(ss))
      missinginfo += "\n     -  Wildcard requires at least 3 leading characters";
  }
  if(missinginfo != "") {
    missinginfo ="_______________________________________\n" +
    "          You failed to correctly provide your:\n" +
    missinginfo + "\n_______________________________________" +
    "\n          Please re-enter and submit again!";
    alert(missinginfo);
    return;
  }
  document.bForm.OP.value=OP;
  document.bForm.SS.value=document.bForm.tVesselId.value;
  document.bForm.submit();
}
function submitenter(OP,e) {
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;
  if(keycode == 13) {
    var missinginfo = "";
    var sp = /^\s+|\s+$/;
    var wc = /[.?\*.?]+/;
    var us = /([a-zA-Z0-9]{3,}\*)|(\*[a-zA-Z0-9]{3,})/;
    var rs = document.bForm.tVesselId.value;
    var ss = rs.replace(sp, '');
    if(ss.length==0)
      missinginfo += "\n     -  Invalid search string.";
    if(wc.test(ss)) {
      if(!us.test(ss))
        missinginfo += "\n     -  Wildcard requires at least 3 leading characters";
    }
    if(missinginfo != "") {
      missinginfo ="_______________________________________\n" +
      "          You failed to correctly provide your:\n" +
      missinginfo + "\n_______________________________________" +
      "\n          Please re-enter and submit again!";
      alert(missinginfo);
      return false;
    }
    document.bForm.OP.value=OP;
    document.bForm.SS.value=document.bForm.tVesselId.value;
    document.bForm.submit();
    return false;
  } else return true;
}
function swViewFavorites(OP,GID){
  document.vForm.OP.value=OP;
  document.vForm.GID.value=GID;
  document.vForm.submit();
}
function swViewCart(OP,CID){
  document.yForm.OP.value=OP;
  document.yForm.CID.value=CID;
  document.yForm.submit();
}
function swCheckOut(OP,CID){
  document.zForm.OP.value=OP;
  document.zForm.CID.value=CID;
  document.zForm.submit();
}
function swClickSubmit(OP,RID) {
  var alphaOK="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var checkOK = "0123456789.-() ";
  var numOK = "0123456789";
  var emailOK = "abcdefghijklmnopqrstuvwxyz0123456789.@-_";
  var dateOK = "0123456789/";
  var tnum = "";
  var cnum = "";
  isValid = true;
  var tnum,i;

  var Phone1 = document.sForm.tPhone1.value;
  var Phone2 = document.sForm.tPhone2.value;
  document.sForm.hPhone1.value = "";
  document.sForm.hPhone2.value = "";
	var BoatLength = document.sForm.tBoatLength.value;;
	var BoatYear = document.sForm.tBoatYear.value;

  var missinginfo = "";
  var esr = /^[a-zA-Z]{2}\s*-*\d{1,}/;
  var esp = /^\s+|\s+$/;
//  var edc = /((^(0?[1-9]{1})|(1[0-2]{1}))[- \/\\\.]{1}){1}(((0?[1-9]{1})|([1-2]{1}[0-9]{1})|(3{1}[0-1]{1})){1}[- \/\\\.]{1}){1}((((199){1}[0-9]{1}$)|((200){1}[0-9]{1}))$){1}/;
  var edc = /((^(0?[1-9]{1})|(1[0-2]{1}))[- \/\\\.]{1}){1}(((0?[1-9]{1})|([1-2]{1}[0-9]{1})|(3{1}[0-1]{1})){1}[- \/\\\.]{1}){1}((((199){1}[0-9]{1}$)|((20){1}[0-1]{1}[0-9]{1}))$){1}/;


//  var rs = document.sForm.tPhotoDate.value;
  var ss = document.sForm.tPhotoDate.value.replace(esp, '');
  if(!edc.test(ss)) {
    missinginfo += "\n     -  Invalid or Missing Date of Photo.";
    missinginfo += "\n        -Valid Form: MM/DD/YYYY";
    alert(missinginfo);
    document.sForm.tPhotoDate.focus();
    return;
  }
  if(document.sForm.tPhotoLocation.value == "")
    missinginfo += "\n     -  Photo Location";
  var vn = document.sForm.tVesselName.value.replace(esp,'');
  var hp = document.sForm.tHailingPort.value.replace(esp,'');
  var sr = document.sForm.tStateRegistration.value.replace(esp,'');
  var sn = document.sForm.tSailNumber.value.replace(esp,'');
  if(!document.sForm.lRegistrationType.selectedIndex) {
    missinginfo += "\n     -  Registration Type:";
    missinginfo += "\n        -How is Your Boat Registered?";
    alert(missinginfo);
    document.sForm.lRegistrationType.focus();
    return;
  }
  if(document.sForm.lRegistrationType.selectedIndex == 1){
    if(vn.length == 0) {
      missinginfo += "\n     -  For USCG Documented Vessels:";
      missinginfo += "\n        -We can NOT process your request without:";
      missinginfo += "\n        -Your Vessel\'s Name and Hailing Port";
      alert(missinginfo);
      document.sForm.tVesselName.focus();
      return;
    }
    if(hp.length == 0) {
      missinginfo += "\n     -  For USCG Documented Vessels:";
      missinginfo += "\n        -We can NOT process your request without:";
      missinginfo += "\n        -Your Vessel\'s Name and Hailing Port";
      alert(missinginfo);
      document.sForm.tHailingPort.focus();
      return;
    }
  }
  if(document.sForm.lRegistrationType.selectedIndex == 2){
    if(sr.length == 0) {
      missinginfo += "\n     -  For Boats with a State Registration Number:";
      missinginfo += "\n        -We can NOT process your request without:";
      missinginfo += "\n        -Your boat\'s State Registration Number";
      alert(missinginfo);
      document.sForm.tStateRegistration.focus();
      return;
    } else {
        if(!esr.test(sr)) {
          missinginfo += "\n     -  For Boats with a State Registration Number:";
          missinginfo += "\n     -  Your State Registration Appears to be Invalid.";
          missinginfo += "\n        -We can NOT process your request without:";
          missinginfo += "\n        -A VALID State Registration Number";
          alert(missinginfo);
          document.sForm.tStateRegistration.focus();
          return;
        }
      }
  }
  if(BoatLength.length == 0)
    missinginfo += "\n   -  Boat Length in Feet";
	else {
	for(i=0; i < BoatLength.length; i++)
	{
		ch = BoatLength.charAt(i);
		for(j=0; j < numOK.length; j++)
			if(ch == numOK.charAt(j))
				break;
			if(j == numOK.length) {
				missinginfo += "\n   -  Invalid Boat Length - Numbers Only";
				alert(missinginfo);
				document.sForm.tBoatLength.focus();
				return;
			}
	}
	}
  if(BoatYear.length == 0)
    missinginfo += "\n   -  Boat Year (YYYY)";
	else
  if(BoatYear.length != 4) {
    missinginfo += "\n   -  Invalid Boat Year (YYYY)";
		alert(missinginfo);
		document.sForm.tBoatYear.focus();
		return;
	}
	else
	{
	for(i=0; i < BoatYear.length; i++)
	{
		ch = BoatYear.charAt(i);
		for(j=0; j < numOK.length; j++)
			if(ch == numOK.charAt(j))
				break;
			if(j == numOK.length) {
				missinginfo += "\n   -  Invalid Boat Year (YYYY)";
				alert(missinginfo);
				document.sForm.tBoatYear.focus();
				return;
			}
	}
	}


  var ExpNotAlpha = /[^a-zA-Z]/g;
  var fn = document.sForm.tContactFirstName.value.replace(ExpNotAlpha,'');
  var ln = document.sForm.tContactLastName.value.replace(ExpNotAlpha,'');
  if(fn.length == 0)
    missinginfo += "\n   -  Contact First Name is Missing or Invalid";
  if(ln.length == 0)
    missinginfo += "\n   -  Contact Last Name is Missing or Invalid";

  if(Phone1 == "" && Phone2 == "")
    missinginfo += "\n   -  Day or Evening Phone Number";
  if(Phone1.length > 0)  {
    tnum="";
    for(i=0; i < Phone1.length; i++)  {
      ch = Phone1.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<Phone1.length; i++) {
        ch=Phone1.charAt(i);
        for(j=0; j<numOK.length; j++)
          if(ch==numOK.charAt(j)) {
            tnum += Phone1.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.sForm.hPhone1.value=tnum.substring(0,3) +"."+ tnum.substring(3,6) +"."+ tnum.substring(6,10);
          else
            if(tnum.length == 11)
              document.sForm.hPhone1.value = tnum.substring(0,2)+"."+tnum.substring(2,4)+"."+tnum.substring(4,7)+"."+tnum.substring(7,11);
            else
              if(tnum.length == 12)
                document.sForm.hPhone1.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(Phone2.length > 0)  {
    tnum="";
    for(i=0; i < Phone2.length; i++)  {
      ch = Phone2.charAt(i);
      for(j=0; j<checkOK.length; j++)
        if(ch==checkOK.charAt(j))
          break;
      if(j==checkOK.length) {
        missinginfo += "\n   -  Invalid Evening Phone Number";
        isValid=false;
        break;
      }
    }
    if(isValid==true) {
      for(i=0; i<Phone2.length; i++) {
        ch=Phone2.charAt(i);
        for(j=0; j<numOK.length; j++)
          if(ch==numOK.charAt(j)) {
            tnum += Phone2.charAt(i);
            break;
          }
      }
      if(tnum.length < 7)
        missinginfo += "\n   -  Invalid Evening Phone Number";
      else
        if(tnum.length == 7 )
          missinginfo += "\n   -  Evening Phone Missing Area Code";
        else
          if(tnum.length == 10 )
            document.sForm.hPhone2.value=tnum.substring(0,3) +"."+ tnum.substring(3,6) +"."+ tnum.substring(6,10);
          else
            if(tnum.length == 11)
              document.sForm.hPhone2.value = tnum.substring(0,2)+"."+tnum.substring(2,4)+"."+tnum.substring(4,7)+"."+tnum.substring(7,11);
            else
              if(tnum.length == 12)
                document.sForm.hPhone2.value = tnum.substring(0,2)+"."+tnum.substring(2,5)+"."+tnum.substring(5,8)+"."+tnum.substring(8,12);
              else
                missinginfo += "\n   -  Invalid Evening Phone Number";
    }
  }
  var tmail=document.sForm.teMail.value.toLowerCase();
  if(tmail == "") {
    missinginfo += "\n   -  eMail address";
    missinginfo += "\n      -FORM: user@home.com";
  }
  else  {
    if((tmail.length < 5) || (tmail.indexOf('@') == -1) || (tmail.indexOf('.') == -1)) {
      missinginfo += "\n   -  Invalid eMail address";
      missinginfo += "\n      -FORM: user@home.com";
    }
    else
      if(tmail.indexOf('@') != tmail.lastIndexOf('@')) {
        missinginfo += "\n   -  Invalid eMail address";
        missinginfo += "\n      -FORM: user@home.com";
      }
      else  {
//        tmail.toLowerCase();
        for(i=0; i<tmail.length; i++) {
          ch=tmail.charAt(i);
          for(j=0; j<emailOK.length; j++)
            if(ch==emailOK.charAt(j))
            break;
          if(j==emailOK.length)  {
            missinginfo += "\n   -  Invalid character in eMail address";
            missinginfo += "\n      -FORM: user@home.com";
            break;
          }
        }
      }
  }
  var cmail=document.sForm.ceMail.value.toLowerCase();
  if(cmail == "") {
    missinginfo += "\n   -  eMail address";
    missinginfo += "\n      -FORM: user@home.com";
  }
  else  {
    if((cmail.length < 5) || (cmail.indexOf('@') == -1) || (cmail.indexOf('.') == -1)) {
      missinginfo += "\n   -  Invalid eMail address";
      missinginfo += "\n      -FORM: user@home.com";
    }
    else
      if(cmail.indexOf('@') != cmail.lastIndexOf('@')) {
        missinginfo += "\n   -  Invalid eMail address";
        missinginfo += "\n      -FORM: user@home.com";
      }
      else  {
//        tmail.toLowerCase();
        for(i=0; i<cmail.length; i++) {
          ch=cmail.charAt(i);
          for(j=0; j<emailOK.length; j++)
            if(ch==emailOK.charAt(j))
            break;
          if(j==emailOK.length)  {
            missinginfo += "\n   -  Invalid character in eMail address";
            missinginfo += "\n      -FORM: user@home.com";
            break;
          }
        }
      }
  }
  if(tmail != cmail)  {
     missinginfo += "\n   -  Please check your eMail address";
     missinginfo += "\n      -Customer eMail failed confirmed";
   }


  if(document.sForm.tAddress1.value=="")
    missinginfo += "\n   -  Shipping Address";
  if(document.sForm.tCity.value=="")
    missinginfo += "\n   -  City Name";
  if(document.sForm.tCountry.value=="")
    missinginfo += "\n     -  Country";
  else
  {
    var CountryCode=document.sForm.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.sForm.lStates.selectedIndex)
          missinginfo += "\n     -  State";
    }
  }
  var tComments=document.sForm.taComments.value;
  if(tComments.length>250)  {
    missinginfo += "\n   -  Comments must be 250 characters or less.";
  }
  if (missinginfo != "") {
    missinginfo ="_______________________________________\n" +
    "          You failed to correctly provide your:\n" +
    missinginfo + "\n_______________________________________" +
    "\n          Please re-enter and submit again!";
    alert(missinginfo);
    return;
  }
  document.sForm.OP.value=OP;
  document.sForm.RID.value=RID;
  document.sForm.submit();
}

function swShowTos() {
  var win1 = window.open("http://www.boatpix.com/general/tos.html#terms", "TermsOfService", "status=no,toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=720,height=600,top=30,left=30");
  win1.opener = self;
//  win1.opener = window;
}
function swShowCopyright() {
  var win1 = window.open("http://www.boatpix.com//general/tos.html#copyright", "CopyrightNotice", "status=no,toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=720,height=600,top=30,left=30");
  win1.opener = self;
//  win1.opener = window;
}
//-->
