		
		var b = navigator.appName
				
		function hideLayer(){
			if(b != 'Microsoft Internet Explorer'){
				javascript:document.getElementById('golfball').style.zIndex='-1';
				javascript:document.getElementById('golfball').style.visibility='hidden';
			}
		}
		var movieName = "golfballmov";
		
		function thisMovie(movieName) {
		  // IE and Netscape refer to the movie object differently.
		  // This function returns the appropriate syntax depending on the browser.
		  if (navigator.appName.indexOf ("Microsoft") !=-1) {
				return window[movieName];
		  }	else {
				return document[movieName];
		  }
		}
		
		function playMovie() {
			thisMovie(movieName).Play();
			javascript:document.getElementById('golfball').style.zIndex='2';
			javascript:document.getElementById('golfball').style.visibility='visible';
		}

		//set todays date
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape

//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear){
  var DaysInMonth = 31;
  if (WhichMonth == "4" || WhichMonth == "6" || WhichMonth == "9" || WhichMonth == "11") DaysInMonth = 30;
  if (WhichMonth == "2" && (WhichYear/4) != Math.floor(WhichYear/4)) DaysInMonth = 28;
  if (WhichMonth == "2" && (WhichYear/4) == Math.floor(WhichYear/4)) DaysInMonth = 29;
  return DaysInMonth;
}

//function to change the available days in a months
function ChangeOptionDays(Which){
  DaysObject = eval("document.bookingform." + Which + "day");
  MonthObject = eval("document.bookingform." + Which + "month");
  YearObject = eval("document.bookingform." + Which + "year");

  Month = MonthObject[MonthObject.selectedIndex].text;
  Year = YearObject[YearObject.selectedIndex].text;

  DaysForThisSelection = DaysInMonth(Month, Year);
//  DaysObject.options.length=DaysForThisSelection;
  CurrentDaysInSelection = DaysObject.length;
  if (CurrentDaysInSelection > DaysForThisSelection){
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++){
      DaysObject.options[DaysObject.options.length - 1] = null
    }
  }
  if (DaysForThisSelection > CurrentDaysInSelection){
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++){
      NewOption = new Option(DaysObject.options.length + 1);
//      DaysObject.add(NewOption);// Only IE
      DaysObject.options[DaysObject.options.length] = NewOption;
    }
  }
    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}

//function to set options to today
function SetToToday(Which){
	DaysObject = eval("document.bookingform." + Which + "day");
	MonthObject = eval("document.bookingform." + Which + "month");
	YearObject = eval("document.bookingform." + Which + "year");

	YearObject[0].selected = true;
	MonthObject[NowMonth].selected = true;

	ChangeOptionDays(Which);

	DaysObject[NowDay-1].selected = true;
}

//function to write option years plus x
function WriteYearOptions(YearsAhead){
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;
  }
  return line;
}


// WebcamCenter.nl verversingsscript voor netwerkcamera's
// www.WebcamCenter.nl
//

function webCamRegisterCam(camName, camURL) {
	
	if (typeof webCamURL != "object") {
		webCamURL = new Array();
		webCamName = new Array();
	}

	var idx = webCamName.length;
	
	webCamName[idx] = camName;
	webCamURL[idx] = camURL;
}


// GROW-INTERACTIVE
// Open een foto in een popup

function caminawin()
    { window.open('http://www.shortgolf.nl/camera/image.jpg', 'popwin', 'scrollbars=0,status=0,toolbar=0,resizable=0,width=500,height=380,top=150,left=185'); }


// ----- INSTELLINGEN -----
//

// breedte en hoogte van het camerabeeld
webCamWidth = 480;
webCamHeight = 360;

// tijd in seconden voor het verversen van de camerabeelden
webCamUpdateInterval = 5;

// Meerdere camera's kunnen op ��n scherm getoond worden. 
//
//  Voeg de camera's toe zoals hieronder getoond:
//
//   webCamRegisterCam(CAMERANAAM, CAMERABEELD);
//
// Het eerste beeld is het wachtbeeld
webCamRegisterCam("Error", "../camera/error.gif");

// De camerabeelden:
webCamRegisterCam("Shortgolf webcam", "../camera/image.jpg");

// Eventuele volgende camera's:
//
webCamRegisterCam("Shortgolf molencam", "cameramolencam/current.jpg");

//
// ----- Einde instellingen. Hieronder niets wijzigen -----



// Stel uw pagina in om deze functie direct te laden via het  onload=  commando
//
function webCamInit() {
	webCamUpdateFunction();
	
	webCamUpdateTimeLeft = webCamUpdateInterval;
	webCamInterval = setInterval("webCamUpdate();", 1000);
}

// Gebruik de onderstaande functie om de beelden op uw pagina weer te geven.
//
// Gebruik:
//
//   webCamDraw(n);
//
//  n is het aantal camera's. 
//
// De standaard grootte van het camerabeeld kan hierin ook nog worden gewijzigd door  de volgende functie-parameters mee te geven:
//   webCamDraw(n, width, height, altText);
//
function webCamDraw(camNum, w, h, altText) {
	var wStr = " width='" + ((typeof w == "undefined") ? webCamWidth : w) + "'";
	var hStr = " height='" + ((typeof h == "undefined") ? webCamHeight : h) + "'";

	if (w == "") wStr = "";
	if (h == "") hStr = "";

	var altText = (typeof altText == "string") ? altText : ((camNum == 0 && typeof wc_spareImgAltText == "string" && wc_spareImgAltText != "") ? wc_spareImgAltText : webCamName[camNum]);

	var theDate = new Date();
	
	document.write("<img name='webCam_" + camNum + "' src='" + webCamURL[0] + "'" + wStr + hStr + " border='0' alt=\"" + altText + "\">");
}

