

function openWin(URL)  {

aWindow=window.open(URL,"newwindow","toolbar=no,width=250,height=150,status=no,scrollbars=no,resizable=no,menubar=no");

}


function openWin2(URL)  {

aWindow=window.open(URL,"newwindow","toolbar=no,width=300,height=255,status=no,scrollbars=no,resizable=yes,menubar=no,left=0,top=0");

}

function openWin3(URL)  {

aWindow=window.open(URL,"newwindow","toolbar=no,width=300,height=440,status=no,scrollbars=no,resizable=yes,menubar=no,left=0,top=0");

}


function openWinWeather(URL)
{
  var height = screen.availHeight;
  var width = screen.availWidth;
  var windowWidth = 520;
  var windowHeight = 500;
  var xPos = ((width - windowWidth)/2);
  var yPos = ((height - windowHeight)/2);
  var features = "width=" + windowWidth + ",height=" + windowHeight + ",scrollbars=yes,status=no,resizeable=no,toolbar=no,menubar=no,left=" + xPos + ",screenX=" + xPos + ",top=" + yPos + ",screenY=" + yPos;
  var popUp = window.open(URL,"weather",features);
  return true;
}


function openWina(URL)  {

aWindow=window.open(URL,"newwindow","toolbar=no,width=800,height=600,status=no,scrollbars=yes,resizable=yes,menubar=no");

}



function openWinb(URL)  {

aWindow=window.open(URL,"newwindow","toolbar=no,width=660,height=340,status=no,scrollbars=yes,resizable=yes,menubar=no");

}



img1on = new Image();          
img1on.src = "../images/b_ferry_on.gif";    // Active Images
img2on = new Image(); 
img2on.src = "../images/b_tunnel_on.gif";   
img3on = new Image(); 
img3on.src = "../images/b_breaks_on.gif";   

img1off = new Image();         
img1off.src = "../images/b_ferry.gif";  // Inactive Images
img2off = new Image(); 
img2off.src = "../images/b_tunnel.gif"; 
img3off = new Image(); 
img3off.src = "../images/b_breaks.gif"; 

img1ad = new Image();         
img1ad.src = "../images/descr_ferry.gif";  // Secondary Images
img2ad = new Image();
img2ad.src = "../images/descr_tunnel.gif";  
img3ad = new Image();
img3ad.src = "../images/descr_breaks.gif";

function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
            document["holder"].src = eval(imgName + "ad.src"); // Added line!
        }
}
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
            document["holder"].src = "../images/descr_blank.gif";
        }
}



function checkdata()

{

     var uppervalue;

     if (document.Contact.email.value.length == 0) {

         alert ("The 'email' field requires an entry.");

         return false;

     }

     uppervalue = document.Contact.email.value.toUpperCase();

     if (uppervalue.indexOf('@') < 0) {

         alert ("To sign up for our News service, you must provide a complete, valid email address .");

         return false;

     }

     return true;

}



function MM_openBrWindow(theURL,winName,features) { //v2.0



  window.open(theURL,winName,features);



}

 

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);



function add_day_time(olddate,days,hrs,mins,secs)

{

	hrs += days * 24;

	mins += hrs * 60;

	secs += mins * 60;

	milli = secs * 1000;

	var newdate = new Date(olddate.getTime() + milli);

	return newdate;

}





function defaultvalues1()

{

	var today = new Date();

	var depart_date = add_day_time(today,0,1,0,0);

	var return_date = add_day_time(today,0,2,0,0);

	if ((document.searchform.depart_day.selectedIndex == 0) &&

			(document.searchform.depart_month.selectedIndex == 0) &&

			(document.searchform.depart_year.selectedIndex == 0) &&

			(document.searchform.depart_time.selectedIndex == 0) &&

			(document.searchform.return_day.selectedIndex == 0) &&

			(document.searchform.return_month.selectedIndex == 0) &&

			(document.searchform.return_year.selectedIndex == 0) &&

			(document.searchform.return_time.selectedIndex == 0)) {

		document.searchform.depart_day.selectedIndex = depart_date.getDate() - 1;

		document.searchform.depart_month.selectedIndex = depart_date.getMonth();

		document.searchform.depart_year.selectedIndex = depart_date.getFullYear() - 2001;

		document.searchform.depart_time.selectedIndex = depart_date.getHours();

		document.searchform.return_day.selectedIndex = return_date.getDate() - 1;

		document.searchform.return_month.selectedIndex = return_date.getMonth(); 

		document.searchform.return_year.selectedIndex = return_date.getFullYear() - 2001;

		document.searchform.return_time.selectedIndex = return_date.getHours();

	}

//	var min = today.getMinutes();

//	var sec = today.getSeconds();

//	var yr = today.getFullYear();

//	var mon = today.getMonth() + 1;

//	var day = today.getDate();

//	var hrs = today.getHours();

//

//	if ((document.searchform.depart_day.selectedIndex == 0) &&

//			(document.searchform.depart_month.selectedIndex == 0) &&

//			(document.searchform.depart_year.selectedIndex == 0) &&

//			(document.searchform.depart_time.selectedIndex == 0) &&

//			(document.searchform.return_day.selectedIndex == 0) &&

//			(document.searchform.return_month.selectedIndex == 0) &&

//			(document.searchform.return_year.selectedIndex == 0) &&

//			(document.searchform.return_time.selectedIndex == 0)) {

//		document.searchform.depart_day.selectedIndex = day - 1;

//		document.searchform.depart_month.selectedIndex = mon - 1;

//		document.searchform.depart_year.selectedIndex = yr - 2000;

//		document.searchform.depart_time.selectedIndex = hrs;

//		document.searchform.return_day.selectedIndex = day - 1;

//		document.searchform.return_month.selectedIndex = mon - 1;

//		document.searchform.return_year.selectedIndex = yr - 2000;

//		document.searchform.return_time.selectedIndex = hrs;

//	}



	//document.searchform.route_code.selectedIndex = 51;

}







