// JavaScript Document
var strTheHref = document.location.href;
var intTheErrCode = 0;
var thetemp = "";
var theGlobalUserAgent;
var bolBrowserAccepted;
var strTheStringBrowser;
var strStatusBarText;
var strShowDate;
var Monohull = new Array(8);
var TakeString = "";
var XMLDoc;
Monohull[1] = new yachtRecord("Kolossos","Oceanis 461","1300","../yachts/kol.jpg",4,10,"");
Monohull[2] = new yachtRecord("Godfriend","Sun Odyssey 45.2","1300","../yachts/god.jpg",4,10,"");
Monohull[3] = new yachtRecord("Frixos","Sun Odyssey 42.2","1300","../yachts/fri.jpg",4,10,"../yachts/fri/300W/layout_1.jpg");
Monohull[4] = new yachtRecord("Iliada","Sun Odyssey 42.1","1200","../yachts/ili.jpg",4,10,"");
Monohull[5] = new yachtRecord("Pegassus","Oceanis 351","1000","../yachts/peg.gif",3,8,"");
Monohull[6] = new yachtRecord("Pegassus_II","Oceanis 351","1000","../yachts/peg.gif",3,8,"");
Monohull[7] = new yachtRecord("Ariadne","Moody 33.6","1000","../yachts/ari.jpg",2,6,"");

 //Functions for stopping and also starting the scroller . 
 function StopScroller() {
 document.getElementById("OffersScroller").stop();
 }
 function StartScroller() {
 document.getElementById("OffersScroller").start();
 }
 /*
   script functions . . . 
   listed here by page.
   Page id = 5 / sales
   Area of scripts conserning sales page .
 1. function that detects whether they do exist button and form object specified.
  function detectObjects(theForm,theButton)
  Arguments analysis
  ----------------------------------------------------------------------
  theForm - the form's name.
  theButton - the button's name (that's what all the function is about.
                                                                                                 */
 function detectObjects(theForm,theButton) {
 var intErr = 0;
 var objForm = theForm;
 var objButt = theButton;
 
 
 //checking if theForm argument is an object indeed.
 if ((typeof objForm =="object") && (typeof objButt == "object")) {
	intErr = 0; }
 else {intErr = 1;}
 //begin to debug the function by setting the error codes for correct output to the user.
 if (intErr == 1) {
  window.alert("You didn't provide valid objects.");}
 else {window.alert("You did provide valid objects."); }
 //end of function
 } 
 /* 
 2. function that detects whether they do exist button and form object specified.
  function detectObjects(theForm,theButton)
  Arguments analysis
  ----------------------------------------------------------------------
  theForm - the form's name.
  theButton - the button's name (that's what all the function is about.
                                                                                                  */ 
 function LoadTheLogo (sr) {
  var theImg = new Image;
  var imgLogo = document.getElementById("ImgLogo");
  theImg.src = sr;
  imgLogo.src = theImg.src;
  
 }
 function WriteTheInnerSalesForm (elem) {
  var m = "<% Response.Write(theParagraphArray(3) & '<BR>' & theParagraphArray(4))%><br><form name='sales' id='sales' action='../default.htm' method='post' target='_blank'>";
  m += "<input type='button' name='doit' id='doit' value='Submit'>&nbsp;<input type='button' name='check' id='check' value='Check' onClick='WriteTheElements('temp','send')'>&nbsp;";
  m += "<input type='reset' name='erase' id='erase' value='Reset'>&nbsp;<input type='text' name='send' id='send' value='wait for code' size='10'>&nbsp;</form>";   
  document.getElementById(elem).innerHTML = m;
  }																								 
  //
 function DisplayTimeW () {
  var thedate = new Date();
  var todayDay = "";
  var todayYear = "";
  var todaysday = thedate.getDay();
  var todaysmonth = thedate.getMonth();
  var todaymonth = "";
  var strHoldTheDate,strHoldTheMonth;
  var intTheMonth,intTheDay,intStatus;
  //var objDater = document.getElementById("dater");
  
  
  switch (todaysmonth) {
   case 0 :
    todaymonth = 1
	break
   case 1 :
    todaymonth = 2
	break
	case 2 :
    todaymonth = 3
	break
	case 3 :
    todaymonth = 4
	break
	case 4 :
    todaymonth = 5
	break
	case 5 :
    todaymonth = 6
	break
	case 6 :
    todaymonth = 7
	break	
	case 7 :
    todaymonth = 8
	break
	case 8 :
    todaymonth = 9
	break
	case 9 :
    todaymonth = 10
	break
	case 10 :
    todaymonth = 11
	break
	case 11 :
    todaymonth = 12
	break
  
  }   
  switch (todaysday) {
   case 0 :
    todayDay = 7
	break
   case 1 :
    todayDay = 1
	break
	case 2 :
    todayDay = 2
	break
	case 3 :
    todayDay = 3
	break
	case 4 :
    todayDay = 4
	break
	case 5 :
    todayDay = 5
	break
	case 6 :
    todayDay = 6
	break	
  
  }   
  switch (todayDay) {
  case 1 :
  	strHoldTheDay = "Monday"
	break
  case 2 :
  	strHoldTheDay = "Tuesday"
	break
  case 3 :
  	strHoldTheDay = "Wednesday"
	break
  case 4 :
  	strHoldTheDay = "Thursday"
	break
  case 5 :
  	strHoldTheDay = "Friday"
	break
  case 6 :
  	strHoldTheDay = "Saturday"
	break
  case 7 :
    strHoldTheDay = "Sunday"	
	break
  }
  switch (todaymonth) {
  case 1 :
  	strHoldTheMonth = "January"
	break
  case 2 :
  	strHoldTheMonth = "February"
	break
  case 3 :
  	strHoldTheMonth = "March"
	break
  case 4 :
  	strHoldTheMonth = "April"
	break
  case 5 :
  	strHoldTheMonth = "May"
	break
  case 6 :
  	strHoldTheMonth = "June"
	break
  case 7 : 
  	strHoldTheMonth = "July"
	break
  case 8 :
  	strHoldTheMonth = "August"
	break
  case 9 :
  	strHoldTheMonth = "September"
	break
  case 10 :
  	strHoldTheMonth = "October"
	break
  case 11 :
  	strHoldTheMonth = "November"
	break
  case 12 :
    strHoldTheMonth = "December"
	break	
  	
  }
  strStatusBarText = "© " + thedate.getFullYear() +" goldensails.com / All rights of the respective ownership reserved." ;
  strShowDate = strHoldTheDay + " , " + thedate.getDate() + " of  " + strHoldTheMonth + " , " + thedate.getFullYear();
  document.write(strShowDate);window.status = strStatusBarText;
} 
 function DisplayTime () {
  var thedate = new Date();
  var todayDay = "";
  var todayYear = "";
  var todaysday = thedate.getDay();
  var todaysmonth = thedate.getMonth();
  var todaymonth = "";
  var strHoldTheDate,strHoldTheMonth;
  var intTheMonth,intTheDay,intStatus;
  var objDater = document.getElementById("dater");
  
  
  switch (todaysmonth) {
   case 0 :
    todaymonth = 1
	break
   case 1 :
    todaymonth = 2
	break
	case 2 :
    todaymonth = 3
	break
	case 3 :
    todaymonth = 4
	break
	case 4 :
    todaymonth = 5
	break
	case 5 :
    todaymonth = 6
	break
	case 6 :
    todaymonth = 7
	break	
	case 7 :
    todaymonth = 8
	break
	case 8 :
    todaymonth = 9
	break
	case 9 :
    todaymonth = 10
	break
	case 10 :
    todaymonth = 11
	break
	case 11 :
    todaymonth = 12
	break
  
  }   
  switch (todaysday) {
   case 0 :
    todayDay = 7
	break
   case 1 :
    todayDay = 1
	break
	case 2 :
    todayDay = 2
	break
	case 3 :
    todayDay = 3
	break
	case 4 :
    todayDay = 4
	break
	case 5 :
    todayDay = 5
	break
	case 6 :
    todayDay = 6
	break	
  
  }   
  switch (todayDay) {
  case 1 :
  	strHoldTheDay = "Monday"
	break
  case 2 :
  	strHoldTheDay = "Tuesday"
	break
  case 3 :
  	strHoldTheDay = "Wednesday"
	break
  case 4 :
  	strHoldTheDay = "Thursday"
	break
  case 5 :
  	strHoldTheDay = "Friday"
	break
  case 6 :
  	strHoldTheDay = "Saturday"
	break
  case 7 :
    strHoldTheDay = "Sunday"	
	break
  }
  switch (todaymonth) {
  case 1 :
  	strHoldTheMonth = "January"
	break
  case 2 :
  	strHoldTheMonth = "February"
	break
  case 3 :
  	strHoldTheMonth = "March"
	break
  case 4 :
  	strHoldTheMonth = "April"
	break
  case 5 :
  	strHoldTheMonth = "May"
	break
  case 6 :
  	strHoldTheMonth = "June"
	break
  case 7 : 
  	strHoldTheMonth = "July"
	break
  case 8 :
  	strHoldTheMonth = "August"
	break
  case 9 :
  	strHoldTheMonth = "September"
	break
  case 10 :
  	strHoldTheMonth = "October"
	break
  case 11 :
  	strHoldTheMonth = "November"
	break
  case 12 :
    strHoldTheMonth = "December"
	break	
  	
  }
  strStatusBarText = "© " + thedate.getFullYear() +" dolphinyachts.gr / All rights of the respective ownership reserved." ;
  strShowDate = strHoldTheDay + " , " + thedate.getDate() + " of  " + strHoldTheMonth + " , " + thedate.getFullYear();
  objDater.innerHTML = strShowDate;window.status = strStatusBarText;
}
 function TakeTheSales() {

 var thetempSubmitDisabled;
 var m = document.getElementById("send");
 var thesubmit = document.getElementById("go");
 //window.alert(m.value);
 var theform = document.sales;
 var holdvalue = "";
 var theholder = "";
 var thechoser = document.getElementById("choser");
   //window.alert(m.value + theform.name);
 //m.value = "panos";
 if (m.value=="") {
 theholder = "Please you have to select any of the sales offer .";
 thechoser.innerHTML = theholder;
 } else{ 
  for (var i = 0; i < theform.length; i++){
       if (theform.elements[i].type=="radio" && theform.elements[i].name=="offer") {//3o if
          //2o if
		     if (theform.elements[i].checked==true){
			     //thetempSubmitDisabled = thesubmit.disabled
			     //thetempSubmitDisabled ? false : true;
			     //thesubmit.disabled = false;
		         holdvalue = theform.elements[i].value;
				 thesubmit.value = holdvalue; 
			     m.value = theform.elements[i].value;
				 
                 window.alert (theform.elements[i].name + " --> " + theform.elements[i].value + ". You can click the submit now." );
				 theholder = "You chose to send us the sales offer with the code , " + holdvalue
                 theholder += " please click the submit button.";
                 thechoser.innerHTML = theholder;
			 } else {theholder = "Please select a sales offer in order to send us one.";thesubmit.value="Submit";}
		  //2o if
	   }//3o if
  }//for
}//else
  
}  
function CheckAndSubmit() {
//---
var strHoldTheStrAgent = document.getElementById("AgentStatus");
if (bolBrowserAccepted==true){strHoldTheStrAgent.innerHTML = "Browser Status : <img src='../images/source/detect/ok.gif' title='STATUS OK' align='absmiddle'> ";}
else {strHoldTheStrAgent.innerHTML = "Browser Status : <img src='../images/source/detect/ok.gif' title='STATUS OK' align='absmiddle'> ";}
}
function CheckBrowser(strBrowser) {
//'navigator.userAgent','AgentStatus'

//var strHoldTheStrAgent = document.getElementById("AgentStatus");
strBrowser = navigator.userAgent;
//strHoldTheStrAgent.innerHTML = "Your agent is :" + strBrowser;
}
function checkUser() {
	
}
function PrintTheMessage() {

var bolHoldMSIEGroup ;
var bolHoldGECKOGroup;
var intMSIEStringHolder;
var intMSIEStrSubgroup;
var intGECKOStringHolder;
var intGECKOStrSubgroup;
var strBrowserVersion = "";
var strHoldTheStatus = false;
var strHoldTheAgentString = "";
theGlobalUserAgent = navigator.userAgent;
intMSIEStringHolder = theGlobalUserAgent.indexOf("MSIE");

if (intMSIEStringHolder==-1 ) {bolHoldMSIEGroup = false;
    intGECKOStringHolder = theGlobalUserAgent.indexOf("Gecko");
	  window.alert("intGECKOStringHolder " + intGECKOStringHolder);
	  if (intGECKOStringHolder==-1) {bolHoldGECKOGroup = false;}
	  else {bolHoldGECKOGroup = true;strTheStringBrowser = "Mozz";
	  window.alert("intMSIEStringHolder " + intMSIEStringHolder);
	  }
   }//first if
else {bolHoldMSIEGroup = true;strTheStringBrowser = "Msie";
}//else of the first if
if (bolHoldMSIEGroup == true || bolHoldGECKOGroup == true){bolBrowserAccepted = true;}
else {bolBrowserAccepted = false;}	
}