// Het aantal seconden tot de volgende verversing wordt in de statusbalk weergegeven.
//
function webCamUpdate() {
	webCamUpdateTimeLeft--;

	window.status = "nieuw beeld na " + webCamUpdateTimeLeft + " seconden";
	
	if (webCamUpdateTimeLeft <= 0) {
		webCamUpdateFunction();
		webCamUpdateTimeLeft = webCamUpdateInterval;
	}
}

// Intelligente cachefunctie om beeldstoringen te voorkomen.
//
function webCamImagePreloaded() {
	document["webCam_" + this.camNum].src = document["webCamPreload_" + this.camNum].src;

	window.status = "reloaded " + webCamName[this.camNum];
}

function webCamImageError() {
	document["webCam_" + this.camNum].src = webCamURL[0];

	window.status = "WebCams: Error reloading " + webCamName[this.camNum];
}

function webCamPreloadImage(camNum, imgURL) {
	theImage = new Image();
	theImage.src = imgURL;
	theImage.onerror = webCamImageError;
	theImage.onload = webCamImagePreloaded;
	theImage.camNum = camNum;
	
	return theImage;
}

function webCamUpdateWithPreload() {
	if (document.images) {
		var theDate = new Date();

		for (var i = 1; i < webCamURL.length; i++) {
			if (typeof document["webCam_" + i] == "object" && typeof document["webCam_" + i].src == "string") {
				document["webCamPreload_" + i] = webCamPreloadImage(i, webCamURL[i] + "?" + parseInt(theDate.getTime() / 1000));
			}
		}
	}
}


// Alternatieve versie voor het laden van de beelden.
//
function webCamUpdateNoPreload() {
	if (document.images) {
		var theDate = new Date();
		
		for (var i = 1; i < webCamURL.length; i++) {
			if (typeof document["webCam_" + i] == "object" && typeof document["webCam_" + i].src == "string") {
				document["webCam_" + i].src = webCamURL[i] + "?" + parseInt(theDate.getTime() / 1000);
			}
		}
	}
}


webCamUpdateFunction = webCamUpdateWithPreload;


// Test of intelligente laadfunctie werkt.
//
function testImagePreload() {
	if (typeof this.src != "string") {
		webCamUpdateFunction = webCamUpdateNoPreload;
	}
}
testImage = new Image();
testImage.onload = testImagePreload;
testImage.src = webCamURL[0];


function calculate() {
	var exactHandicap	= $('#exactHandicap').val();
	var holesPlayed		= $('#holesPlayed').val();
	var stablefordScore	= $('#stablefordScore').val();
	var calculatorName	= $('#calculatorName').val();
	var calculatorEmail	= $('#calculatorEmail').val();
	var optin = $('#optin').is(':checked');   
	
	var hole1	= $('#hole1').val();
	var hole2	= $('#hole2').val();
	var hole3	= $('#hole3').val();
	var hole4	= $('#hole4').val();
	var hole5	= $('#hole5').val();
	var hole6	= $('#hole6').val();
	var hole7	= $('#hole7').val();
	var hole8	= $('#hole8').val();
	var hole9	= $('#hole9').val();
	var hole10	= $('#hole10').val();
	var hole11	= $('#hole11').val();
	var hole12	= $('#hole12').val();
	var hole13	= $('#hole13').val();
	var hole14	= $('#hole14').val();
	var hole15	= $('#hole15').val();
	var hole16	= $('#hole16').val();
	var hole17	= $('#hole17').val();
	var hole18	= $('#hole18').val();
	
	$.post( "resources/scripts/calculate-handicap.php", { calculatorName: calculatorName, calculatorEmail: calculatorEmail, exactHandicap: exactHandicap, holesPlayed: holesPlayed, stablefordScore: stablefordScore, optin: optin, hole1: hole1, hole2: hole2, hole3: hole3, hole4: hole4, hole5: hole5, hole6: hole6, hole7: hole7, hole8: hole8, hole9: hole9, hole10: hole10, hole11: hole11, hole12: hole12, hole13: hole13, hole14: hole14, hole15: hole15, hole16: hole16, hole17: hole17, hole18: hole18 },
		function(html){
			$('#alert').html(html);
		}
	);
}

function initialize() {
	if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("route-canvas"));
        var point = new GLatLng(52.582061,5.625558)
		map.setCenter(point, 9);
        map.addControl(new GSmallZoomControl3D);

		
		var icon = new GIcon(G_DEFAULT_ICON);
		icon.shadow = "resources/images/pin_shadow.png";
		icon.iconSize = new GSize(25, 39);
		icon.shadowSize = new GSize(39, 33);
		icon.image = "resources/images/pin_icon.png";

		function createMarker(point,icon) {
  			// Set up our GMarkerOptions object
  			markerOptions = { icon:icon };
  			var marker = new GMarker(point, markerOptions);

  			return marker;
		}
     	map.addOverlay(createMarker(point, icon));
	 }
};