function defaultvalues2()

		{

//			var dvehicle_index = document.enquiryform.dvehicle_type.selectedIndex;

//			var dvehicle_value = document.enquiryform.dvehicle_type[0].value;

//			if (document.enquiryform.dvehicle_length.value == '') {

//				document.enquiryform.dvehicle_length.value = '4.00';

//			}

//			if (document.enquiryform.dvehicle_height.value == '') {

//				document.enquiryform.dvehicle_height.value = '2.00';

//			}

//			if (document.enquiryform.dtrailer_length.value == '') {

//				document.enquiryform.dtrailer_length.value = '4.50';

//			}

//			if (document.enquiryform.dtrailer_height.value == '') {

//				document.enquiryform.dtrailer_height.value = '2.50';

//			}

//			if (document.enquiryform.doperator.value == 'LES') {

//			} else {

//			}

//			alert(document.enquiryform.dvehicle_type.options[0].name);

			var x = 0;

			var passengers = 0;

			while (x < document.enquiryform.elements.length) {

				var key = document.enquiryform.elements[x].name;

				if (key.indexOf('dpasstype_') > -1) { 

					passengers += document.enquiryform.elements[x].selectedIndex;

				}

				x++;

			}

			if (passengers == 0) {

				document.enquiryform.dpasstype_A.selectedIndex = 2;

			}

		}



function defaultvalues3()

{

	var today = new Date();

	var depart_date = add_day_time(today,0,1,0,0);

	var return_date = add_day_time(today,0,2,0,0);

	if ((document.searchform.depart_day.selectedIndex == 0) &&

			(document.searchform.depart_month.selectedIndex == 0) &&

			(document.searchform.depart_year.selectedIndex == 0) &&

			(document.searchform.depart_time.selectedIndex == 0) &&

			(document.searchform.return_day.selectedIndex == 0) &&

			(document.searchform.return_month.selectedIndex == 0) &&

			(document.searchform.return_year.selectedIndex == 0) &&

			(document.searchform.return_time.selectedIndex == 0)) {

		document.searchform.depart_day.selectedIndex = depart_date.getDate() - 1;

		document.searchform.depart_month.selectedIndex = depart_date.getMonth();

		document.searchform.depart_year.selectedIndex = depart_date.getFullYear() - 2000;

		document.searchform.depart_time.selectedIndex = depart_date.getHours();

		document.searchform.return_day.selectedIndex = return_date.getDate() - 1;

		document.searchform.return_month.selectedIndex = return_date.getMonth(); 

		document.searchform.return_year.selectedIndex = return_date.getFullYear() - 2000;

		document.searchform.return_time.selectedIndex = return_date.getHours();

	}

//	var min = today.getMinutes();

//	var sec = today.getSeconds();

//	var yr = today.getFullYear();

//	var mon = today.getMonth() + 1;

//	var day = today.getDate();

//	var hrs = today.getHours();

//

//	document.searchform.depart_day.selectedIndex = day - 1;

//	document.searchform.depart_month.selectedIndex = mon - 1;

//	document.searchform.depart_year.selectedIndex = yr - 2000;

//	document.searchform.depart_time.selectedIndex = hrs;

//	document.searchform.return_day.selectedIndex = day - 1;

//	document.searchform.return_month.selectedIndex = mon - 1;

//	document.searchform.return_year.selectedIndex = yr - 2000;

//	document.searchform.return_time.selectedIndex = hrs;



	// document.searchform.route_code.selectedIndex = 51; 

}






