//iframe resize same domain
function calcHeight(iframeID, extraHeight) {
  //find the height of the internal page
  var the_height = document.getElementById(iframeID).contentWindow.document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById(iframeID).height = the_height + parseInt(extraHeight);
} 

function measureRealtime() {
    if(pe_statsUrl != "[null]" && pe_statsUrl != "") {
        var statsUrl = pe_statsUrl + 'click/';
        statsUrl += pe_site + '/';
        for(var i=0; i<pe_navPathIDs.length; i++) {
            statsUrl += pe_navPathIDs[i] + '/';
            statsUrl += encodeURIComponent(pe_navPathKeys[i].replace('/', '')) + '/';
        }
        statsUrl += pe_compId + '/';
        statsUrl += encodeURIComponent(pe_compTitle) + '/';

        image = new Image(1, 1);
        image.onLoad = function () { };
        image.src = statsUrl;
    }
}

//googleAnalytics

function measureClick (zone1, zone2, zone3, zone4){

	var component='gClicks';

	

	if (typeof (measureZone) != 'undefined'){

		component += '/'+ measureZone;

	}



	if (zone1!=undefined  && zone1 != ''){

		component += '/'+zone1;

	}

	if (zone2!=undefined && zone2 != ''){

		component += '/'+zone2;

	}

	if (zone3!=undefined && zone3 != ''){

		component += '/'+zone3;

	}

	if (zone4!=undefined && zone4 != ''){

		component += '/'+zone4;

	}

	

	if(typeof(pageTracker)!="undefined"){

		pageTracker._trackPageview(component);  //oud

	}

	else {

		_gaq.push(['_trackPageview', component]); //new

	}

}




// Googlemap array aanmaken
var googleMaps = new Array();

function embedGoogleMap(id,placename,lat,lon,zoom,mode) { 
 // deze functie wordt in de pagina voor elke google map opgeroepen en bewaart de google map in de Googlemaps array
 googleMaps.push(new Array(id,id2,placename,lat,lon,zoom,mode));
}

function drawGoogleMap(id,id2,placename,lat,lon,zoom,mode) {      
	var mapEmbedType = $('map'+id+'_'+id2).className;
	// if (google.maps.BrowserIsCompatible()) { // V3CHANGE
		mode = mode.toLowerCase();
		var initialZoomLevel = parseFloat(zoom);
		var initialLatitude = parseFloat(lat);
		var initialLongitude = parseFloat(lon);
		var point = new google.maps.LatLng(initialLatitude, initialLongitude);
		if(mode=='satellite' || mode=='satelliet') {                    
			var initialMapType = google.maps.MapTypeId.SATELLITE;
		}
		else if(mode=='hybrid' || mode=='beide') {                   
			var initialMapType = google.maps.MapTypeId.HYBRID;
		}
		else if(mode=='terrain' || mode=='terrein') {                    
			var initialMapType = google.maps.MapTypeId.TERRAIN;
		}
		else {                   
			var initialMapType = google.maps.MapTypeId.ROADMAP;
		}
		var myOptions = {
			zoom: initialZoomLevel,
			center: point,
			mapTypeId: initialMapType,
			mapTypeControlOptions: { mapTypeIds: new Array(google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN, google.maps.MapTypeId.SATELLITE) },
			zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL },
			scrollwheel: false,
			streetViewControl: false
		}
		var map = new google.maps.Map($("map"+id+"_"+id2),myOptions);
		   
		geocoder = new google.maps.Geocoder();
		
		if (mapEmbedType == "embeddedGooglemapSmall") {
			map.disableDefaultUI = true;
		}
		else {
			var marker = new google.maps.Marker({
				position: point,
				map: map
			}); // marker plaatsen
			if (placename != "" && placename != null) {
				var infoWindow = new google.maps.InfoWindow({
					content: '<div style=\"font:normal 12px Verdana;width:250px;\">' + placename + '</div>'
				});
				google.maps.event.addListener(marker, "click", function() { infoWindow.open(map,marker)});
			} 
		}
	// }
}

