// JavaScript Document
<!--
function P7_ExpMenu(){ //v1.1.0.2 by PVII-www.projectseven.com
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*p7hvr/,nn='',c,cs='p7hvr',bv='p7menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
function get_https_path()
{
    var path_original = document.location.href;
    var compro;
    compro=path_original.substring(0,5);
    if (compro=='http:')
    {
      path_original = document.location.href;
      path_original=path_original.replace('http://','https://');
      document.location.href=path_original;
      return true;
    }
}

function Check_Fields()
{

var Titulos = new Array(
					  'CLC Reference Number',
                      '',
                      'Name',
                      '',
					  'Date of Birth: Day',
                      'Date of Birth: Month',
                      'Date of Birth: Year',
                      'Passport number',
					  'Nationality',
                      'Date of travel: Day',
                      'Date of travel: Month',
                      'Date of travel: Year');

var ErrMessage='Please fill in the field: \n';
var ErrorFlag=0;
for (t=0;t<Titulos.length;t++)
{
//    alert("objeto:" + document.forms[0].elements[t].name + " valor: " + document.forms[0].elements[t].value + " orden: " + t);
    if (document.yacht[t].name=='email')
    {
        continue;
    }

    if (document.yacht[t].value=='')
    {
       ErrMessage=ErrMessage+Titulos[t]+"\n";
       ErrorFlag=1;
    }
}

email = document.yacht.email.value;
AtPos = email.indexOf("@");
StopPos = email.lastIndexOf(".");
longitud='';
vuelta='';
extension='';

longitud = email.length;

for (count=longitud; count >= 0; count--)

  vuelta+=email.substring(count,count-1);

extension = vuelta.indexOf(".");

if ((longitud == (StopPos+1)) || (extension < 2 || extension >5))
{
     Message = "The email address is not valid. Please check it.";
     alert (Message);
     return false;
}

if (AtPos == -1 || StopPos <= AtPos)
{
     Message = "The email address is not valid. Please check it.";
     alert (Message);
     return false;
}

if (ErrorFlag > 0)
{
    alert (ErrMessage);
}
else
{
    document.yacht.action="process_form.php";
    document.yacht.submit();
}
}


function change()
{

   if (document.yacht.member.value=='Yes')
   {
      document.yacht.clientnumber.disabled=false;
   }
   else
   {
      document.yacht.clientnumber.disabled=true;
   }
}

//-->
