// ***
// *** Engine Javascript Setup ***
// ***
// *** Array of Supported browsers (uses the navigator.userAgent function) ***
var browser = new Array ('MSIE 6.0','MSIE 7.0', 'MSIE 8.0', 'Opera', 'Firefox', 'Safari');
// *** Array of Supported Platforms (uses the navigator.platform function) ***
var os = new Array ('Win32', 'Linux', 'MacPPC', 'Mac');
// *** Redirect URL for unsupported Browsers and Platforms
unsuppRedirURL = 'http://greekferries.forth-crs.gr/italian/_browse/notcomp2.htm';

// *** Passenger Values ***
var totPass = 6;
var defPass = 2;

// *** Vehicle Values ***
var totVeh  = 2;
var defVeh  = 0;

// *** RoundTrip Engine ***
// RoundTrip = 'R' (roundtrip engine) or 
// 						 'M' (multileg engine)  or
// 						 'L' (multileg engine Locked on leg2i)
var roundtrip = 'M';

// *** Date Validation  ***
// Defines the invalid operator for the Date of the Incoming Route
// GT  = Greater Than (Incoming MUST BE GREATER Than Ougoing)
// GTE = Greater Than Or Equal (Incoming MUST BE GREATER OR EQUAL Than Ougoing)
var dtValidation = 'GT';

// *** Template CSS Definition ***
var templateCSS        = '_master_greekferries.css';  

// *** Various Consts  ***
var sitelanguage       = 'IT';	  // The Language of the site (EN, IT) in order to build the calendar captions
var rvDaysGap          = 5;       // Number of days between today and reservation day, we allow reservations
var multiLegEngine     = true;	  // If multileg option is enabled
var showCourrier       = true;    // If has courrier on step 5
var showCourrierMinVal = 0;       // Min TotalValue required to show Courrier
var autoSelectWhole    = true;    // Auto Select "Whole" on Step2 when "Class of Type > 1"
var VehicleLicenseStep = 2;       // The step (2 or 4) where we're asking the Vehicle License Number
var showCompanyVessel  = true;    // If the company of the vessel is shown on ViewAllRoutes
var showRouteInfo      = false;	  // Show the basic fares and Route details, as the 1st machine
var handlingFeesCtrl   = 2;       // Controls the division with the Included Handling Fees on Step 5
				    // 0 = no service fee at all				     // If 0, I don't care about the value of the var 'handlingFees' 
				    // 1 = service fee in total price (including courier cost) // If 1 the handling fees are calculated on the total (reservation + courrier)
				    // 2 = service fee only in ticket price		     // If 2 the  handling fees are calculated on reservation only
                                  // Changed with '0' in following routines
var handlingFees       = 0;       // Handling Fees %, INCLUCED on the total Price
var serviceFeePrice    = 15;	  // Flat Service Fee added at the ticket price
var showContactComments= false;   // If the <#CONTACTCOMMENTS> on Step 5 will be visible 
var showVehicleSelect  = true;    // If we're showing the vehicle select
var showRouteAtTitle   = false;   // If the Route is shown on ViewAllRoutes.
var showKioskComp      = false;    // If the kiosk radio button is shown(PTA) 
var cbmDimension       = 165;     //Change dimension cmb trip oneway, rountrip, multileg 
var showinternational  = false;     //show step4 PassIDLeg, BirthDateLeg input
var no_delivery        = false;   //step5 non delivery and our office
var terms_coditions    = false;    //show the checkbox for terms&conditions step5
var radio_step2        = false;    //Close to step2 the radio buttons.
var jsbankEnable       = true;    //Banck and close Browser
var showweather        = false;   //oneway roundtrip
var showcurrencies     = false;   //stp3 and step5
var freeports          = false;   //Free ports to roundtrip. Change var roundtrip = 'R' with 'M'  