function drawGoogleMaps() {
 // deze functie leest alle googlemaps uit de array en geeft de coördinaten door aan 'drawGoogleMap'
 // deze functie wordt onload opgeroepen
	for(var i=0;i<googleMaps.length;i++) {
		drawGoogleMap(googleMaps[i][0],googleMaps[i][1],googleMaps[i][2],googleMaps[i][3],googleMaps[i][4],googleMaps[i][5],googleMaps[i][6]);
	}
}

if(document.getElementById) {
	// onload oproepen van bovenstaande drawGoogleMaps functie
	//set page event handlers for onload and unload
	if (window.attachEvent) {
		window.attachEvent("onload", drawGoogleMaps);
	} else {
		window.addEventListener("DOMContentLoaded", drawGoogleMaps, false);
	}
	
	window.onload=function(){
		onLoadFunctions();
	}
}

// Javascript SubmitForm
function submitZoekForm(zoekForm,zoekVeld,minAantalChar,boodschap) {
	var returnValue = false;
	inputVal = $(zoekVeld).value;
	if(inputVal != "Vous cherchez?" && inputVal != "zoek op hln.be" && inputVal != "trouvez un article" && inputVal != "zoek op nina.be" && inputVal != "U zoekt?") {
		if($(zoekVeld).value.length >= minAantalChar) {
			returnValue = true;
		}
		else {
			alert(boodschap);
		}
	}
	else {
		alert(boodschap);
	}
	inputVal = replaceAccents(inputVal);
	$(zoekVeld).value = inputVal;
	return returnValue;
}

// Replace accented chars with there equivalent (é > e)
function replaceAccents(val) {
	var oddCharacters = 	["é", "è", "ë", "ê", "à", "á", "â", "ù", "õ", "ü", "ç"];
	var normalCharacters = 	["e", "e", "e", "e", "a", "a", "a", "u", "o", "u", "c"];
	val = val.toLowerCase();
	for (i=0; i <= oddCharacters.length; i++) {
		while (val.indexOf(oddCharacters[i]) != -1) {
			val = val.replace(oddCharacters[i], normalCharacters[i]);
		}
	}
	return val;
}

// Javascript Parameter Object
function Parameter(key,val) {
  this.key = key;
  this.val = val;
}
 
// Javascript get URL parameters and return in Parameter object
function getParameters() {
 var qsParm = new Array();
 var query = window.location.search.substring(1);
 var parms = query.split('&');
 for (var i=0; i<parms.length; i++) {
  var pos = parms[i].indexOf('=');
  if (pos > 0) {
   var key = parms[i].substring(0,pos);
   var val = parms[i].substring(pos+1);
   qsParm[i] = new Parameter(key,val);   
  }
 }
 return qsParm;
}

// Javascript return value of a specific URL-parameter
function getParamValue(param) {
  var parameters = getParameters();
  for(var i=0; i<parameters.length; i++) {
  	aParameter = parameters[i];
	if(aParameter.key==param) {
		return(aParameter.val);
  	}
  }
  return false;
}


//macromedia functions
function goToURL() {
  var i, args=goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function openBrWindow(theURL,winName,features) { //v2.0
  top.fu_window = top.window.open(theURL,winName,features);
}
function closeBrWindow() {
    window.close();
}
function printBrWindow() {
     window.print();
}
function showPopupWindow(theURL,width, height) {
  openBrWindow(theURL,'','width=' + width + ',height=' + height + ', scrollbars=1, resizable=1');
}

function openExternalSite(theURL) {
  openBrWindow(theURL,'','toolbar=1, menubar=1, location=1, status=1, scrollbars=1, resizable=1');
}


function showLayer(id)
{
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
	  lyr.css.visibility = "visible";
	  lyr.css.display = "block";
  }
}

function hideLayer(id)
{
    var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
	  lyr.css.visibility = "hidden";
	  lyr.css.display = "none";
  }
}