function ResetFields(){
var thesubmit = document.getElementById("go");
var m = document.getElementById("send");
 //window.alert(m.value);
 var theform = document.sales;
 var holdvalue = "";
 var theholder = "";
 var thechoser = document.getElementById("choser");
 //thesubmit.disabled = true;
 //window.alert(m.value + theform.name);
 thesubmit.value = "Submit";
 m.value = "";
 if (m.value=="") {
 theholder = "Please you have to select any of the sales offer .";
 thechoser.innerHTML = theholder;}
} 
function CheckMainURL(bolBrStatus){//CheckMainURL(bolBrowserAccepted)
var mainLink = document.getElementById("mainlink");
if (bolBrStatus==true)  {
 mainLink.href = "../main.asp?pageId=5";mainLing.title="click to visit current link.";}
else {mainLink.href = "javascript:void(0)"; }
} 
function MakeTheWindow (purpose,strLink) {
 switch(purpose){
	 case "request" :
	       var strWindow = window.open(strLink,"def",
			   "screenX=300,width=450,left=300,height=350,status,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1");
		   break;
	 case "details" :
	 	   var strWindow = window.open(strLink,"def",
			   "screenX=300,width=400,left=300,height=500,status,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1");
		   break;
	 case "getto" :
	 	   var strWindow = window.open(strLink,"def",
			   "screenX=300,width=420,left=300,height=300,status,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1");	
 }
}
function OpenTheWindow (strLink) {
	//window.alert(strLink);
var strWindow =  window.open(strLink,"def","width=315,left=300,top=200,height=280,status,toolbar=0,menubar=0,location=0");	
} 
function OpenTheWindow1 (strLink) {
	//window.alert(strLink);
var strWindow =  window.open(strLink,"def","width=439,left=300,height=380,status,toolbar=0,menubar=0,location=0,overflow=both");	
}
function OpenTheWindow2 (strLink) {
	//window.alert(strLink);
var strWindow =  window.open(strLink,"def",
							 "width=439,left=300,height=380,status,toolbar=0,menubar=0,location=0,resizable,scrollbars=1");	
}
function objBanner(imgSrc,ilink) {
   this.imgSrc = imgSrc;
   this.ilink = ilink;
}   
function ResetTopBanner() {
  var theImgReferrer = document.images["theTopBanner"];
  theImgReferrer.src = "../images/img/img_0.gif";
}
function ChangeBanner() {
var theImgReferrer = document.getElementById("theTopBanner");
var theHolderDiv = document.getElementById("MainBanner");
var t;
var theBannerLink = document.getElementById("theTopBannerLink");
var imgSource = "../images/img/";
var obImages = new Array();

var Links = new Array("javascript:void(0)","../main.asp?pageId=12","javascript:void(0)","javascript:void(0)","../main.asp?pageId=12");
var Banners = new Array(imgSource + "img_0.gif",imgSource + "img_1.gif",imgSource + "img_2.gif",imgSource + "img_3.gif",imgSource + "img_4.gif");
var theImg = new Image(484,44);
var theRandomNum = Math.floor(Math.random() * (4 + 1));
for (var i=0;i<=4;i++) {
 obImages[i] = new Image(484,44);
 obImages[i].src = "../images/img/img_" + i + ".gif" ;
 }
 
switch (strTheStringBrowser) {
 case "Mozz" :
  theImgReferrer.src = obImages[theRandomNum].src;
  theBannerLink.href = Links[theRandomNum];
  //theHolderDiv.innerHTML = "<a id='theTopBannerLink' href='" + Links[theRandomNum] + "'><img src='" + Banners[RandomNum] + "' width='484' height='44' alt='top_banner' id='theTopBanner' border='0'></a>";
 case "Msie" :
  theImg.src = Banners[theRandomNum];//obImages[theRandomNum][0]
  theImgReferrer.src = theImg.src;
  theImgReferrer.alt = theImg.src;
  theBannerLink.href = Links[theRandomNum];
} 

t = setTimeout("ChangeBanner()",11000);
}       
//A function which has the purpose of changing the contents of a listbox .
function yachtRecord(name,type,deposit,picture,cabins,persons,url){
 
 this.name = name;
 this.type = type;
 this.deposit = deposit;
 this.picture = picture;
 this.cabins = cabins;
 this.persons = persons;
 this.url = url;
}
function LoadYachts(){
var thefirstOption = "select an option";
var theboattype = document.forms["request"].reqboatype;
var theyachts = document.forms["request"].reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
var strTheCabins = document.forms["request"].reqboatcab;
var strThePersons = document.forms["request"].reqboatpers;
var strTheDeposit = document.forms["request"].reqboatdep;
var strYachtImage = document.getElementById("yachtimage");
var intMonohullCounter = 0,intMultihullCounter = 0;
theyachts.options.length = 0;
strTheCabins.value = "";
strThePersons.value = "";
strTheDeposit.value = "";
strYachtImage.src = "../images/source/yachts/emptyyacht.gif";

//variables definition for the form elements that will be changed automatically.

//Monohull[7] = new yachtRecord("Ariadne","Moody 33.6","1000","../yachts/ari.jpg",2,6,"");

switch (thechosenone) {
 case "Monohull" : 
    theyachts.options.length = 0;
    theyachts.options[0] = new Option(thefirstOption,"none");
          for (var i=1; i<=Monohull.length; i++){
		      //intMonohullCounter = i + 1;
              theyachts.options[i] = new Option(Monohull[i].type + " ( " + Monohull[i].name + " )","Monohull");
	           }
		   	   
          for (i=1; i<=Monohull.length; i++){
              theyachts.add(theyachts.options[i],i);
			   }		   

 case "Multihull" :
    theyachts.options.length = 0;
    theyachts.options[0] = new Option(thefirstOption,"none");
          
 case "none" :

  theyachts.options[0] = new Option("select a yacht type","none");
  theyachts.add(theyachts.options[0],0);
 } 
 
}
//
function ApplyYachtSets() {

 var tempImage = new Image();
 var strTheCabins = document.forms["request"].reqboatcab;
 var strThePersons = document.forms["request"].reqboatpers;
 var strTheDeposit = document.forms["request"].reqboatdep;
 var strYachtImage = document.getElementById("yachtimage");
 var theyachts = document.forms["request"].reqavailboats;
 var yachtstype = document.forms["request"].reqboatype;
 var intSelectedIndex = theyachts.selectedIndex;
 var strSelectedValue = theyachts.options[theyachts.selectedIndex].value;
 var strYachtsType = yachtstype.options[yachtstype.selectedIndex].value;
 
 var imgYacht = document.getElementById("imgYacht");
 //var bolfound = false;
  /*window.alert("Selected value " + strSelectedValue);
  window.alert("Selected Index at Monohull array " + Monohull[intSelectedIndex].name);
  window.alert("Selected Index at Multihull array " + Multihull[intSelectedIndex].name);
  window.alert("SelectedIndex property " + intSelectedIndex);
  window.alert("Selected value at yacht's type radio box " + strYachtsType);*/
  switch (strYachtsType) {
   case "none" :
    strTheCabins.value = "";
    strThePersons.value = "";
    strTheDeposit.value = "";
    strYachtImage.src = "../images/source/yachts/emptyyacht.gif";
	TakeString = "";
	imgYacht.disabled = true;
   case "Monohull" :
    
	 strTheCabins.value = Monohull[intSelectedIndex].cabins;
	 strThePersons.value = Monohull[intSelectedIndex].persons;
	 strTheDeposit.value = Monohull[intSelectedIndex].deposit;
	 tempImage.src = Monohull[intSelectedIndex].picture;
	 strYachtImage.src = tempImage.src;
	 if (Monohull[intSelectedIndex].url =="") {
	 TakeString = "";
	 imgYacht.disabled = true;
	 }
	 else {
	 imgYacht.disabled = false;
	 imgYacht.title = "click for a larger image";
	 TakeString =  Monohull[intSelectedIndex].url;
	 }
	
    
  
    }

 
}
function OpenImg(){
 if (TakeString!=""){
 var str = window.open(TakeString,"dolphinyachts.gr","width=300,height=350,resizable");}
}
function LoadYacht(form) {
 var theYachts = window.document.form.yachttype
 for (var i=0; i<=theYachts.length; i++) {
    if (theYachts[i].checked==true) {
	    window.document.location.href = theYachts[i].value;
	}
	else if((theYachts[i].checked==false) && (i=theYachts.length)){
	    window.alert("Please select a yacht.");
	}
	}	
		

}
function LoadTest(form,askedvalue){
var theboattype = form.bazzo;
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
if (thechosenone==askedvalue) {
 window.alert(thechosenone);
} else {
 window.alert("Wrong bro!");
}
}
/* General functions (Global)
*/
function SendPage(){
var emailPage = prompt("Where do you wish to sent the page?","email address");
if (emailPage) document.location.href = "../mails.asp?reason=sendpage&href=" + strTheHref + "&email=" + emailPage;
}
function LoadButtons() {
var newP = document.getElementById("MainPageTools");
var texter = "";
  texter +="Page tools&nbsp;&nbsp;&nbsp;&nbsp;Print this page<a href='#' id='printMe' onclick='javascript:window.print()'><img src='../images/source/print.gif' align='absmiddle' border='0' title='Print this page.'></a>&nbsp;"
  texter +="Save this page&nbsp;<a href='#' id='saveMe' onclick='javascript:window.alert()'><img src='../images/source/clip.gif' align='absmiddle' border='0' title='Save this page.'></a>&nbsp;"
  texter +="Email this page&nbsp;<a href='#' id='emailMe' onclick='SendPage()'><img src='../images/source/mail.gif' align='absmiddle' border='0' title='Email this page.'></a><br>";
  texter +="<BR><img src='../images/source/xml/button-xml.gif' align='absmiddle' border='0' title='XML service.'>&nbsp;Online Bookings&nbsp;<select name='xmlyachtype' id='xmlyachtype' onchange='LoadSelectButtonTools()'><option name='xmlyachtT' value='0'>select a yacht type</option><option name='xmlyachtT' value='1'>multihull</option><option name='xmlyachtT' value='2'>monohull</option></select>";
  texter +="<select name='xmlyachtype2' id='xmlyachtype2'><option name='xmlyachtT1' value='none'>select a yacht</option></select>";
  texter +="&nbsp;<button id='openBookings' onclick='OpenBookingsXML()'>Open</button>";
  newP.innerHTML = texter;
}
function OpenBookingsXML() {
var theboattype  = document.getElementById("xmlyachtype");
var theboattype1 = document.getElementById("xmlyachtype2");
var thechosenone = theboattype1.options[theboattype1.selectedIndex].value;
if (parseInt(theboattype.options[theboattype.selectedIndex].value)==2)  
 //LoadXMLBookings()
 document.location.href = "../main.asp?pageId=15&bookingYacht=" + thechosenone;
}
function LoadSelectButtonTools(){
var theboattype  = document.getElementById("xmlyachtype");
var theboattype1 = document.getElementById("xmlyachtype2");
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
theboattype1.options.length = 0 ;
if (parseInt(thechosenone)==2){
    theboattype1.options[0] = new Option(Monohull[1].name,Monohull[1].name);
	theboattype1.options[1] = new Option(Monohull[2].name,Monohull[2].name);
	theboattype1.options[2] = new Option(Monohull[3].name,Monohull[3].name);
	theboattype1.options[3] = new Option(Monohull[4].name,Monohull[4].name);
	theboattype1.options[4] = new Option(Monohull[5].name,Monohull[5].name);
	theboattype1.options[5] = new Option(Monohull[6].name,Monohull[6].name);
	theboattype1.options[6] = new Option(Monohull[7].name,Monohull[7].name);
	theboattype1.add(theboattype1.options[0],0);
	theboattype1.add(theboattype1.options[1],1);
	theboattype1.add(theboattype1.options[2],2);
	theboattype1.add(theboattype1.options[3],3);
	theboattype1.add(theboattype1.options[4],4);
	theboattype1.add(theboattype1.options[5],5);
	theboattype1.add(theboattype1.options[6],6);
	}
else {
 theboattype1.options[0] = new Option("not available","none");
 theboattype1.add(theboattype1.options[0],0);
 } 
}
/*
            *      *       *         ****      *         *****   ****** ******
           * *     *       *         *   *    * *       *        *        ***
          *****    *       *         *   *   *****     *    **   ****** ***
         *     *   *       *         ****   *     *    *     **  *        *** 
        *       *  ******  ******    *     *       *    ******   ****** ******




*/
// Functions for general use
// Functions for page 14
function doTheChange(sdg) {
 //var thechosen = document.getElementById("switchYacht");thechosen.valuethechosen.value;
 if (sdg=='#') {
	 alert('Wrong selection');}
 else {document.location.href = sdg}	 
	 


}
// Functions for page 3
//A function which has the purpose of changing the contents of a listbox .
function DayRecord(month,year,day,saturday){
 this.month = month;
 this.year = year;
 this.day = day;
 this.saturday = saturday;
}
function DaysOfYear(month,dayNum,dayText,year) {
	this.month = month;
	this.dayNum = dayNum;
	this.dayText = dayText;
	this.year = year;
}
var AllDays = new Array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
var AllMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var AllDates = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
var Saturdays = new Array();
// Oloi im mines tou DayRecord(month) einai oi pragmatikoi arithmoi .