// *** Code for Logo
var headerLogo=
'<h1 style=\"color:#FFFFFF;\">Traghetti per le isole greche – prenotazioni online di tutti traghetti greci</h1>'+
'<div id=\"header\" align=\"center\">'+
'<div id=\"left\">'+
'<div id=\"clockAthens\" class=\"clocks\">'+
'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"40\" height=\"40\">'+
'<param name=\"movie\" value=\"../../img_header/flash/clkAthens.swf\" />'+
'<param name=\"quality\" value=\"high\" />'+
'<param name=\"wmode\" value=\"transparent\" />'+
'<embed src=\"../../img_header/flash/clkAthens.swf\" width=\"40\" height=\"40\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"> </embed>'+
'</object>'+
'<span class=\"white11\">Athens</span>'+
'</div>'+
'<div id=\"clockLondon\" class=\"clocks\">'+
'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=\"flaClockLondon\" width=\"40\" height=\"40\">'+
'<param name=\"movie\" value=\"../../img_header/flash/clkLondon.swf\" />'+
'<param name=\"quality\" value=\"high\" />'+
'<param name=\"wmode\" value=\"transparent\" />'+
'<embed src=\"../../img_header/flash/clkLondon.swf\" width=\"40\" height=\"40\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"> </embed>'+
'</object>'+
'<span class=\"white11\">&nbsp;London</span>'+
'</div>'+
'<div id=\"clockNewYork\" class=\"clocks\">'+
'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=\"flaClockNewYork\" width=\"40\" height=\"40\">'+
'<param name=\"movie\" value=\"../../img_header/flash/clkNewYork.swf\" />'+
'<param name=\"quality\" value=\"high\" />'+
'<param name=\"wmode\" value=\"transparent\" />'+
'<embed src=\"../../img_header/flash/clkNewYork.swf\" width=\"40\" height=\"40\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"> </embed>'+
'</object>'+
'<span class=\"white11\">&nbsp;N.Y.</span>'+
'</div>'+
'<div id=\"clockTokyo\" class=\"clocks\">'+
'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=\"flaClockTokyo\" width=\"40\" height=\"40\">'+
'<param name=\"movie\" value=\"../../img_header/flash/clkTokyo.swf\" />'+
'<param name=\"quality\" value=\"high\" />'+
'<param name=\"wmode\" value=\"transparent\" />'+
'<embed src=\"../../img_header/flash/clkTokyo.swf\" width=\"40\" height=\"40\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"> </embed>'+
'</object>'+
'<span class=\"white11\">&nbsp;Tokyo</span>'+
'</div>'+
'<div id=\"clockSydney\" class=\"clocks\">'+
'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=\"flaClockSydney\" width=\"40\" height=\"40\">'+
'<param name=\"movie\" value=\"../../img_header/flash/clkSydney.swf\" />'+
'<param name=\"quality\" value=\"high\" />'+
'<param name=\"wmode\" value=\"transparent\" />'+
'<embed src=\"../../img_header/flash/clkSydney.swf\" width=\"40\" height=\"40\" wmode=\"transparent\" type=\"application/x-shockwave-flash\"> </embed>'+
'</object>'+
'<span class=\"white11\">&nbsp;Sydney</span>'+
'</div>'+
'</div><!--id=\"left\"-->'+
''+
'<div id=\"right\">'+
'<table align=\"right\" style=\"margin-right:10px;\">'+
'<tr>'+
'<td align=\"center\">'+
'<div class=\"flag\"><a href=\"http://www.greekferries.gr/forthcrs-domestic.asp\"><img src=\"../../img_header/pics/languages-en.gif\" alt=\"English\" name=\"En\" width=\"16\" height=\"10\"  border=\"0\" align=\"absmiddle\" class=\"hasHelp\" id=\"En\" style=\"border:1px solid #000; margin-bottom:1px;\" /><br/>'+
'<font class=\"flagtext\">EN</font></a></div></td>'+
'<td align=\"center\">'+
'<div class=\"flag\"><a href=\"http://www.greekferries.gr/forthcrs-domestic_de.asp\"><img src=\"../../img_header/pics/languages-de.gif\" alt=\"German\" name=\"De\" width=\"16\" height=\"10\" border=\"0\" align=\"absmiddle\" class=\"hasHelp\" id=\"De\" style=\"border:1px solid #000; margin-bottom:1px;\" /><br/>'+
'<font class=\"flagtext\">DE</font></a></div></td>'+
'<td align=\"center\">'+
'<div class=\"flag_selected\"><a href=\"http://www.greekferries.gr/forthcrs-domestic_it.asp\"><img src=\"../../img_header/pics/languages-it.gif\" alt=\"Italian\" name=\"It\" width=\"16\" height=\"10\" border=\"0\" align=\"absmiddle\" class=\"hasHelp\" id=\"It\" style=\"border:1px solid #000; margin-bottom:1px;\" /><br/>'+
'<font class=\"flagtext_selected\">IT</font></a></div></td>'+
'<td align=\"center\">'+
'<div class=\"flag\"><a href=\"http://www.greekferries.gr/forthcrs-domestic_fr.asp\"><img src=\"../../img_header/pics/languages-fr.gif\" alt=\"French\" name=\"Fr\" width=\"16\" height=\"10\" border=\"0\" align=\"absmiddle\" class=\"hasHelp\" id=\"Fr\" style=\"border:1px solid #000; margin-bottom:1px;\" /><br/>'+
'<font class=\"flagtext\">FR</font></a></div></td>'+
'<td align=\"center\">'+
'<div class=\"flag\"><a href=\"http://www.greekferries.gr/forthcrs-domestic_gr.asp\"><img src=\"../../img_header/pics/languages-gr.gif\" alt=\"Greek\" name=\"Gr\" width=\"16\" height=\"10\" border=\"0\" align=\"absmiddle\" class=\"hasHelp\" id=\"Gr\" style=\"border:1px solid #000; margin-bottom:1px;\" /><br/>'+
'<font class=\"flagtext\">GR</font></a></div></td>'+
'</tr>'+
'</table>'+
'</div><!--id=\"right\"-->'+
'</div><!--id=\"header\"-->'+
''+
'<div id=\"menu\">'+
'<a href=\"http://www.greekferries.gr/index_it.htm\" target=\"_blank\" id=\"tHome\">Greek Ferries <font>Iniziale</font></a><span style=\"margin-left:30px; margin-right:30px; color:#FFFFFF;\">|</span>'+
'<a id=\"tForthCrsDom\" href=\"http://www.greekferries.gr/forthcrs-international_it.asp\" target=\"_blank\" class=\"menu_deselected\">Italia – Grecia <font>Prenotazioni on-line </font></a><span style=\"margin-left:30px; margin-right:30px; color:#FFFFFF;\">|</span>'+
'<a id=\"tForthCrsDom\" href=\"http://www.greekferries.gr/forthcrs-difficulty_it.asp\" target=\"_blank\" class=\"menu_deselected\">Difficolta Con Sistema Prenotazioni <font>Cliccate </font></a><span style=\"margin-left:30px; margin-right:30px; color:#FFFFFF;\">|</span>'+
'<a href=\"http://www.greekferries.gr/it/customer-support/index.asp\" target=\"_blank\" class=\"menu_deselected\" id=\"tSupport\"> Traghetto <font>Servizio Clienti</font></a></div>';
// *** End of Code for Logo