function showBlock(id)
{
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

function hideBlock(id)
{
    var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

function getElemRefs(id)
{
    var el = (document.getElementById)? $(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
    if (el) el.css = (el.style)? el.style: el;
    return el;
}

function limitText(limitField, limitCount, limitNum)
{
    if (limitField.value.length > limitNum)
    {
        limitField.value = limitField.value.substring(0, limitNum);
    }
    else
    {
        limitCount.value = limitNum - limitField.value.length;
    }
}

// START clock functie: functie die klok uitschrijft (taalafhankelijk: u vs h)
function clock(pLanguage) {
	var t = new Date();
	var h = t.getHours();
	var m = t.getMinutes();
	var s = t.getSeconds();
	var units = new String("");
	var hours = t.getHours();
	var min = t.getMinutes();
	var sec = t.getSeconds();
	if (hours < 10)
	{
		hours = "" + hours;
	}

	if (min < 10)
	{
		min = "0" + min;
	}

	if (sec < 10)
	{
		sec = "0" + sec;
	}

	if (pLanguage == "FR")
	{
		$("clock_date").innerHTML = DateString(pLanguage);
        $("clock_time").innerHTML = hours + "h" + min + ":" + sec + " " ;
        window.setTimeout("clock('FR')", 900);
	}
	else
	{
		$("clock_date").innerHTML = DateString(pLanguage);
        $("clock_time").innerHTML = hours + "u" + min + ":" + sec + " " ;
		window.setTimeout("clock('NL')", 900);
	}
}
// EINDE clock functie

// START DATUM-functies gebruikt door de clock functie

	// variabelen voor alle Datum-functies
	var Today = new Date();

function GetDayFR(nDay)
{
	var Days = new Array("dimanche","lundi","mardi","mercredi",
	                     "jeudi","vendredi","samedi");
	return Days[nDay]
}
function GetDayNL(nDay)
{
	var Days = new Array("zondag","maandag","dinsdag","woensdag",
	                     "donderdag","vrijdag","zaterdag");
	return Days[nDay]
}

function GetMonthFR(nMonth)
{
	var Months = new Array("janvier","février","mars","avril","mai","juin",
	                       "juillet","août","septembre","octobre","novembre","décembre");

	return Months[nMonth]
}
function GetMonthNL(nMonth)
{
	var Months = new Array("januari","februari","maart","april","mei","juni",
	                       "juli","augustus","september","oktober","november","december");
	return Months[nMonth]
}

function DateString(pTaal)
{
if (pTaal == "NL") {
	var strDate = GetDayNL(Today.getDay()) + " " + Today.getDate();
	strDate += " " + GetMonthNL(Today.getMonth()) + " " + Today.getFullYear();
	return strDate
}
if (pTaal == "FR") {
	var strDate = GetDayFR(Today.getDay()) + " " + Today.getDate();
	strDate += " " + GetMonthFR(Today.getMonth()) + " " + Today.getFullYear();
	return strDate
}
}
// EINDE DATUM-functies gebruikt door de clock functie

// BEGIN FUNCTIE CREEËREN VAN FLASH-OBJECT
// zie /js/activecontent/AC_RunActiveContent
// EINDE FUNCTIE CREEËREN VAN FLASH-OBJECT


// START FUNCTIE OM SWF TE RESIZEN
function setFlashHeight(divid, newH)
{
	$(divid).style.height = newH+"px";
	//alert($(divid).style.name);
}
// EINDE FUNCTIE OM SWF TE RESIZEN



// FUNCTIE OM PROMOBOXEN TE DETECTEREN EN TE VERBERGEN
	function trim(value) {
	  value = value.replace(/^\s+/,'');
	  value = value.replace(/\s+$/,'');
	  return value;
	}

// FUNCTIE OM 'LEGE' IMU TE STIJLEN
	function styleEmptyImu() {

		if ($('adv_imu')) {
		 if ($('adv_imu').offsetHeight < 20){
		 $('adv_imu').style.borderBottom = "solid 2px #000";
		 }
		}
	}

// FUNCTIE OM DE GROOTTE VAN DE ZOEKBOX AAN TE PASSEN
	function toggleSBSize(afmeting) {
		var sb = $('searchfield');
		if (afmeting) { sb.className = 'gen_srch2' }
		else { sb.className = 'gen_srch1'; }
	}

// function to get an url through an Ajax call
function getUrl(divName, url)
{
    new Ajax.Updater({success:divName}, url,
    {
        method:'get',
        evalScripts:true,
        asynchronous:true
    });
}

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

function readCookie(cookieName)
{
	var theCookie = "" + document.cookie;
	var ind = theCookie.indexOf(cookieName);
	if (ind == -1 || cookieName == "")
    {
		return "";
	}

	var ind1 = theCookie.indexOf(';', ind);
	if (ind1 == -1)
    {
		ind1 = theCookie.length;
	}

	return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
}

// GET + SET COOKIE
function getCookie(NameOfCookie){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
    if (begin != -1) {           
      begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
 
  document.cookie = NameOfCookie + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "; path=/;domain=" + document.domain + ";" ;

}


/*
	algemene javascript functie maken die true/false teruggeeft en die controleert of een bepaalde adv er staat.
*/

function checkAdvBool(advType, nbr){
	// default value nbr
	if (nbr == null || nbr < 1){ nbr = 1; }
	nbr--;
	if($$('div[id="'+advType+'"]')[nbr]){
		// data-array: minumum heights
		minHeightData = new Array(	
			new Array('adv_leaderboard','20'),
			new Array('adv_sky','20'),
			new Array('adv_imu','20')
		);
		for ( var i=0, len=minHeightData.length; i<len; i++ ){
			if(minHeightData[i][0]==advType){ minHeight = minHeightData[i][1]; break;}
		}
		// get real height
		var height = $$('div[id="'+advType+'"]')[nbr].offsetHeight;
		// diff
		if(minHeight < height) {
			return true;
			// alert('Hoogte van ' + advType + ' is ' + height + ' en dat is groter dan de minimumhoogte ' + minHeight + '.\r\n\r\n' + 'true');	
		} else {
			return false;
			// alert('false'); alert('Hoogte van ' + advType + ' is ' + height + ' en dat is kleiner dan de minimumhoogte ' + minHeight + '.\r\n\r\n' + 'false');
		}
	} else {
		// This division is nonexistent.
		return false;
		// alert('De division ' + advType + ' komt minder dan ' + (1+nbr) + ' keer voor.\r\n\r\n' + 'false');	
	}
}

// CAPS
Event.observe(window, 'load', function() {
    if($('capsCloserLink'))
        $('capsCloserLink').observe('click', hideCaps);
});


function showCaps(url){
    document.getElementById("capsIframe").src = url;
	document.getElementById("capsOverlayer").style.display="block";
	document.getElementById("capsOverlayer").style.opacity="0.90";
	document.getElementById("capsOverlayer").style.filter="alpha(opacity=90)";
	document.getElementById("capsIframe").style.display="block";
    $("capsCloser").show();    
}

function hideCaps() {
    $("capsOverlayer").hide();
    $("capsIframe").hide();
    $("capsCloser").hide();

    window.parent.location.hash="reactions";
    return false;
}

// begin: controle bij zoeken op (weer)bestemming
function searchDestination_checkSearchForm(pos)
{
	if (!pos){pos="";}
	var searchTerm = $("searchTerm"+pos).value;
	
	if (searchTerm == null || searchTerm.length < 2)
	{
		alert('Gelieve ten minste 2 karakters in te vullen voor u zoekcriteria');
		return false;
	}
	else if(searchTerm == 'zoek op gemeente, land of bestemming')
	{
		alert('Geef een zoekterm in!');
		return false;
	}
	else
	{
		createCookie(searchTerm);
		return true;
	}
}

function search(naam)
{
  var str = document.cookie;
  var zstr = naam + "=";
  var start = str.indexOf(zstr, 0);
	  if(start == -1)
	  {
		return false;
	  }
	  else
	  {
		start += zstr.length;
		var eind = str.indexOf(";", start);
		if(eind == -1) eind = str.length;
		return unescape(str.substring(start, eind));
	  }
}

function createCookie(searchTerm)
{
	var cookieValue = search("weatherSearch");
	if(cookieValue == false)
	{
		cookieValue = searchTerm;
	}
	else
	{
		cookieValue+="$$"+searchTerm;
	}
	
	var expiringDate = new Date();
	expiringDate.setMonth(expiringDate.getMonth() + 1);
	document.cookie = "weatherSearch="+cookieValue+";expires="+expiringDate+";path=/";
}
// einde: controle bij zoeken op (weer)bestemming

function hideOverlayer() {
	$('siteOverlayer').hide();
}