Saturdays[0] = new DayRecord(4,2007,7,5);
Saturdays[1] = new DayRecord(5,2007,5,5);
Saturdays[2] = new DayRecord(6,2007,2,5);
Saturdays[3] = new DayRecord(7,2007,7,5);
Saturdays[4] = new DayRecord(8,2007,4,5);
Saturdays[5] = new DayRecord(9,2007,1,5);
Saturdays[6] = new DayRecord(10,2007,6,5);
var March = new Array(30);
var April = new Array(29);
var May = new Array(30);
var June = new Array(29);
var July = new Array(30);
var August = new Array(30);
var September = new Array(29);
var October = new Array(30);
var November = new Array(29);

March[0] = new DaysOfYear(3,1,"Thursday",2007);
March[1] = new DaysOfYear(3,2,"Friday",2007);
March[2] = new DaysOfYear(3,3,"Saturday",2007);
March[3] = new DaysOfYear(3,4,"Sunday",2007);
March[4] = new DaysOfYear(3,5,"Monday",2007);
March[5] = new DaysOfYear(3,6,"Tuesday",2007);
March[6] = new DaysOfYear(3,7,"Wednesday",2007);
March[7] = new DaysOfYear(3,8,"Thursday",2007);
March[8] = new DaysOfYear(3,9,"Friday",2007);
March[9] = new DaysOfYear(3,10,"Saturday",2007);
March[10] = new DaysOfYear(3,11,"Sunday",2007);
March[11] = new DaysOfYear(3,12,"Monday",2007);
March[12] = new DaysOfYear(3,13,"Tuesday",2007);
March[13] = new DaysOfYear(3,14,"Wednesday",2007);
March[14] = new DaysOfYear(3,15,"Thursday",2007);
March[15] = new DaysOfYear(3,16,"Friday",2007);
March[16] = new DaysOfYear(3,17,"Saturday",2007);
March[17] = new DaysOfYear(3,18,"Sunday",2007);
March[18] = new DaysOfYear(3,19,"Monday",2007);
March[19] = new DaysOfYear(3,20,"Tuesday",2007);
March[20] = new DaysOfYear(3,21,"Wednesday",2007);
March[21] = new DaysOfYear(3,22,"Thursday",2007);
March[22] = new DaysOfYear(3,23,"Friday",2007);
March[23] = new DaysOfYear(3,24,"Saturday",2007);
March[24] = new DaysOfYear(3,25,"Sunday",2007);
March[25] = new DaysOfYear(3,26,"Monday",2007);
March[26] = new DaysOfYear(3,27,"Tuesday",2007);
March[27] = new DaysOfYear(3,28,"Wednesday",2007);
March[28] = new DaysOfYear(3,29,"Thursday",2007);
March[29] = new DaysOfYear(3,30,"Friday",2007);
March[30] = new DaysOfYear(3,31,"Saturday",2007);
April[0] = new DaysOfYear(4,1,"Sunday",2007);
April[1] = new DaysOfYear(4,2,"Monday",2007);
April[2] = new DaysOfYear(4,3,"Tuesday",2007);
April[3] = new DaysOfYear(4,4,"Wednesday",2007);
April[4] = new DaysOfYear(4,5,"Thursday",2007);
April[5] = new DaysOfYear(4,6,"Friday",2007);
April[6] = new DaysOfYear(4,7,"Saturday",2007);
April[7] = new DaysOfYear(4,8,"Sunday",2007);
April[8] = new DaysOfYear(4,9,"Monday",2007);
April[9] = new DaysOfYear(4,10,"Tuesday",2007);
April[10] = new DaysOfYear(4,11,"Wednesday",2007);
April[11] = new DaysOfYear(4,12,"Thursday",2007);
April[12] = new DaysOfYear(4,13,"Friday",2007);
April[13] = new DaysOfYear(4,14,"Saturday",2007);
April[14] = new DaysOfYear(4,15,"Sunday",2007);
April[15] = new DaysOfYear(4,16,"Monday",2007);
April[16] = new DaysOfYear(4,17,"Tuesday",2007);
April[17] = new DaysOfYear(4,18,"Wednesday",2007);
April[18] = new DaysOfYear(4,19,"Thursday",2007);
April[19] = new DaysOfYear(4,20,"Friday",2007);
April[20] = new DaysOfYear(4,21,"Saturday",2007);
April[21] = new DaysOfYear(4,22,"Sunday",2007);
April[22] = new DaysOfYear(4,23,"Monday",2007);
April[23] = new DaysOfYear(4,24,"Tuesday",2007);
April[24] = new DaysOfYear(4,25,"Wednesday",2007);
April[25] = new DaysOfYear(4,26,"Thursday",2007);
April[26] = new DaysOfYear(4,27,"Friday",2007);
April[27] = new DaysOfYear(4,28,"Saturday",2007);
April[28] = new DaysOfYear(4,29,"Sunday",2007);
April[29] = new DaysOfYear(4,30,"Monday",2007);
May[0] = new DaysOfYear(5,1,"Tuesday",2007);
May[1] = new DaysOfYear(5,2,"Wednesday",2007);
May[2] = new DaysOfYear(5,3,"Thursday",2007);
May[3] = new DaysOfYear(5,4,"Friday",2007);
May[4] = new DaysOfYear(5,5,"Saturday",2007);
May[5] = new DaysOfYear(5,6,"Sunday",2007);
May[6] = new DaysOfYear(5,7,"Monday",2007);
May[7] = new DaysOfYear(5,8,"Tuesday",2007);
May[8] = new DaysOfYear(5,9,"Wednesday",2007);
May[9] = new DaysOfYear(5,10,"Thursday",2007);
May[10] = new DaysOfYear(5,11,"Friday",2007);
May[11] = new DaysOfYear(5,12,"Saturday",2007);
May[12] = new DaysOfYear(5,13,"Sunday",2007);
May[13] = new DaysOfYear(5,14,"Monday",2007);
May[14] = new DaysOfYear(5,15,"Tuesday",2007);
May[15] = new DaysOfYear(5,16,"Wednesday",2007);
May[16] = new DaysOfYear(5,17,"Thursday",2007);
May[17] = new DaysOfYear(5,18,"Friday",2007);
May[18] = new DaysOfYear(5,19,"Saturday",2007);
May[19] = new DaysOfYear(5,20,"Sunday",2007);
May[20] = new DaysOfYear(5,21,"Monday",2007);
May[21] = new DaysOfYear(5,22,"Tuesday",2007);
May[22] = new DaysOfYear(5,23,"Wednesday",2007);
May[23] = new DaysOfYear(5,24,"Thursday",2007);
May[24] = new DaysOfYear(5,25,"Friday",2007);
May[25] = new DaysOfYear(5,26,"Saturday",2007);
May[26] = new DaysOfYear(5,27,"Sunday",2007);
May[27] = new DaysOfYear(5,28,"Monday",2007);
May[28] = new DaysOfYear(5,29,"Tuesday",2007);
May[29] = new DaysOfYear(5,30,"Wednesday",2007);
May[30] = new DaysOfYear(5,31,"Thursday",2007);
June[0] = new DaysOfYear(6,1,"Friday",2007);
June[1] = new DaysOfYear(6,2,"Saturday",2007);
June[2] = new DaysOfYear(6,3,"Sunday",2007);
June[3] = new DaysOfYear(6,4,"Monday",2007);
June[4] = new DaysOfYear(6,5,"Tuesday",2007);
June[5] = new DaysOfYear(6,6,"Wednesday",2007);
June[6] = new DaysOfYear(6,7,"Thursday",2007);
June[7] = new DaysOfYear(6,8,"Friday",2007);
June[8] = new DaysOfYear(6,9,"Saturday",2007);
June[9] = new DaysOfYear(6,10,"Sunday",2007);
June[10] = new DaysOfYear(6,11,"Monday",2007);
June[11] = new DaysOfYear(6,12,"Tuesday",2007);
June[12] = new DaysOfYear(6,13,"Wednesday",2007);
June[13] = new DaysOfYear(6,14,"Thursday",2007);
June[14] = new DaysOfYear(6,15,"Friday",2007);
June[15] = new DaysOfYear(6,16,"Saturday",2007);
June[16] = new DaysOfYear(6,17,"Sunday",2007);
June[17] = new DaysOfYear(6,18,"Monday",2007);
June[18] = new DaysOfYear(6,19,"Tuesday",2007);
June[19] = new DaysOfYear(6,20,"Wednesday",2007);
June[20] = new DaysOfYear(6,21,"Thursday",2007);
June[21] = new DaysOfYear(6,22,"Friday",2007);
June[22] = new DaysOfYear(6,23,"Saturday",2007);
June[23] = new DaysOfYear(6,24,"Sunday",2007);
June[24] = new DaysOfYear(6,25,"Monday",2007);
June[25] = new DaysOfYear(6,26,"Tuesday",2007);
June[26] = new DaysOfYear(6,27,"Wednesday",2007);
June[27] = new DaysOfYear(6,28,"Thursday",2007);
June[28] = new DaysOfYear(6,29,"Friday",2007);
June[29] = new DaysOfYear(6,30,"Saturday",2007);
July[0] = new DaysOfYear(7,1,"Sunday",2007);
July[1] = new DaysOfYear(7,2,"Monday",2007);
July[2] = new DaysOfYear(7,3,"Tuesday",2007);
July[3] = new DaysOfYear(7,4,"Wednesday",2007);
July[4] = new DaysOfYear(7,5,"Thursday",2007);
July[5] = new DaysOfYear(7,6,"Friday",2007);
July[6] = new DaysOfYear(7,7,"Saturday",2007);
July[7] = new DaysOfYear(7,8,"Sunday",2007);
July[8] = new DaysOfYear(7,9,"Monday",2007);
July[9] = new DaysOfYear(7,10,"Tuesday",2007);
July[10] = new DaysOfYear(7,11,"Wednesday",2007);
July[11] = new DaysOfYear(7,12,"Thursday",2007);
July[12] = new DaysOfYear(7,13,"Friday",2007);
July[13] = new DaysOfYear(7,14,"Saturday",2007);
July[14] = new DaysOfYear(7,15,"Sunday",2007);
July[15] = new DaysOfYear(7,16,"Monday",2007);
July[16] = new DaysOfYear(7,17,"Tuesday",2007);
July[17] = new DaysOfYear(7,18,"Wednesday",2007);
July[18] = new DaysOfYear(7,19,"Thursday",2007);
July[19] = new DaysOfYear(7,20,"Friday",2007);
July[20] = new DaysOfYear(7,21,"Saturday",2007);
July[21] = new DaysOfYear(7,22,"Sunday",2007);
July[22] = new DaysOfYear(7,23,"Monday",2007);
July[23] = new DaysOfYear(7,24,"Tuesday",2007);
July[24] = new DaysOfYear(7,25,"Wednesday",2007);
July[25] = new DaysOfYear(7,26,"Thursday",2007);
July[26] = new DaysOfYear(7,27,"Friday",2007);
July[27] = new DaysOfYear(7,28,"Saturday",2007);
July[28] = new DaysOfYear(7,29,"Sunday",2007);
July[29] = new DaysOfYear(7,30,"Monday",2007);
July[30] = new DaysOfYear(7,31,"Tuesday",2007);
August[0] = new DaysOfYear(8,1,"Wednesday",2007);
August[1] = new DaysOfYear(8,2,"Thursday",2007);
August[2] = new DaysOfYear(8,3,"Friday",2007);
August[3] = new DaysOfYear(8,4,"Saturday",2007);
August[4] = new DaysOfYear(8,5,"Sunday",2007);
August[5] = new DaysOfYear(8,6,"Monday",2007);
August[6] = new DaysOfYear(8,7,"Tuesday",2007);
August[7] = new DaysOfYear(8,8,"Wednesday",2007);
August[8] = new DaysOfYear(8,9,"Thursday",2007);
August[9] = new DaysOfYear(8,10,"Friday",2007);
August[10] = new DaysOfYear(8,11,"Saturday",2007);
August[11] = new DaysOfYear(8,12,"Sunday",2007);
August[12] = new DaysOfYear(8,13,"Monday",2007);
August[13] = new DaysOfYear(8,14,"Tuesday",2007);
August[14] = new DaysOfYear(8,15,"Wednesday",2007);
August[15] = new DaysOfYear(8,16,"Thursday",2007);
August[16] = new DaysOfYear(8,17,"Friday",2007);
August[17] = new DaysOfYear(8,18,"Saturday",2007);
August[18] = new DaysOfYear(8,19,"Sunday",2007);
August[19] = new DaysOfYear(8,20,"Monday",2007);
August[20] = new DaysOfYear(8,21,"Tuesday",2007);
August[21] = new DaysOfYear(8,22,"Wednesday",2007);
August[22] = new DaysOfYear(8,23,"Thursday",2007);
August[23] = new DaysOfYear(8,24,"Friday",2007);
August[24] = new DaysOfYear(8,25,"Saturday",2007);
August[25] = new DaysOfYear(8,26,"Sunday",2007);
August[26] = new DaysOfYear(8,27,"Monday",2007);
August[27] = new DaysOfYear(8,28,"Tuesday",2007);
August[28] = new DaysOfYear(8,29,"Wednesday",2007);
August[29] = new DaysOfYear(8,30,"Thursday",2007);
August[30] = new DaysOfYear(8,31,"Friday",2007);
September[0] = new DaysOfYear(9,1,"Saturday",2007);
September[1] = new DaysOfYear(9,2,"Sunday",2007);
September[2] = new DaysOfYear(9,3,"Monday",2007);
September[3] = new DaysOfYear(9,4,"Tuesday",2007);
September[4] = new DaysOfYear(9,5,"Wednesday",2007);
September[5] = new DaysOfYear(9,6,"Thursday",2007);
September[6] = new DaysOfYear(9,7,"Friday",2007);
September[7] = new DaysOfYear(9,8,"Saturday",2007);
September[8] = new DaysOfYear(9,9,"Sunday",2007);
September[9] = new DaysOfYear(9,10,"Monday",2007);
September[10] = new DaysOfYear(9,11,"Tuesday",2007);
September[11] = new DaysOfYear(9,12,"Wednesday",2007);
September[12] = new DaysOfYear(9,13,"Thursday",2007);
September[13] = new DaysOfYear(9,14,"Friday",2007);
September[14] = new DaysOfYear(9,15,"Saturday",2007);
September[15] = new DaysOfYear(9,16,"Sunday",2007);
September[16] = new DaysOfYear(9,17,"Monday",2007);
September[17] = new DaysOfYear(9,18,"Tuesday",2007);
September[18] = new DaysOfYear(9,19,"Wednesday",2007);
September[19] = new DaysOfYear(9,20,"Thursday",2007);
September[20] = new DaysOfYear(9,21,"Friday",2007);
September[21] = new DaysOfYear(9,22,"Saturday",2007);
September[22] = new DaysOfYear(9,23,"Sunday",2007);
September[23] = new DaysOfYear(9,24,"Monday",2007);
September[24] = new DaysOfYear(9,25,"Tuesday",2007);
September[25] = new DaysOfYear(9,26,"Wednesday",2007);
September[26] = new DaysOfYear(9,27,"Thursday",2007);
September[27] = new DaysOfYear(9,28,"Friday",2007);
September[28] = new DaysOfYear(9,29,"Saturday",2007);
September[29] = new DaysOfYear(9,30,"Sunday",2007);
October[0] = new DaysOfYear(10,1,"Monday",2007);
October[1] = new DaysOfYear(10,2,"Tuesday",2007);
October[2] = new DaysOfYear(10,3,"Wednesday",2007);
October[3] = new DaysOfYear(10,4,"Thursday",2007);
October[4] = new DaysOfYear(10,5,"Friday",2007);
October[5] = new DaysOfYear(10,6,"Saturday",2007);
October[6] = new DaysOfYear(10,7,"Sunday",2007);
October[7] = new DaysOfYear(10,8,"Monday",2007);
October[8] = new DaysOfYear(10,9,"Tuesday",2007);
October[9] = new DaysOfYear(10,10,"Wednesday",2007);
October[10] = new DaysOfYear(10,11,"Thursday",2007);
October[11] = new DaysOfYear(10,12,"Friday",2007);
October[12] = new DaysOfYear(10,13,"Saturday",2007);
October[13] = new DaysOfYear(10,14,"Sunday",2007);
October[14] = new DaysOfYear(10,15,"Monday",2007);
October[15] = new DaysOfYear(10,16,"Tuesday",2007);
October[16] = new DaysOfYear(10,17,"Wednesday",2007);
October[17] = new DaysOfYear(10,18,"Thursday",2007);
October[18] = new DaysOfYear(10,19,"Friday",2007);
October[19] = new DaysOfYear(10,20,"Saturday",2007);
October[20] = new DaysOfYear(10,21,"Sunday",2007);
October[21] = new DaysOfYear(10,22,"Monday",2007);
October[22] = new DaysOfYear(10,23,"Tuesday",2007);
October[23] = new DaysOfYear(10,24,"Wednesday",2007);
October[24] = new DaysOfYear(10,25,"Thursday",2007);
October[25] = new DaysOfYear(10,26,"Friday",2007);
October[26] = new DaysOfYear(10,27,"Saturday",2007);
October[27] = new DaysOfYear(10,28,"Sunday",2007);
October[28] = new DaysOfYear(10,29,"Monday",2007);
October[29] = new DaysOfYear(10,30,"Tuesday",2007);
October[30] = new DaysOfYear(10,31,"Wednesday",2007);
November[0] = new DaysOfYear(11,1,"Thursday",2007);
November[1] = new DaysOfYear(11,2,"Friday",2007);
November[2] = new DaysOfYear(11,3,"Saturday",2007);
November[3] = new DaysOfYear(11,4,"Sunday",2007);
November[4] = new DaysOfYear(11,5,"Monday",2007);
November[5] = new DaysOfYear(11,6,"Tuesday",2007);
November[6] = new DaysOfYear(11,7,"Wednesday",2007);
November[7] = new DaysOfYear(11,8,"Thursday",2007);
November[8] = new DaysOfYear(11,9,"Friday",2007);
November[9] = new DaysOfYear(11,10,"Saturday",2007);
November[10] = new DaysOfYear(11,11,"Sunday",2007);
November[11] = new DaysOfYear(11,12,"Monday",2007);
November[12] = new DaysOfYear(11,13,"Tuesday",2007);
November[13] = new DaysOfYear(11,14,"Wednesday",2007);
November[14] = new DaysOfYear(11,15,"Thursday",2007);
November[15] = new DaysOfYear(11,16,"Friday",2007);
November[16] = new DaysOfYear(11,17,"Saturday",2007);
November[17] = new DaysOfYear(11,18,"Sunday",2007);
November[18] = new DaysOfYear(11,19,"Monday",2007);
November[19] = new DaysOfYear(11,20,"Tuesday",2007);
November[20] = new DaysOfYear(11,21,"Wednesday",2007);
November[21] = new DaysOfYear(11,22,"Thursday",2007);
November[22] = new DaysOfYear(11,23,"Friday",2007);
November[23] = new DaysOfYear(11,24,"Saturday",2007);
November[24] = new DaysOfYear(11,25,"Sunday",2007);
November[25] = new DaysOfYear(11,26,"Monday",2007);
November[26] = new DaysOfYear(11,27,"Tuesday",2007);
November[27] = new DaysOfYear(11,28,"Wednesday",2007);
November[28] = new DaysOfYear(11,29,"Thursday",2007);
November[29] = new DaysOfYear(11,30,"Friday",2007);



