function mail(what) 
	{
	    what.action = 'mailto:' + document.hiddenForm.emailAddress.value + '@hornblower.com'
	                  '?SUBJECT=' + document.hiddenForm.subjectLine.value;
	}

function newWindow (theUrl,theName,theHeight,theWidth)
		{
    	  window.open(theUrl, theName, "scrollbars=yes,status=no,menubar=yes,resizable=yes,width="+theWidth+",height="+theHeight);
		}
function newformWindow (theUrl,theName,theHeight,theWidth)
		{
    	  window.open(theUrl, theName, "scrollbars=yes,status=no,menubar=yes,resizable=yes,width="+theWidth+",height="+theHeight);
		return false;
		}
// reload parent window
function load(file,target) {
    if (target != '')
        target.location = file;
    else
        window.location = file;
}

// form validation
function validate(register) {
FirstName = document.EmailForm.FirstName.value;
    if(FirstName == "")
		{
		document.EmailForm.FirstName.value = prompt('Please include your first name',document.EmailForm.Firstname.value);
		return false;
		}
	else if(document.EmailForm.LastName.value == "")
		{
		document.EmailForm.LastName.value = prompt('Please include your last name',document.EmailForm.LastName.value);
		return false;
		}
	else if(document.EmailForm.Email.value.indexOf('@') < 1)
		{
		document.EmailForm.Email.value = prompt('Please include your email address',document.EmailForm.Email.value);
		return false;
		}
	else if(document.EmailForm.PortOfInterest.value == "")
		{
		alert('Please select a port of interest');
		return false;
		}
	else if (register == "yes" && document.EmailForm.Address1.value == "")	
		{
			
			document.EmailForm.Address1.value = prompt('Please include your address',document.EmailForm.Address1.value);
			return false;
		}
	else if (register == "yes" && document.EmailForm.City.value == "")	
		{
			document.EmailForm.City.value = prompt('Please include your city',document.EmailForm.City.value);
			return false;
		}	
	else if (register == "yes" && document.EmailForm.State.value == "")	
		{
			document.EmailForm.State.value = prompt('Please include your state',document.EmailForm.State.value);
			return false;
		}	
	else if (register == "yes" && document.EmailForm.Zip.value == "")	
		{
			document.EmailForm.Zip.value = prompt('Please include your zip code',document.EmailForm.Zip.value);
			return false;
		}
	else if (register == "yes" && document.EmailForm.Country.value == "")	
		{
			document.EmailForm.Country.value = prompt('Please include your country',document.EmailForm.Country.value);
			return false;
		}										
	else
	document.EmailForm.Putitin.value = "insert";
	return true;
	}
//-->
 function validateForm(frmobj, rule)
 {
 	//++++++++++++++Commented untill fixed ++++++++++++++++++++++++++++++++++++++++++++++++++++++
	//if (isEmpty(frmobj.tbPortOfInterest, "Please Select a Port of Interest.")) return false;	
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	if (isEmpty(frmobj.tbFirstName, "Please enter First Name.")) return false;
	if (isEmpty(frmobj.tbLastName, "Please enter Last Name.")) return false;
	if (isEmpty(frmobj.tbEmail, "Please enter Email address.")) return false;	
	if (rule == "STRICT")
	  {
		if (isEmpty(frmobj.tbAddress1, "Please enter Address1.")) return false;
		if (isEmpty(frmobj.tbCity, "Please enter City.")) return false;
		if (isEmpty(frmobj.ddlbState, "Please enter State.")) return false;
		if (isEmpty(frmobj.tbZip, "Please enter Zip Code.")) return false;
		//Checking zip code length
		if (!chkInteger(frmobj.tbZip.value, frmobj.tbZip, "Zip code must be numeric.")) return false;
		if (!chkLength(frmobj.tbZip,5,5,"Zip code must be 5 digits long.")) return false;
		//Checking home phone number
		if (!validatePhone3(frmobj.tbHomePhone1, frmobj.tbHomePhone2, frmobj.tbHomePhone3, false, "Please enter valid Home Phone Number.")) return false;
		//Checking work phone number  
		if (!validatePhone3(frmobj.tbWorkPhone1, frmobj.tbWorkPhone2, frmobj.tbWorkPhone3, true, "Please enter valid Work Phone Number.")) return false;
		//Checking fax
		if (!validatePhone3(frmobj.tbFax1, frmobj.tbFax2, frmobj.tbFax3, false, "Please enter valid Fax Number.")) return false;
	  }

	//Checking email   
 	if (frmobj.tbEmail.value != "")
	{
	  if (!validateEmail(frmobj.tbEmail)) return false;
	}

	frmobj.tbAddRecord.value = "add";
	return true;
 }