// *** Code for footer Logo
var footerlogo=
'<div class=\"footer\" style=\"clear:both;\"></div>'+
''+
'<div align=\"center\" style=\"clear:both; color:#58d3fd; font-size:10px; padding-bottom:10px; padding-top:15px;\">'+
'La riproduzione totale e parziale, breve, adattata e la pubblicazione totale o parziale, di tutto il materiale contenuto in questo sito ed il modo di presentazione, incluso il framing,<br />'+
'i mezzi di riproduzione analoghi, fotocopie e, in genere, la memorizzazione digitale sono espressamente vietati in assenza di un\' autorizzazione scritta del proprietario legale.'+
'</div>'+
''+
'<div align=\"center\" style=\"padding-bottom:100px; color:#58d3fd; font-weight:bold; font-size:11px;\">'+
'Copyright &copy; 1994 -'+
'<script language = \"JavaScript\" type=\"text/javascript\">'+
'var now = new Date();'+
'var year = now.getYear();'+
'if(year<1900){year+=1900}'+
'document.write(\" \" + year + \" \")'+
' </script>'+
'<script language=\"JavaScript\" type=\"text/javascript\">'+
'//tellsmall(\'strike_gr.htm\')'+
'//christmas(\'christmas2005_gr.htm\')'+
'</script>'+
'www.greekferries.gr (<a href=\"http://www.greekferries-club.gr/it/index.asp\" target=\"_blank\" style=\" font-weight:normal;color:#58d3fd; text-decoration:underline;\">Greekferries Club S.A, Traghetti & Servizi di Crociere in Grecia</a>)</div>';
// *** End of Code for footer Logo


// **** 
// **** DON'T TOUCH ANYTHING FROM HERE ***
// **** 


// ****  Initialize Dates according "dtValidation"
var Today = new Date();
var dateFrom = new Date(Today.getFullYear(), Today.getMonth(), Today.getDate() + rvDaysGap);
var dateFromF = formatDate(dateFrom, 'dd/MM/yyyy');

try{
	if ( dtValidation == 'GT' ) {
	dtValidErrMessage = "Inbound date must be after the outbound date.";
	var dateTo = new Date(dateFrom.getFullYear(), dateFrom.getMonth(), dateFrom.getDate() + 1);
	} else {
		dtValidErrMessage = "Outbound date cannot be after the inbound date.";
		var dateTo = dateFrom;
	}
}
	catch(err)
{
}
var dateToF = formatDate(dateTo, 'dd/MM/yyyy'); 

// ****  Fix Handling Fees
if (handlingFeesCtrl == 0) {	
	handlingFees = 0;
}


// **** 
// *** END OF DON'T TOUCH CODE
// **** 