// JavaScript Document
<!--
	
	function PhotoWindow(URL){
		window.open(URL, "PhotoWindow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=660,height=600");
		}
		
	function VideoWindow(URL){
		window.open(URL, "PhotoWindow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=660,height=450");
		}

	function infoWindow(URL){
		window.open(URL, "infoWindow", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=660,height=600");
		}

	function validateForm(myForm) {
			var alertStr = "";
			var nameOK = false;
			var emailOK = false;
			var countryOK = false; //Set to true if you do not want to check for country
			var subjectOK = false;
			
			//Check for not empty name field
			if ((myForm.name.value.length==0) || (myForm.name.value==null)) 
			{
      			alertStr = "Please enter your name\n"; 
   			}
   			else 
			{ 
				nameOK = true;
			}
			
			// Check for Valid Email Addrease
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value))
			{
				emailOK = true;
			}
			else
			{
				alertStr = alertStr + "Please enter a valid email address\n";
			}
			
			// Check if a country has been selected
			if (myForm.country.value == "" || myForm.country.value == null)
			{
				alertStr = alertStr + "Please select the country nearest to you, this is necessary to contact the correct dealer\n";
			}
			else
			{
				countryOK = true;
			}
			
			// Check if a subject has been selected
			if (myForm.subject.value == "" || myForm.subject.value == null)
			{
				alertStr = alertStr + "Please select a subject\n";
			}
			else
			{
				subjectOK = true;
			}
			
			
			if (nameOK && emailOK && countryOK && subjectOK) { return (true); }
			else 
			{ 
				alert(alertStr);
				return (false)
			}
		}
	
	function toggleLayer(whichLayer)
		{
			if (document.getElementById)
			{
				// this is the way the standards work
				var style2 = document.getElementById(whichLayer).style;
				style2.display = style2.display? "":"block";
			}
			
			else if (document.all)
			{
				// this is the way old msie versions work
				var style2 = document.all[whichLayer].style;
				style2.display = style2.display? "":"block";
			}
			
			else if (document.layers)
			{
			// this is the way nn4 works
				var style2 = document.layers[whichLayer].style;
				style2.display = style2.display? "":"block";
			}
		}
		
	function toggleLayerVis(whichLayer)
		{
			if (document.getElementById)
			{
				// this is the way the standards work
				var style2 = document.getElementById(whichLayer).style;
				style2.display = style2.display? "":"none";
			}
			
			else if (document.all)
			{
				// this is the way old msie versions work
				var style2 = document.all[whichLayer].style;
				style2.display = style2.display? "":"none";
			}
			
			else if (document.layers)
			{
			// this is the way nn4 works
				var style2 = document.layers[whichLayer].style;
				style2.display = style2.display? "":"none";
			}
		}

	// This function looks for a cookie with a specific name on the visitor's hard drive.
	function GetCookie(name)
		{
			// Start by assuming no cookie exists.
			var cookiecontent = '0';
			// The browser's cookies can hold data we're not interested in, all in one 
			//     long string of characters. Thus, we need to find out where our specific
			//     cookie begins and ends (provided the one we want actually exists).
			//
			// If any cookies are available ...
			if(document.cookie.length > 0) {
				// Determine begin position of the cookie with the specified name.
				var cookiename = name + '=';
				var cookiebegin = document.cookie.indexOf(cookiename);
				// Initialize the end position at zero.
				var cookieend = 0;
				// If a cookie with the specified name is actually available ...
				if(cookiebegin > -1) {
					// Offset the begin position of the cookie by the lengh of the cookie name.
					cookiebegin += cookiename.length;
					// Determine the end position of the cookie.
					cookieend = document.cookie.indexOf(";",cookiebegin);
					if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
					// Put the cookie into our own variable "cookiecontent".
					cookiecontent = document.cookie.substring(cookiebegin,cookieend);
				}
			}
			// Increment cookie content by 1 and store in variable "value".
			var value = parseInt(cookiecontent) + 1;
			// Put the incremented value as a new cookie on the visitor's hard drive.
			PutCookie(name,value);
			// Return the incremented value to the calling line of code.
			return value;
		}
		
	// This function puts the cookie on the visitor's hard drive.
	function PutCookie(n,v) 
		{
			// Begin by assuming no expiration date is applicable.
			var exp = '';
			// If an expiration date is applicable, determine the future date 
			//      and store the date in variable "exp" in the correct format.
			//if(DaysToLive > 0) {
			//	var now = new Date();
			//	then = now.getTime() + (DaysToLive * 24 * 60 * 60 * 1000);
			//	now.setTime(then);
			//	exp = '; expires=' +
			//	now.toGMTString();
			//}
			// Put the cookie on the user's hard drive with path set to root 
			//     and with any applicable expiration date.
			document.cookie = n + "=" + v + '; path=/' + exp;
		}
	
//  End -->