function DoWriteDaysDep(themonth,theyear) {
var thegivenmonth = parseInt(themonth);
var thegivenyear = parseInt(theyear);
var theMonthsSelect = document.forms["charter"]["selectDepMonth"];
var theMonthsSelectedValue = theMonthsSelect.options[theMonthsSelect.selectedIndex].value;
var theDaysSelect = document.getElementById("selectDepDay");
var thelengthOfDays ;
var monthFoundInArray = 0;
var theselectOptionCounter = 1;
var theCurrentMonth = 0;
var theCheckingMonth = 0;
//alert("All data loaded , " + thelengthOfDays + "elements are in the days array");

theDaysSelect.options.length = 0;
theDaysSelect.options[0] = new Option("select an available date","none");

  switch(thegivenmonth){
	  case 3 :
		for(var thecounter=0;thecounter<=March.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(March[thecounter].dayNum + "/" +
			March[thecounter].month + "/" + March[thecounter].year + " (" + March[thecounter].dayText + ")",
			March[thecounter].dayNum + "/" + March[thecounter].month + "/" + March[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=March.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  case 4 :
	  	for(var thecounter=0;thecounter<=April.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(April[thecounter].dayNum + "/" +
			April[thecounter].month + "/" + April[thecounter].year + " (" + April[thecounter].dayText + ")",
			April[thecounter].dayNum + "/" + April[thecounter].month + "/" + April[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=April.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  case 5 :
	  	for(var thecounter=0;thecounter<=May.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(May[thecounter].dayNum + "/" +
			May[thecounter].month + "/" + May[thecounter].year + " (" + May[thecounter].dayText + ")",
			May[thecounter].dayNum + "/" + May[thecounter].month + "/" + May[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=May.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  
	  case 6 :
	  	for(var thecounter=0;thecounter<=June.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(June[thecounter].dayNum + "/" +
			June[thecounter].month + "/" + June[thecounter].year + " (" + June[thecounter].dayText + ")",
			June[thecounter].dayNum + "/" + June[thecounter].month + "/" + June[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=June.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	   case 7 :
	   	for(var thecounter=0;thecounter<=July.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(July[thecounter].dayNum + "/" +
			July[thecounter].month + "/" + July[thecounter].year + " (" + July[thecounter].dayText + ")",
			July[thecounter].dayNum + "/" + July[thecounter].month + "/" + July[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=July.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	   case 8 :
	   	for(var thecounter=0;thecounter<=August.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(August[thecounter].dayNum + "/" +
			August[thecounter].month + "/" + August[thecounter].year + " (" + August[thecounter].dayText + ")",
			August[thecounter].dayNum + "/" + August[thecounter].month + "/" + August[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=August.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 9 : 
			for(var thecounter=0;thecounter<=September.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(September[thecounter].dayNum + "/" +
			September[thecounter].month + "/" + September[thecounter].year + " (" + September[thecounter].dayText + ")",
			September[thecounter].dayNum + "/" + September[thecounter].month + "/" + September[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=September.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 10 :
			for(var thecounter=0;thecounter<=October.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(October[thecounter].dayNum + "/" +
			October[thecounter].month + "/" + October[thecounter].year + " (" + October[thecounter].dayText + ")",
			October[thecounter].dayNum + "/" + October[thecounter].month + "/" + October[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=October.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 11 :
			for(var thecounter=0;thecounter<=November.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(November[thecounter].dayNum + "/" +
			November[thecounter].month + "/" + November[thecounter].year + " (" + November[thecounter].dayText + ")",
			November[thecounter].dayNum + "/" + November[thecounter].month + "/" + November[thecounter].year);
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=November.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  
	  }

alert ("You gave : " + thegivenmonth);

}
//
function DoWriteDaysArr(themonth,theyear) {
var thegivenmonth = parseInt(themonth);
var thegivenyear = parseInt(theyear);
var theMonthsSelect = document.forms["charter"]["selectArrMonth"];
var theMonthsSelectedValue = theMonthsSelect.options[theMonthsSelect.selectedIndex].value;
var theDaysSelect = document.getElementById("selectArrDay");
//var theDaysToCheck = theDaysSelect - theDaystarget;


var monthFoundInArray = 0;
var theselectOptionCounter = 1;
var theCurrentMonth = 0;
var theCheckingMonth = 0;
//alert("All data loaded , " + thelengthOfDays + "elements are in the days array");

theDaysSelect.options.length = 0;
theDaysSelect.options[0] = new Option("select an available date","none");

  switch(thegivenmonth){
	  case 3 :
		for(var thecounter=0;thecounter<=March.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(March[thecounter].dayNum + "/" +
			March[thecounter].month + "/" + March[thecounter].year + " (" + March[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=March.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  case 4 :
	  	for(var thecounter=0;thecounter<=April.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(April[thecounter].dayNum + "/" +
			April[thecounter].month + "/" + April[thecounter].year + " (" + April[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=April.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  case 5 :
	  	for(var thecounter=0;thecounter<=May.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(May[thecounter].dayNum + "/" +
			May[thecounter].month + "/" + May[thecounter].year + " (" + May[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=May.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  
	  case 6 :
	  	for(var thecounter=0;thecounter<=June.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(June[thecounter].dayNum + "/" +
			June[thecounter].month + "/" + June[thecounter].year + " (" + June[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=June.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	   case 7 :
	   	for(var thecounter=0;thecounter<=July.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(July[thecounter].dayNum + "/" +
			July[thecounter].month + "/" + July[thecounter].year + " (" + July[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=July.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	   case 8 :
	   	for(var thecounter=0;thecounter<=August.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(August[thecounter].dayNum + "/" +
			August[thecounter].month + "/" + August[thecounter].year + " (" + August[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=August.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 9 : 
			for(var thecounter=0;thecounter<=September.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(September[thecounter].dayNum + "/" +
			September[thecounter].month + "/" + September[thecounter].year + " (" + September[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=September.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 10 :
			for(var thecounter=0;thecounter<=October.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(October[thecounter].dayNum + "/" +
			October[thecounter].month + "/" + October[thecounter].year + " (" + October[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=October.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
		case 11 :
			for(var thecounter=0;thecounter<=November.length;thecounter++){
		    theDaysSelect.options[theselectOptionCounter] = new Option(November[thecounter].dayNum + "/" +
			November[thecounter].month + "/" + November[thecounter].year + " (" + November[thecounter].dayText + ")");
			//
			
			theselectOptionCounter = theselectOptionCounter + 1;
		}
		theselectOptionCounter = 1;
		for(var thecounter=0;thecounter<=November.length;thecounter++){
		    theDaysSelect.add(theDaysSelect.options[theselectOptionCounter],theselectOptionCounter)
			
     		theselectOptionCounter = theselectOptionCounter + 1
		}
	  
	  }

alert ("You gave : " + thegivenmonth);

}
//
function doSubmit(form){
var theform = document.forms["charter"];
var thelement = form.elements["search_2"].value;
alert (thelement);
if ((thelement=="none") || (thelement==null)){
	alert ("Wrong yacht id. Please select a correct option from the yachts available.");}
	else {
form.action = "http://web.dolphinyachts.gr/main.asp?pageId=3&charterwiz=1&yacht=ok&searchtype=departure";
form.submit();}
	
}
function SetDefaults() {
var theGroupradio = document.forms["charter"]["search_method"];
//var theTdCell_1 = document.getElementById("selection1");
//var theTdCell_2 = document.getElementById("selection2");
var theFirstCriteria = document.getElementById("search_1");
var theSecondCriteria = document.getElementById("search_2");
var theyachtRental = document.forms["charter"]["yachtRental"];
var theyachtRentalValue = theyachtRental.options[theyachtRental.selectedIndex].value;
var theYachtype = document.forms["charter"]["yachtSailer"];
var thechosenyachtype = theYachtype.options[theYachtype.selectedIndex].value;
	theFirstCriteria.options.length = 0;
    theFirstCriteria.options[0] = new Option("select an option","none");
	theFirstCriteria.add(theFirstCriteria.options[0],0);
	theSecondCriteria.options.length = 0;
	theSecondCriteria.options[0] = new Option("select an option","none");
	theSecondCriteria.add(theSecondCriteria.options[0],0);
}
function DisplaySecondCriteria() {
var theGroupradio = document.getElementById("search_method");
//var theTdCell_1 = document.getElementById("selection1");
//var theTdCell_2 = document.getElementById("selection2");
var theFirstCriteria = document.getElementById("search_1");
var theSecondCriteria = document.getElementById("search_2");
var theyachtRental = document.forms["charter"]["yachtRental"];
var theyachtRentalValue = theyachtRental.options[theyachtRental.selectedIndex].value;
var theYachtype = document.forms["charter"]["yachtSailer"];
var thechosenyachtype = theYachtype.options[theYachtype.selectedIndex].value;

	if (parseInt(theGroupradio.options[theGroupradio.selectedIndex].value) != -1) {
		switch (parseInt(theGroupradio.options[theGroupradio.selectedIndex].value)) {
			case 0 : 
				theSecondCriteria.options.length = 0;
			case 1 :
				   	switch (parseInt(theFirstCriteria.selectedIndex)){
						case 0 :
							theSecondCriteria.options.length = 0;
						case 1 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Oceanis 461 (Kolossos)","3");
							theSecondCriteria.options[2] = new Option("Sun Odyssey 452 (Godfriend)","1");
							theSecondCriteria.options[3] = new Option("Sun Odyssey 422 (Frixos)","0");
							theSecondCriteria.options[4] = new Option("Sun Odyssey 421 (Iliada)","2");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							theSecondCriteria.add(theSecondCriteria.options[4],4);
							break;
						case 2 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Oceanis 351/1995 (Pegassus II)","6");
							theSecondCriteria.options[2] = new Option("Oceanis 351/1994 (Pegassus)","4");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							break;
						case 3 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Moody 336 (Ariadne)","5");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							break;}
				//LoadSelectOption1(theIntyachter);
				
			case 2 :
					switch (parseInt(theFirstCriteria.selectedIndex)){
						case 0 :
							theSecondCriteria.options.length = 0;
						case 1 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
							theSecondCriteria.options[1] = new Option("Oceanis 351/1995 (Pegassus II)","6");
							theSecondCriteria.options[2] = new Option("Oceanis 351/1994 (Pegassus)","4");
							theSecondCriteria.options[3] = new Option("Moody 336 (Ariadne)","5");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							break;
						case 2 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Oceanis 461 (Kolossos)","3");
							theSecondCriteria.options[2] = new Option("Sun Odyssey 452 (Godfriend)","1");
							theSecondCriteria.options[3] = new Option("Sun Odyssey 422 (Frixos)","0");
							theSecondCriteria.options[4] = new Option("Sun Odyssey 421 (Iliada)","2");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							theSecondCriteria.add(theSecondCriteria.options[4],4);
							break;
						}
				//LoadSelectOption1(theyachter);
				break;
			case 3 :
					switch (parseInt(theFirstCriteria.selectedIndex)){
						case 0 :
							theSecondCriteria.options.length = 0;
						case 1 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
							theSecondCriteria.options[1] = new Option("Sun Odyssey 452 (Godfriend)","1");
							theSecondCriteria.options[2] = new Option("Sun Odyssey 422 (Frixos)","0");
							theSecondCriteria.options[3] = new Option("Sun Odyssey 421 (Iliada)","2");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							break;
						case 2 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
							theSecondCriteria.options[1] = new Option("Oceanis 461 (Kolossos)","3");
			        		theSecondCriteria.options[2] = new Option("Oceanis 351/1995 (Pegassus II)","6");
							theSecondCriteria.options[3] = new Option("Oceanis 351/1994 (Pegassus)","4");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							break;
						case 3 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Moody 336 (Ariadne)","5");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							break;}
				
				break;
				case 4 :
					switch (parseInt(theFirstCriteria.selectedIndex)){
						case 0 :
							theSecondCriteria.options.length = 0;
						case 1 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
							theSecondCriteria.options[1] = new Option("Sun Odyssey 452 (Godfriend)","1");
							theSecondCriteria.options[2] = new Option("Sun Odyssey 422 (Frixos)","0");
							theSecondCriteria.options[3] = new Option("Sun Odyssey 421 (Iliada)","2");
							theSecondCriteria.options[4] = new Option("Oceanis 461 (Kolossos)","3");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							theSecondCriteria.add(theSecondCriteria.options[3],3);
							theSecondCriteria.add(theSecondCriteria.options[4],4);
							break;
						case 2 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Oceanis 351/1995 (Pegassus II)","6");
							theSecondCriteria.options[2] = new Option("Oceanis 351/1994 (Pegassus)","4");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							theSecondCriteria.add(theSecondCriteria.options[2],2);
							break;
						case 3 :
							theSecondCriteria.options.length = 0;
				    		theSecondCriteria.options[0] = new Option("select an option","none");
			        		theSecondCriteria.options[1] = new Option("Moody 336 (Ariadne)","5");
							theSecondCriteria.add(theSecondCriteria.options[0],0);
							theSecondCriteria.add(theSecondCriteria.options[1],1);
							break;}
				
				break;
				}//end of main switch
				}//end of if 
}
var theIntyachter;
function doSelectSearch() {
var theGroupradio = document.getElementById("search_method");
//var theTdCell_1 = document.getElementById("selection1");
//var theTdCell_2 = document.getElementById("selection2");
var theFirstCriteria = document.getElementById("search_1");
var theSecondCriteria = document.getElementById("search_2");
var theyachtRental = document.forms["charter"]["yachtRental"];
var theyachtRentalValue = theyachtRental.options[theyachtRental.selectedIndex].value;
var theYachtype = document.forms["charter"]["yachtSailer"];
var thechosenyachtype = theYachtype.options[theYachtype.selectedIndex].value;
theSecondCriteria.options.length = 0;
//if (parseInt(theyachtRentalValue) == 1 && parseInt(thechosenyachtype)==1) {
		switch (parseInt(theGroupradio.options[theGroupradio.selectedIndex].value)) {
			case 1 :
				//theTdCell_1.innerHTML = "You chose the " + theIntyachter + " element";
			    
					theFirstCriteria.options.length = 0;
				    theFirstCriteria.options[0] = new Option("select an option","0");
			        theFirstCriteria.options[1] = new Option("4 cabins","1");
					theFirstCriteria.options[2] = new Option("3 cabins","2");
					theFirstCriteria.options[3] = new Option("2 cabins","3");
					theFirstCriteria.add(theFirstCriteria.options[0],0);
					theFirstCriteria.add(theFirstCriteria.options[1],1);
					theFirstCriteria.add(theFirstCriteria.options[2],2);
					theFirstCriteria.add(theFirstCriteria.options[3],3);
				
				//LoadSelectOption1(theIntyachter);
				break;
			case 2 :
				//theTdCell_1.innerHTML = "You chose the " + theIntyachter + " element";
				
					theFirstCriteria.options.length = 0;
				    theFirstCriteria.options[0] = new Option("select an option","0");
			        theFirstCriteria.options[1] = new Option("up to 12 meters","1");
					theFirstCriteria.options[2] = new Option("more than 12 meters","2");
					theFirstCriteria.add(theFirstCriteria.options[0],0);
					theFirstCriteria.add(theFirstCriteria.options[1],1);
					theFirstCriteria.add(theFirstCriteria.options[2],2);

				
				//LoadSelectOption1(theyachter);
				break;
			case 3 :
				//theTdCell_1.innerHTML = "You chose the " + theIntyachter + " element";
				
					theFirstCriteria.options.length = 0;
				    theFirstCriteria.options[0] = new Option("select an option","0");
			        theFirstCriteria.options[1] = new Option("Jeanneau","1");
					theFirstCriteria.options[2] = new Option("Beneteau","2");
					theFirstCriteria.options[3] = new Option("Moody","3");
					theFirstCriteria.add(theFirstCriteria.options[0],0);
					theFirstCriteria.add(theFirstCriteria.options[1],1);
					theFirstCriteria.add(theFirstCriteria.options[2],2);
					theFirstCriteria.add(theFirstCriteria.options[3],3);
				
					

				//LoadSelectOption1(theyachter);
				break;
			case 4:
					theFirstCriteria.options.length = 0;
				    theFirstCriteria.options[0] = new Option("select an option","0");
			        theFirstCriteria.options[1] = new Option("8-10 persons","1");
					theFirstCriteria.options[2] = new Option("6-8 persons","2");
					theFirstCriteria.options[3] = new Option("4-6 persons","3");
					theFirstCriteria.add(theFirstCriteria.options[0],0);
					theFirstCriteria.add(theFirstCriteria.options[1],1);
					theFirstCriteria.add(theFirstCriteria.options[2],2);
					theFirstCriteria.add(theFirstCriteria.options[3],3);
			case 0:
				alert("Wrong selection");
		
	//}
}

}

function LoadSelectOption1(innerI){
var theboattype  = document.getElementById("allYachts");
var theboattype1 = document.getElementById("selectyachts2");
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
theboattype1.options.length = 0 ;
switch (parseInt(innerI)) {
	case 0 :
			theboattype.options[0] = new Option("select an option","none");
			theboattype.options[1] = new Option("Monohull","../main.asp?pageId=11&yachttype=1");
			theboattype.options[2] = new Option("Multihull","../main.asp?pageId=11&yachttype=0");
			theboattype.add(theboattype.options[0],0);
			theboattype.add(theboattype.options[1],1);
			theboattype.add(theboattype.options[2],2);
		break;
		
	case 1 :
			theboattype.options[0] = new Option("select an option","none");
			theboattype.options[1] = new Option("Monohull","../main.asp?pageId=11&yachttype=1");
			theboattype.options[2] = new Option("Multihull","../main.asp?pageId=11&yachttype=0");
			theboattype.add(theboattype.options[0],0);
			theboattype.add(theboattype.options[1],1);
			theboattype.add(theboattype.options[2],2);
		break;
		
	case 2 :
			theboattype.options[0] = new Option("select an option","none");
			theboattype.options[1] = new Option("Monohull","../main.asp?pageId=11&yachttype=1");
			theboattype.options[2] = new Option("Multihull","../main.asp?pageId=11&yachttype=0");
			theboattype.add(theboattype.options[0],0);
			theboattype.add(theboattype.options[1],1);
			theboattype.add(theboattype.options[2],2);
		break;
	default :
		theboattype.options[0] = new Option("not available","none");
 		theboattype.add(theboattype.options[0],0);
}
}
//Functions for page 6
function ShowChoice() {
var AnswerArray = new Array(4);	
AnswerArray[0] = "(It is my first time sailing)";
AnswerArray[1] = "(I have sailed before a couple of times)";
AnswerArray[2] = "(I have sailed more that 5 times and I have a good experience)";
AnswerArray[3] = "(I have sailed many times , I like sailing and I rent on a regular basis)";
AnswerArray[4] = "(I am a professional skipper)";	

var TheExperienceText = document.frmMainContact.elements["txtExperience"];
var TheSelectExper = document.frmMainContact.elements["selectExperience"].value;
var TheChoicer = parseInt(TheSelectExper);
window.alert (TheChoicer);
if (TheChoicer!= -1) {
	TheExperienceText.value = AnswerArray[TheChoicer];
} else {
    window.alert("Please specify a correct choice.");
	TheExperienceText.value = "Please write a correct description or choose a correct option from the listbox , above.";
}
}


//End of Functions for page 6
//Functions for page 9










//Functions for page 11
function LoadSelect1(){
var theboattype  = document.getElementById("selectyachts1");
var theboattype1 = document.getElementById("selectyachts2");
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
theboattype1.options.length = 0 ;
if (parseInt(thechosenone)==2){
    theboattype1.options[0] = new Option("select an option","none");
	theboattype1.options[1] = new Option("Monohull","../mainfile.asp?pageId=11&yachttype=1");
	theboattype1.options[2] = new Option("Multihull","../mainfile.asp?pageId=11&yachttype=0");
	theboattype1.add(theboattype1.options[0],0);
	theboattype1.add(theboattype1.options[1],1);
	theboattype1.add(theboattype1.options[2],2);
	}
else {
 theboattype1.options[0] = new Option("not available","none");
 theboattype1.add(theboattype1.options[0],0);
 } 
}
function LoadSelect_2(){
var IsOk = false;
var theboattype1  = document.getElementById("selectyachts1");
var theboattype = document.getElementById("selectyachts2");
var theboatbase = document.getElementById("selectyachts3");
//var thesailingyachts = form.reqavailboats;
var thechosenone1 = theboattype1.options[theboattype1.selectedIndex].text;
var thechosenone = theboattype.options[theboattype.selectedIndex].text;
var thechosenbase = theboatbase.options[theboatbase.selectedIndex].value;
if ((thechosenone1=="motor sailer") && (thechosenone=="Monohull") && (thechosenbase=="corfu" || thechosenbase=="lefkas")) IsOk = true;
else IsOk = false;
if (IsOk==true) window.location.href=theboattype.options[theboattype.selectedIndex].value + "&base=" + thechosenbase;
else window.alert ("Please only the Motor sailer/Monohull option is available for the moment","Dolphin Yachts");
}
function LoadSelect_3(){
var theboattype = document.getElementById("selectyachts");
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
window.location.href=theboattype.options[theboattype.selectedIndex].value;
}

//ApplyDefaults(){}
//
function LoadXMLBookings(urlBoat) {
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"

xmlDoc.load("../xml/bookings/" + urlBoat + ".xml")
nodes = xmlDoc.documentElement.childNodes
to.innerText = nodes.item(0).text
from.innerText = nodes.item(1).text
header.innerText = nodes.item(2).text
body.innerText = nodes.item(3).text
}
function LoadXMLPage(urlPage) {
var requester = document.getElementById("results").getElementsByTagName("main");
var thePElement = document.getElementById("MainPageAreaP1");
/*try
{
 requester = new XMLHttpRequest();
}
catch (error)
{
  try
   {
    request = new ActiveXObject("Microsoft.XMLHTTP");
   }
  catch (error)
   {
    request = null;
   } 
}  	  
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

xmlDoc.async="false";

xmlDoc.load("http://web.dolphinyachts.gr/xml/pages/" + parseInt(urlPage) + ".xml");
nodes = xmlDoc.documentElement.childNodes;*/
thePElement.innerText = requester.text;
/*from.innerText = nodes.item(1).text
header.innerText = nodes.item(2).text
body.innerText = nodes.item(3).text*/
}
//Page 8

function LoadMaps () {
 var theAreasSelect = document.getElementById("areas");
 var theRegionsSelect = document.getElementById("regions");
 var theSelectedRegion = theRegionsSelect.options[theRegionsSelect.selectedIndex].value;
 var theSelectedArea = theAreasSelect.options[theAreasSelect.selectedIndex].value;
 theRegionsSelect.options.length = 0;
 switch (parseInt(theSelectedArea)) {
	 case 0 :
	  theRegionsSelect.options[0] = new Option("select an option","none");
	  theRegionsSelect.add(theRegionsSelect.options[0],0);
	 case 1 :
	  theRegionsSelect.options[0] = new Option("select an option","none");
	  theRegionsSelect.options[1] = new Option("Corfu","../test.asp?pageId=08&area=ionian&region=corfu");
	  theRegionsSelect.options[2] = new Option("Lefkas","../test.asp?pageId=08&area=ionian&region=lefkas");
	  theRegionsSelect.add(theRegionsSelect.options[0],0);
	  theRegionsSelect.add(theRegionsSelect.options[1],1);
	  theRegionsSelect.add(theRegionsSelect.options[2],2);
 }  
}
function ShowAreas() {
 	var theAreasSelect = document.getElementById("areas");
    var theSelectedArea = theAreasSelect.options[theAreasSelect.selectedIndex].value;
	if (theSelectedArea!="none") {
		window.location.href = theAreasSelect.options[theAreasSelect.selectedIndex].value;}
	else window.alert("Please do select a valid choice");
	 
	  /*theAreasSelect.options[0] = new Option("select an option","none");
	  theAreasSelect.options[1] = new Option("Corfu","../main.asp?pageId=8&area=ionian");
	  theAreasSelect.options[2] = new Option("Lefkas","../main.asp?pageId=8&area=ionian");
	  theAreasSelect.add(theAreasSelect.options[0],0);
	  theAreasSelect.add(theAreasSelect.options[1],1);
	  theAreasSelect.add(theAreasSelect.options[2],2);*/
     //window.alert(theSelectedArea);
	
}
function ShowRegions() {
    var theRegionsSelect = document.getElementById("regions");
	var theSelectedRegion = theRegionsSelect.options[theRegionsSelect.selectedIndex].value;
	//window.alert(theSelectedRegion);
	if (theSelectedRegion!="none") {
		window.location.href = theRegionsSelect.options[theRegionsSelect.selectedIndex].value;}
	else window.alert("Please do select a valid choice");
	
}
function ShowMaps() {
    var theMapsSelect = document.getElementById("maps");
	var theSelectedMap = theMapsSelect.options[theMapsSelect.selectedIndex].value;
	//window.alert(theSelectedRegion);
	if (theSelectedMap!="none") {
		window.location.href = theMapsSelect.options[theMapsSelect.selectedIndex].value;}
	else window.alert("Please do select a valid choice");
	
}
//Page 9
function ServeInventoryXML() {
var theyacht  = document.getElementById("theyacht");

var thechosenone = theyacht.options[theyacht.selectedIndex].value;
window.alert(thechosenone);
if (thechosenone!="none") 
 //window.location.href = theyacht.options[theyacht.selectedIndex].value;}
 //LoadXMLBookings()
 window.alert(thechosenone);
 document.location.href = "../main.asp?pageId=9&showInventory=1&yachtId=" + thechosenone;
}
function LoadSelectButtonTools(){
var theboattype  = document.getElementById("xmlyachtype");
var theboattype1 = document.getElementById("xmlyachtype2");
//var thesailingyachts = form.reqavailboats;
var thechosenone = theboattype.options[theboattype.selectedIndex].value;
theboattype1.options.length = 0 ;
if (parseInt(thechosenone)==2){
    theboattype1.options[0] = new Option(Monohull[1].name,Monohull[1].name);
	theboattype1.options[1] = new Option(Monohull[2].name,Monohull[2].name);
	theboattype1.options[2] = new Option(Monohull[3].name,Monohull[3].name);
	theboattype1.options[3] = new Option(Monohull[4].name,Monohull[4].name);
	theboattype1.options[4] = new Option(Monohull[5].name,Monohull[5].name);
	theboattype1.options[5] = new Option(Monohull[6].name,Monohull[6].name);
	theboattype1.options[6] = new Option(Monohull[7].name,Monohull[7].name);
	theboattype1.add(theboattype1.options[0],0);
	theboattype1.add(theboattype1.options[1],1);
	theboattype1.add(theboattype1.options[2],2);
	theboattype1.add(theboattype1.options[3],3);
	theboattype1.add(theboattype1.options[4],4);
	theboattype1.add(theboattype1.options[5],5);
	theboattype1.add(theboattype1.options[6],6);
	}
else {
 theboattype1.options[0] = new Option("not available","none");
 theboattype1.add(theboattype1.options[0],0);
 } 
}