// Move the Cursor
 function setFocusToNext(currentObjMaxLength, currentObject, nextObject, nextObjectMaxLength)
 {
   str = currentObject.value;  
   fieldLen = str.length;

   if ( (fieldLen == currentObjMaxLength) && (nextObject.value.length != nextObjectMaxLength))
   	nextObject.focus();	
 }

//job stuff
function navigateClose(str)
	{
		if (document.coe != null)
			{
				document.coe.location.href=str;window.close();
			}
			else
			{
			alert("Window is unable to Close");
			}
	}

function jobDetail(ID)
		{

		//all non-webtv
		theName=window.open("jobDetail.asp?ID="+ID+"", "coe", "scrollbars=yes,status=no,menubar=yes,width=400,height=300");
		}
		
function randomImage(pathString,theLoc,howMany,extension)	{
		if(document.images)
		{
			var theGen=new Date();
			var theNumber=((theGen.getSeconds()) % howMany)+1;
			var theFullPath=pathString+theNumber+"."+extension;

			eval("document.images."+theLoc+".src='"+theFullPath+"';")
		}
	}

// standard image swap
	
function swap (theNewImage, theLoc)		{
		if(document.images){eval("document.images."+theLoc+".src="+theNewImage+".src");}
		}



// drop down list link function

function linkMenu(fullMenuPath,ndx)	{
	var locString = eval("document."+fullMenuPath+".options["+ndx+"].value");
	window.location.href = locString;
}

//windoid with scrollbars


//windoid with toolbar
function spawnWindowtool (theUrl,theName,theHeight,theWidth)
		{

		//all non-webtv
		if(browser != "WEBTV")	{
		var localName=theName
		theName=window.open(theUrl, localName, "scrollbars=yes,status=no,menubar=yes,toolbar=yes,resizable=yes,width="+theWidth+",height="+theHeight);
		}
				
		//added func for non-AOL native browser
		if(browser != "AOL"){theName.focus();}
		
		//webtv
		if(browser == "WEBTV"){window.location.href=theUrl;}
			
		}
		



// new pulldown list script, this script allows you to target the top of framesets (i.e. target="_top"), so you don't get double navs
// usage:
// <option value="target|url">blablabla

// use the pipe (|) character to seperate target from URL
// use "_top" if you want the url to occupy the entire window

	function linkToTarget(form,ndx)
       {
               var locString = form.site.options[ndx].value;
               var locArray = new Array();
               var theLength = locString.length;
               var theTarget;
               var theUrl
               
               var counter;
               var isPipe=0;
               
               if (locString != "")
               {
                       
                       for(counter=0; counter<theLength; counter++)
                       {
                               if (locString.charAt(counter) == "|")
                               {
                                       isPipe=1;
                               }
                               
                       }
                       if(isPipe > 0)
                       {
                               
                               locArray = locString.split("|");
                               if(locArray[0] == "_top")
                               {
                                       parent.location = locArray[1];
                               }
                               else
                               {
                                       
                                       parent.frames[locArray[0]].location.href = locArray[1];
                               }                               
                       }
                       else
                       {
                               window.location.href = locString;
                       }
               }
       }
