	//////////////////////////////////////////////////////////////////////////////////////////////
	// SETTINGS
	//////////////////////////////////////////////////////////////////////////////////////////////
	var blockStyles 		= new Array();
   	var dynamicCalls		= new Array();
	var allCategoriesVisible	= false;
	var openSpeed			= 30;
	var closeSpeed			= 20;
	var closeTimeout		= 0;
	var closeAfterTimeout		= false;
	var agt				= navigator.userAgent.toLowerCase();
	var zm_search_active_state	= "aan";
	var selectedSearchEngine	= 0;

	///////////////////////////////////////////////
	// INITDYNAMICCONTENT
	///////////////////////////////////////////////
	function initDynamicContent()
	{
		// create dynamic function-calls based on dynamic content blocks (dcb) array
		if(window.dcb)
		{
			for(var i=0; i<dcb.length; ++i)
			{
				// if feed enabled and timeout not 0
				if((dcb[i][3] == 1) && (dcb[i][0] != 0))
						dynamicCalls[dynamicCalls.length] = callLater(dynamicCalls.length, dcb[i][0], dcb[i][1], dcb[i][2]);
			}
		}

		// trigger dynamic function-calls for the first time
		if(window.dynamicCalls)
			for(var i=0; i<dynamicCalls.length; ++i)
				setTimeout(dynamicCalls[i], 5);		// execute first call (almost) immediately
	}


	///////////////////////////////////////////////
	// CALLLATER
	///////////////////////////////////////////////
	function callLater(number, timeout, id, type)
	{
	    return (function()
	    {
	    	// get the content
	        getContent(id, type);

	        // set dynamic function-call again
			setTimeout(dynamicCalls[number], timeout*1000);
	    });
	}


	///////////////////////////////////////////////
	// GETCONTENT
	///////////////////////////////////////////////
	function getContent(id, type)
	{
		requestHtml(getRequestObject(), id, type);
	}


	///////////////////////////////////////////////
	// ADDLOADEVENT
	///////////////////////////////////////////////
	function addLoadEvent(func)
	{
		var oldonload = window.onload;

		if(typeof window.onload != 'function')
		{
			window.onload = func;
		}
		else
		{
			window.onload = function()
			{
				if(oldonload)
					oldonload();

				func();
			}
		}
	}


	//////////////////////////////////////////////////////////////////////////////////////////////
	// GETOBJ - Cross-browser function that will return any object
	//
	// @param name	The name of the object to find.
	//////////////////////////////////////////////////////////////////////////////////////////////
	function getObj(name)
	{
		if(document.getElementById)
		{
			this.obj	= document.getElementById(name);
			this.style	= document.getElementById(name).style;
		}
		else if(document.all)
		{
			this.obj	= document.all[name];
			this.style	= document.all[name].style;
		}
		else if(document.layers)
		{
			this.obj	= document.layers[name];
			this.style	= document.layers[name];
		}
	}


	//////////////////////////////////////////////////////////////////////////////////////////////
	// GETREQUESTOBJECT - Cross-browser function that will return an XMLHttpRequest object
	//////////////////////////////////////////////////////////////////////////////////////////////
	function getRequestObject()
	{
		// variable for the xmlhttprequest
		var http_request = false;

		// create the httpxmlrequest object that will handle the communication with the server
		if(window.XMLHttpRequest)
		{
	    	http_request = new XMLHttpRequest();

			// override the mimetype to text/xml
			if(http_request.overrideMimeType)
				http_request.overrideMimeType("text/xml");
	    }
		else if(window.ActiveXObject)
		{
	    	http_request = new ActiveXObject("Microsoft.XMLHTTP");
	    }

	   	return http_request;
	}


	//////////////////////////////////////////////////////////////////////////////////////////////
	// RQUESTXML - Make the request and define the follow-up function.
	//
	// @param http_request	The XMLHttpRequest object that will make the call to the external resource
	// @param url			The url of the external resource
	// @param name			The name for the value in the global xml array
	// @param template		The xsl template existing in the global xsl array to use for transformation
	// @param target		The target to send the contents to
	//////////////////////////////////////////////////////////////////////////////////////////////
	function requestHtml(http_request, name, type)
	{
		url = "ssi/external/" + name + "_" + type + ".inc";

		// set function to call on ready state
		http_request.onreadystatechange = function()
		{
			processHtml(http_request, name);
		};

		// send the request to the server
		http_request.open("GET", url, true);													// send asynchronous GET request to url
		http_request.send(null);																// call send (optionally with parameters; "name=value&anothername=othervalue&so=on")
	}


	//////////////////////////////////////////////////////////////////////////////////////////////
	// PROCESSXML -	Process the recieved content.
	//				Transform the recieved content if template is set.
	//				Write the received, and optionally transformed, content to a target
	//
	// @param http_request	The XMLHttpRequest object that made the call to the external resource
	// @param name			The name for the value in the global xml array
	// @param template		The xsl template existing in the global xsl array to use for transformation
	// @param target		The target to send the contents to
	//////////////////////////////////////////////////////////////////////////////////////////////
	function processHtml(http_request, target)
	{
		// check readystate
		if(http_request.readyState == 4)
		{
			// check if server response requires a content update
			if(http_request.status == 200)
			{
				html = http_request.responseText;									// create xml object and add it to global xml array

				if(target)
					setContent(target, html);										// write the transformed content to target
			}
		}
	}


	//////////////////////////////////////////////////////////////////////////////////////////////
	// SETCONTENT - Set the content of any object using innerHTML property
	//
	// @param target 	The object to set the content for
	// @param content	The content to place in the object
	//////////////////////////////////////////////////////////////////////////////////////////////
	function setContent(target, content)
	{
		element = new getObj(target);

		element.obj.innerHTML = content;
	}


	///////////////////////////////////////////////
	// BLOKKEN INDEX
	///////////////////////////////////////////////
	function showAll(open)
	{
		if(open && !allCategoriesVisible)
		{
			document.getElementById("index_animated").style.top = '0px';

			setTimeout(hideZoeken, 350);
			setTimeout(showAnimated, 350);
		}
		else if(!open && allCategoriesVisible)
		{
			setTimeout(showZoeken, 150);
			setTimeout(hideAnimated, 200);
		}
		return false;
	}

	function autoClose()
	{
		--closeTimeout;

		if(closeTimeout <= 0)
		{
			if(closeAfterTimeout)
				showAll(false);
		}
		else setTimeout(autoClose, 1000);
	}

	function resetTimeout()
	{
		closeAfterTimeout = false;
		closeTimeout = 2;
	}

	function showAnimated()
	{
		allCategoriesVisible	= true;
		animated				= document.getElementById("index_animated").style;
		area					= document.getElementById("index_area").style;

		animated.display		= 'block';

		if(animated.top == '0px')
		{
			animated.top		= '7px';
			animated.width		= '101px';
			animated.height		= '10px';

			setTimeout(showAnimated, openSpeed);
		}
		else if(animated.top == '7px')
		{
			animated.top		= '10px';
			animated.width		= '160px';
			animated.height		= '42px';

			setTimeout(showAnimated, openSpeed);
		}
		else if(animated.top == '10px')
		{
			animated.top		= '13px';
			animated.width		= '250px';
			animated.height		= '70px';

			setTimeout(showAnimated, openSpeed);
		}
		else if(animated.top == '13px')
		{
			animated.top		= '20px';
			animated.width		= '410px';
			animated.height		= '106px';

			setTimeout(showAnimated, openSpeed);
		}
		else
		{
			animated.display	= 'none';
			area.display		= 'block';
		}
	}

	function hideAnimated(offset)
	{
		allCategoriesVisible 	= false;
		animated				= document.getElementById("index_animated").style;
		area					= document.getElementById("index_area").style;

		area.display			= 'none';
		animated.display		= 'block';

		if(animated.top == '20px')
		{
			animated.top		= '19px';
			animated.width		= '410px';
			animated.height		= '106px';

			setTimeout(hideAnimated, closeSpeed);
		}
		else if(animated.top == '19px')
		{
			animated.top		= '13px';
			animated.width		= '250px';
			animated.height		= '70px';

			setTimeout(hideAnimated, closeSpeed);
		}
		else if(animated.top == '13px')
		{
			animated.top		= '10px';
			animated.width		= '160px';
			animated.height		= '42px';

			setTimeout(hideAnimated, closeSpeed);
		}
		else if(animated.top == '10px')
		{
			animated.top		= '7px';
			animated.width		= '101px';
			animated.height		= '10px';

			setTimeout(hideAnimated, closeSpeed);
		}
		else
		{
			animated.top 		= '7px';
			animated.width		= '101px';
			animated.height		= '10px';

			animated.display 	= 'none';
		}
	}

	function hideZoeken()
	{

	}

	function showZoeken()
	{
	}
	

	///////////////////////////////////////////////
	// INITBLOCKSTYLES
	///////////////////////////////////////////////
	function initBlockStyles()
	{
		var count	= 0;
		var blocks	= document.getElementsByTagName('div');

		for(var i=0;i<blocks.length;i++)
		{
			if(blocks[i].getAttribute("id") != null)
			{
				if(blocks[i].getAttribute("id").indexOf("blok") == 0)
				{
					blockStyles[count]		= new Array();
					blockStyles[count][0]	= blocks[i].getAttribute("id");

					if(blocks[i].className != null)
						blockStyles[count][1] = blocks[i].className;

					count++;
				}
			}
		}
	}


	///////////////////////////////////////////////
	// RESETBLOCKSTYLES
	///////////////////////////////////////////////
	function resetBlockStyles()
	{
		if(blockStyles.length == 0)
			initBlockStyles();

		for(var i=0;i<blockStyles.length;i++)
			document.getElementById(blockStyles[i][0]).className = blockStyles[i][1];
	}


	///////////////////////////////////////////////
	// SETBLOCKSTYLE
	///////////////////////////////////////////////
	function setBlockStyle(block)
	{
		block = "blok_"+block;

		for(var i=0;i<blockStyles.length;i++)
		{
			if(blockStyles[i][0] == block)
			{
				document.getElementById(block).style.display	= "block";
				document.getElementById(block).className		= "blokactive";
			}
		}
	}


	// select searchengine in search dropdown (add it if not existing)
	function selectSearchEngine(se)
	{  
		seFound		= false;
		zoekSelect	= document.getElementById("zm_select");
		fixedboxselect	= document.getElementById("fixedbox_select");
		
		//imgZoek 	= document.getElementById("zoek_ico");
		var number = 0;

		for(i=0; i<zm.length; i++)
		{
			if(se == zm[i])
			{
				number=i;
			}
		}

		
		for(i=0; i<zoekSelect.options.length; i++)
		{
		
			if(se == zoekSelect.options[i].text)
			{
				zoekSelect.options[i].selected = true;
				fixedboxselect.options[i].selected = true;

			} else {
				zoekSelect.options[i].selected = false;
				fixedboxselect.options[i].selected = false;
			}
		
		
		
		}

		selectedSearchEngine = number;
		//imgZoek.src = "img/2.0/se/"+zmi[selectedSearchEngine];
		document.getElementById("zm_query").focus();
	}

	// get the right search engine text
	function getSearchText()
	{
		return "zoeken "+zmw[selectedSearchEngine];
	}


	// show/ hide extra content and set cookie
	function setmorecontent(mode, naam)
	{
		morecontent(mode, naam);

		if(naam == "categorie")
			myspinstelling[1] = mode;

		setCookie("mysp", myspinstelling.join(";"));
	}


	// write a cookie named 'name' with 'value'
	function setCookie(name, value)
	{
		if((value != null) && (value != ""))
		{
			var today	= new Date();
			var expiry	= new Date(today.getTime()+31536000000);

			d.cookie	= name + "=" + escape(value) + ";expires=" + expiry.toGMTString() + ";path=/";
		}
	}


	// open een window met hierin de webradio player
	function webradio(naam, scrwidth, scrheight, stat, resiz, target_comm, vensternaam)
	{
		sd = new Date();

		if(scrwidth == 600)
			yon = "yes";
		else
			yon = "no";

		if(resiz == "yes")
			yon = "yes";

		spradio = window.open(naam, "spradio", "toolbar=no,location=no,resizable=" + yon + ",status=no,scrollbars=" + yon + ",menubar=no,width=" + scrwidth + ",height=" + scrheight + ",top=1,left=1");

		arnostat(escape(stat));

		// zlostat
		if(target_comm.substring(0, 1) == "c")
		{
			zlostat = target_comm;

			if(zlostat.indexOf("_") != -1)
				zlostat = zlostat.substring(0, zlostat.indexOf("_"));

			var ici = new Image();
			ici.src = "http://dispatch.ilsemedia.nl/spc/?LINKID=" + eval(zlostat.substring(1, zlostat.length));
		}

		spradio.focus();
	}

	// open a link from the suggestbox
	function suggest_click(obj)
	{
		zoeksuggestie = 1;
		o(obj);
	}


	//nu links brede 4e kolom
	function nulinks(obj)
 {
 
 var naam	= "";
		var url		= "";
		var id		= "";
		
		naam		= obj.innerHTML;
		url		= obj.href;
		id		= obj.id;
		
		n(id,'K4-Nu_Actuele_berichten');
 }
	
	
	
	
	// open a link in a new window/tab using 'this' object
	function o(obj)
	{
		var naam	= "";
		var url		= "";
		var id		= "";
		
		naam		= obj.innerHTML;
		url		= obj.href;
		id		= obj.id;
		
		n(id, naam, url, obj);
	}

    
// voor redactionele suggestielinks zoekbox
function osugg(obj,originForm)
{
	var naam    = "";
	var url           = "";
	var id            = "";
	var variant = "suggest";
	if(originForm != null) variant = "suggest_" + originForm;
	naam        = obj.innerHTML;
	url         = obj.href+"#"+variant;
	id          = obj.id;
	n(id, naam, url);
}

	// open a link in a new window/tab
	function n(target_comm, naam, url, linkObject)
	{		
		//exception horoscooplinks,schoolbank, receptvandedag links can't give same zlostat id
		exception=0;

		if (url)
		{
			
			
         if (url.substring(0,75)=="http://www.margriet.nl/vrijetijd/_horoscoop/_Content_Items/ArtHoroscoopDag/")
			
			{   
				temptargetcomm=target_comm;
				target_comm="c29155";
				naam="k4_horoscoop_gadget";
				url="";
				exception=1;
			}
		                                 
			if (url.substring(0,35)=="http://www.schoolbank.nl/klasgenoot")									 
			{
				temptargetcomm=target_comm;
				target_comm="c16154";
				naam="k4-scoolbank-gadget-result";
				url="";
				exception=1;
			}
		 
			if (url.substring(0,43)=="http://www.schoolbank.nl/person_search.html")
			{
				temptargetcomm=target_comm;
				target_comm="c16154";
				naam="k4-scoolbank-gadget-meer";
				url="";
				exception=1;
			}
										 
			if (url.substring(0,46)=="http://www.vrouwonline.nl/koken/recepten/?Url=")
			{
				temptargetcomm=target_comm;
				target_comm="c29665";
				naam="k4-receptvandedag-gadget";
				url="";
				exception=1;
			}
		}  
	
		
		// zlostat ook vermeld in function s
		if(target_comm.substring(0, 1) == "c")
		{
			zlostat = target_comm;
			
			if (target_comm.substring(0,8)=="czoekbox")
		     zlostat=target_comm.substring(8,target_comm.length);

		     
				if(zlostat.indexOf("_") != -1)
				zlostat = zlostat.substring(0, zlostat.indexOf("_"));

			// dubble meting voorkomen doordat ctrl-knop te vroeg wordt losgelaten bij een tab-klik
			if(muiswgo != "yes")
			{ 
				var ici = new Image();
				ici.src = "http://dispatch.ilsemedia.nl/spc/?LINKID=" + eval(zlostat.substring(1, zlostat.length))+"&uni="+uniek();
			}

		}

		
		arnostat(escape(naam));
		
		// if url is undefined, url = naam
		if((url == null) || (url == ""))
			url = escape(naam);
		
		if((zoekopdracht == 1)||(zoeksuggestie == 1))
		{
			zoeksuggestie = 0;
			lc_click2(lc_site, lc_page, lc_pagevariant, lc_campaign, url, d.searchforit.query.value);
		}
		else
		{
			lc_click(lc_site, lc_page, lc_pagevariant, lc_campaign, url);
		}
    
    saveBTCategory(linkObject);
    
		//exception horoscooplinks,schoolbanklinks,receptvandedaglinks can't give same id
		if (exception==1)
			target_comm=temptargetcomm;

		if(tab == "aan")
		{
			datnaam	= new Date();
			tellertargets	= datnaam.getTime();
			if (document.getElementById(target_comm))
			document.getElementById(target_comm).target = tellertargets;
		
		}

		if(tab != "aan")
		{
			datnaam	= new Date();
			tellertargets	= datnaam.getTime();

			if(zoekopdracht == 0)
				document.getElementById(target_comm).target = tellertargets;

			if(wi == 0)
			{
				if(parseInt(navigator.appVersion)>=4)
					tellertargets = window.open("", tellertargets, ygeer+((screen.width/100)*80)+",height="+(((screen.height/100)*85)-200)+",left="+((screen.width/100)*9)+",top="+((screen.height/100)*14));
				else
					tellertargets = window.open("", target_comm, ygeer+"600,height=280");
			}
			else if((wi == 1) && (zoekopdracht == 0))
			{
				document.getElementById(target_comm).target="_top"
			}
			else if(wi == 2)
			{
				if(parseInt(navigator.appVersion) >= 4)
					tellertargets = window.open("", tellertargets, ygeer+((screen.width/100)*99)+",height="+(((screen.height/100)*107)-200)+",left=0,top=0");
				else
					tellertargets = window.open("", tellertargets, ygeer+"600,height=280");
			}
			else if(wi == 3)
			{
				tellertargets = window.open("", tellertargets);
			}

			if((zoekopdracht == 1) && (wi == 1))
			{
				zoekopdracht	= 0;
				location.href	= site;
			}

			if((zoekopdracht == 1) && (wi != 1))
			{
				zoekopdracht	= 0;
				tellertargets.location = site;
			}
		}

		tab = "";
	}


	// open a window with specific settings
	function s(naam, scrwidth, scrheight, stat, resiz, target_comm, vensternaam, linkObject)
	{
		sd = new Date();

		if(scrwidth == 600)
			yon = "yes";
		else
			yon = "no";

		if(resiz == "yes")
			yon = "yes";

		vensternaam = window.open(naam, vensternaam, "toolbar=no,location=no,resizable=" + yon + ",status=no,scrollbars=" + yon + ",menubar=no,width=" + scrwidth + ",height=" + scrheight + ",top=1,left=1");

		arnostat(escape(stat));
		stat = escape(stat);
		lc_click(lc_site, lc_page, lc_pagevariant, lc_campaign, stat);
		
		//zlostat
        if(target_comm.substring(0, 1) == "c")
		{
			zlostat = target_comm;
		
            if (target_comm.substring(0,8)=="czoekbox")
		     zlostat=target_comm.substring(8,target_comm.length);
		     
		     

			if(zlostat.indexOf("_") != -1)
				zlostat = zlostat.substring(0, zlostat.indexOf("_"));

			var ici = new Image();
			ici.src = "http://dispatch.ilsemedia.nl/spc/?LINKID=" + eval(zlostat.substring(1, zlostat.length));
		}
    
    saveBTCategory(linkObject);
    
		vensternaam.focus();
	}


	// onchange of the search dropdown go to the zoekenmachine instellingen page
	function wijz()
	{
		if(d.searchforit.service.options[d.searchforit.service.selectedIndex].value == "w")
			location.href = "profiel/zoeken.php";
	}

	// close or open a block
	doealles=""; 
	function p(id, close)
	{
		
		doealles="ja";
	
	if (close==1){
	var sluitblokkie= window.confirm("Wilt u dit blok sluiten en naar het onderste gedeelte van de pagina verplaatsen ?")
           if (sluitblokkie)
		   {doealles="ja";}
		   else{doealles="nee";}
		          
	              } 
		
		if (doealles=="ja")
	  {
		
		
		if((navigator.appName != "Microsoft Internet Explorer") || (parseInt(navigator.appVersion) >= 4))
		{
			var tmpBlocks = new Array();
			var blockFound = false;

			for(i=0; i < q.length; i++)
			{
				if((q[i] != id) || (close == 1))
					tmpBlocks[tmpBlocks.length] = q[i];

				if(q[i] == id)
					blockFound = true;
			}

			if(!blockFound && (close == 1))
				tmpBlocks[tmpBlocks.length] = id;

			if(close == 1)
			{
				//window.alert("Dit blok wordt gesloten en naar het onderste gedeelte van de pagina verplaatst!");
				arnostat("Inklappen" + id);
			}
			else
			{
				arnostat("Uitklappen" + id);
			}

			if(tmpBlocks.length > 0)
			{
				setCookie("blocks", tmpBlocks.join("-"));

				// convert to old id's and temporary update old cookie
				oldQ = new Array();
				for(i=0; i < tmpBlocks.length; i++)
				{
					for(j=0; j < oldIds.length; j++)
					{
						if(oldIds[j][1] == tmpBlocks[i])
							oldQ[oldIds[j][0]] = "Y";
					}
				}

				setCookie("blokken", oldQ.join(";"));
			}
			else
			{
				delCookie("blocks");
				delCookie("blokken");
			}

			top.location = "./";
		}
		else
			window.alert("Het sluiten van blokken is niet mogelijk met de versie van uw browser (3.0).");
	}}


     //blok vergelijk providers functions	
	
	function provider(providerzend)
{
if (providerzend=="adsl/kabel internet") bbformpje (" ");
if (providerzend=="digitale televisie")  bbformpje ("digitatv");
if (providerzend=="internet + telefonie")bbformpje ("&Filter=telefony=Ja");
if (providerzend=="internet + telefonie + TV") bbformpje("&Filter=television=Ja");
}
	
	
	// open new window and post query to breedbandshop.nl
	function bbformpje(provparm)
	{
		valid	= "0123456789";
		site	= "http://www.breedbandshop.nl";

		for(var ind = 0; ind < document.forms.adslformpje.huisnr.value.length; ind++)
		{
			temp = "" + document.forms.adslformpje.huisnr.value.substring(ind, ind + 1);

			if(valid.indexOf(temp) == "-1")
			{
				alert("Het huisnummer is niet compleet of niet juist, zo mogen er bijvoorbeeld geen toevoegingen worden ingetikt.");
				valid = "no";
				break;
			}
		}

		if(document.forms.adslformpje.postcode.value.length != 6)
		{
			alert("Verkeerde invoer van de postcode.");
		}
		else if(document.forms.adslformpje.huisnr.value.length == 0)
		{
			alert("Geen huisnummer ingevoerd.");
		}
		else if(valid != "no")
		{
			
			
			site			= "http://www.breedbandshop.nl/Default.aspx?Location=PCCheck&aff_id=109&SiteID=1&ZipNumbers=" + document.forms.adslformpje.postcode.value.substring(4, 0) + "&ZipLetters=" + document.forms.adslformpje.postcode.value.substring(6, 4) + "&HouseNumber=" + document.forms.adslformpje.huisnr.value+provparm;

if (provparm=="digitatv")
{
site="http://breedbandshop.digitaaltvkijken.nl/default.aspx?Location=PCCheck&aff_id=330&ZipNumbers="+document.forms.adslformpje.postcode.value.substring(4, 0) + "&ZipLetters=" + document.forms.adslformpje.postcode.value.substring(6, 4) + "&HouseNumber=" + document.forms.adslformpje.huisnr.value;
}


			zoekopdracht	= 1;

			n("c13522", "vergelijk-breedband-formulier");

			var pc			= 	new Image();
			pc.src			= 	"http://icons.ilse.nl/nli/storeuserinfo.gif?postcode=" + document.forms.adslformpje.postcode.value.substring(6, 0);
		}
	}
	
    //end blok vergelijk providers functions	
	
	
	
	// open new window and post query to breedbandshop.nl
	function bbform()
	{
		valid	= "0123456789";
		site	= "http://www.breedbandshop.nl";

		for(var ind = 0; ind < document.forms.adslform.huisnr.value.length; ind++)
		{
			temp = "" + document.forms.adslform.huisnr.value.substring(ind, ind + 1);

			if(valid.indexOf(temp) == "-1")
			{
				alert("Het huisnummer is niet compleet of niet juist, zo mogen er bijvoorbeeld geen toevoegingen worden ingetikt.");
				valid = "no";
				break;
			}
		}

		if(document.forms.adslform.postcode.value.length != 6)
		{
			alert("Verkeerde invoer van de postcode.");
		}
		else if(document.forms.adslform.huisnr.value.length == 0)
		{
			alert("Geen huisnummer ingevoerd.");
		}
		else if(valid != "no")
		{
			site			= "http://www.breedbandshop.nl/Default.aspx?Location=PCCheck&aff_id=109&SiteID=1&ZipNumbers=" + document.forms.adslform.postcode.value.substring(4, 0) + "&ZipLetters=" + document.forms.adslform.postcode.value.substring(6, 4) + "&HouseNumber=" + document.forms.adslform.huisnr.value;
			zoekopdracht	= 1;

			n("c13522", "vergelijk-breedband-formulier");

			var pc			= 	new Image();
			pc.src			= 	"http://icons.ilse.nl/nli/storeuserinfo.gif?postcode=" + document.forms.adslform.postcode.value.substring(6, 0);
		}
	}


	// open new window and post query to kieskeurig.nl
	function pzform()
	{   
	//bij 1 invoerveld altijd onsubmit="return false; in form gebruiken
		var query	= "";
		pz_form		= document.forms.prijszoekerForm;

		if(pz_form.wat.value.length == 0)
		{
			alert("Vul eerst Wat in om een prijs te zoeken.");
		}
		else
		{
			query = pz_form.wat.value;
			site = "http://www.kieskeurig.nl/zoeken/index.html?q="+query;
			zoekopdracht = 1;
			n("c25197", "vergelijk-prijs-formulier");
		}
	}

  
	
		
	
	
	// open new window and post query to telefoongids.nl
	function tzform()
	{
		
		
		var query	= "";
		tz_form		= document.forms.nummerzoekerForm;
        
		if (tz_form.telnr[0].checked)
		 {
			if(tz_form.wie.value.length == 0)
			{   
			alert("Vul eerst een naam in om een nummer te zoeken.");
			}
			else if (tz_form.waar.value.length == 0)
			{  
			alert("Vul eerst een plaats in om een nummer te zoeken.")
			}  
			else
			{
			query = tz_form.wie.value;
			query2 = tz_form.waar.value;

			site = "http://dtgi.detelefoongids.nl/dtgi/ZoekInDeTelefoongids.do?locationType=LOCALITY&req_source=homepage&type=basic&x=39&y=0&edsacid=l-78278724462-8-2&wie=" + query +  "&waar=" + query2;
			zoekopdracht = 1;
			n("c15958", "k4-zoektelefoon-nrs");
			}
	    }	
	
	  if (tz_form.telnr[1].checked)
	   {
	   
	    if(tz_form.wie.value.length == 0)
			{   
			alert("Vul eerst een naam in om een nummer te zoeken.");
			}
	   
           else
			{
			query = tz_form.wie.value;
			query2 = tz_form.waar.value;

			site="http://www.telefoonboek.nl/zoeken/"+query+"/"+query2+"/?utm_source=startpagina&utm_medium=cpc&utm_campaign=gadget"
			
			zoekopdracht = 1;
			n("c29248_", "k4-zoektelefoon-nrs");
			}
	   } 
	
	
	}
	

	
	
	
	
	
	// open new window and post query to marktplaats.nl
	gomarktplaats="";
	function zwform()
	{
		var query	= "";var query2="";
		zw_form		= document.forms.zoekinwijkForm;

		//remove spaces
		zw_form.postcode.value=zw_form.postcode.value.replace(/\s/g, "");
		
		if(zw_form.wat.value.length == 0)
		{   
			alert('Voor een goed zoekresultaat moet je eerst het veld "wat" invullen');
		}
		else
		{
			query = zw_form.wat.value;
			gomarktplaats="yes";
		}
		
		query2 = zw_form.postcode.value;

		if (zw_form.postcode.value.length < 4 || zw_form.postcode.value.length >6)
		{ 		
			if (zw_form.postcode.value.length!=0)
			{
				alert("Om te zoeken met postcode  moet je correct je  postcode invullen");
				gomarktplaats="no";
			}
		}  

		if (gomarktplaats=="yes")
		{				
			site = "http://kopen.marktplaats.nl/search.php?from_advanced=1&q="+query+"&g=&u=&price_method=numeric&pmin=&pmax=&price_type=0&loc_type=zip&distance=&postcode="+query2+"&tb=&submit1=Zoek";
			zoekopdracht = 1;
			n("c16126", "k4-marktplaatszoeker-gadget");
		}
	}
	
	
	// schoolbank gadget
	function scform()
	{
		var query	= "";
		zw_form		= document.forms.schoolbankForm;
				
		if(zw_form.wie.value.length == 0)
		{   
			alert("Vul eerst Wie  in om in te vullen wie u zoekt.");
		}
		else
		{
			query = zw_form.wie.value;
			
			//arnostatmeting
			schoolval="k4-schoolbankzoeker-gadget";
			arnostat(escape(schoolval));
			lc_click(lc_site, lc_page, lc_pagevariant, lc_campaign, schoolval);

			schoolquery="active/gadgets/schoolbank/schoolbank_aggregator.php?start="+query;
			if(document.getElementById('schoolbank'))
			{
				document.getElementById('schoolbank').style.display = "block";
			}
			ajaxpage(schoolquery, 'schoolbank')
		}
	}


	function lastform()
	{ //bij 1 invoerveld altijd onsubmit="return false; in form gebruiken
		var query	= "";
		last_form		= document.forms.lastfmForm;

		if(last_form.music.value.length == 0)
		{
			alert("Vul eerst een artiest of stijl in om een nummer te luisteren.");
		}
		else
		{
			query = last_form.music.value;
			
			//site = "http://www.last.fm/webclient/popup/?radioURL=lastfm%3A%2F%2Fartist%2F"+query+"%2Fsimilarartists&resourceID=undefined&resourceType=undefined";
			//site = "http://www.last.fm/widgets/popup?widget=radio&colour=grey&from=search&path=&url=artist%252F"+query+"%252Fsimilarartists&size=regular&autostart=1";
			site = "http://www.last.fm/widgets/popup/?url=artist%2F"+query+"%2Fsimilarartists&colour=grey&size=regular&autostart=1&from=popup&widget=radio&resize=0";
			
			//s(site, 360, 200, 'k4_lastfm_gadget', 'no', '', 'k4_last_fmgadget'); 
			s(site, 222, 222, 'k4_lastfm_gadget', 'no', '', 'k4_last_fmgadget'); 
		}
	}
	
	
	
	//ajax code voor php proxy zoals schoolbank
	function ajaxpage(url, containerid)
	{
		// melding bezig met zoeken
		document.getElementById(containerid).innerHTML="<span style='font-size:11.5px;'>Bezig met zoeken...</span>";

		var page_request = false;
		if (window.XMLHttpRequest)
		{
			// if Mozilla, Safari etc
			page_request = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			// if IE
			try {
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e)
			{
				try
				{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
		{
			return false;
		}

		page_request.onreadystatechange=function(){
			loadpage(page_request, containerid);
		}
		page_request.open('GET', url, true);
		page_request.send(null);
	}

	function loadpage(page_request, containerid)
	{
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
			document.getElementById(containerid).innerHTML=page_request.responseText;
	
	//no results suggestiebox afhandeling
	if (containerid=="zm_suggest_content")
	suggest_result(containerid);
	
	}
	
	
	//zoekbox suggestions code
	var suggest_stage = 0;
	var suggest_state = 'close';
	var suggest_last_query = "";
	var suggesta_last_query = "";
    var zoekassistent_noresult="";
    var suggest_stage_count=11;
    var ss="";
	var ssheight="";
	
function suggest_result(containerid)
{
    //no results suggestiebox afhandeling
zoekassistent_noresult=document.getElementById('zm_suggest_content').innerHTML.replace(/\s+/g,'');
		
		//bepaal hoogte scherm van var, voor afbeeldingsloop
		suggest_stage_count_status()
		
	if (zoekassistent_noresult.substring(0,45)=="GeenrelevanteresultatenopStartpaginagevonden.")	
	 {	
	 	document.getElementById("zm_suggest").style.height='30px';
	 }
	
	else {  
			if (document.getElementById("zm_suggest").style.height=='30px')
			  {			
			      //document.getElementById("zm_suggest").style.height='100px';
			     
				  activate_suggest_stage_count_status()
		      }
	     
		 }
	          
			                         
		if (document.getElementById("zm_suggest").style.height!='30px' && suggest_state == 'open' )
		{activate_suggest_stage_count_status();}
					 
}

function activate_suggest_stage_count_status()

{ 

ss = document.getElementById("zm_suggest");

if (suggest_stage_count==0)
	{ss.style.height="40px";}
if (suggest_stage_count==2)
	ss.style.height="55px";
if (suggest_stage_count==4)
  ss.style.height="70px";
if (suggest_stage_count==8)
	ss.style.height="90px";
if (suggest_stage_count==11)
	ss.style.height="100px";

	
}


function suggest_stage_count_status()
{

if (zoekassistent_noresult.toLowerCase().indexOf("<br>1.")!=-1)
	  suggest_stage_count=0;	
	if (zoekassistent_noresult.toLowerCase().indexOf("<br>2.")!=-1)
	  suggest_stage_count=2;	
	if (zoekassistent_noresult.toLowerCase().indexOf("<br>3.")!=-1)
	  suggest_stage_count=4;	
	if (zoekassistent_noresult.toLowerCase().indexOf("<br>4.")!=-1)
	  suggest_stage_count=8;	
	if (zoekassistent_noresult.toLowerCase().indexOf("<br>5.")!=-1)
     suggest_stage_count=11;
return suggest_stage_count
}


	
function suggest_open_step()
{    
	ss = document.getElementById("zm_suggest");
	
	//bepaal de hoogte scherm van var, voor afbeeldingsloop
	//suggest_stage_count_status();
	
	
	
	    //no results suggestiebox afhandeling
	if (zoekassistent_noresult.substring(0,45)=="GeenrelevanteresultatenopStartpaginagevonden." )	
	   
	   {	
	    ss.style.height='30px';
		
	   }
	
	else    {
	
	     
		 if(suggest_stage==0)
		ss.style.height='40px';
	if(suggest_stage==1)
	{ss.style.height='55px';}	
	if(suggest_stage==2)
		ss.style.height='60px';
	if(suggest_stage==3)
		ss.style.height='65px';
	if(suggest_stage==4)
		ss.style.height='70px';
	if(suggest_stage==5)
		ss.style.height='75px';
	if(suggest_stage==6)
		ss.style.height='80px';
	if(suggest_stage==7)
		ss.style.height='85px';
	if(suggest_stage==8)
		ss.style.height='90px';
	if(suggest_stage==9)
		ss.style.height='95px';
	if(suggest_stage==10)
		ss.style.height='100px';
		
		   }
	    
	suggest_stage++;
	if(suggest_stage < suggest_stage_count)
	{
			setTimeout(suggest_open_step,50);
	}
	else
	{
		ss.style.overflow='auto';
		if (zoekassistent_noresult.toLowerCase().indexOf("<br>2.")==-1)
		{ss.style.height="40px";}
	 if (zoekassistent_noresult.substring(0,45)=="GeenrelevanteresultatenopStartpaginagevonden." )
	ss.style.height="30px";
		 suggest_state = "open";
	     
	}

         

}

function suggest_close_step()
{ ssheight=ss.style.height;
  ssheight=ssheight.substring(0,ssheight.length-2)
	ss = document.getElementById("zm_suggest");
	if(suggest_stage==0)
		ss.style.height='0px';
	if(suggest_stage==1 && ssheight >= 50 )
		ss.style.height='50px'; 
	if(suggest_stage==2 && ssheight >= 75)
		ss.style.height='75px';
	
	
	
	suggest_stage--;
	if(suggest_stage >= 0)
	{
		setTimeout(suggest_close_step,100);
	}
	else
	{
		suggest_state = "close";
	}
}

function suggest_open()
{   suggest_state = "opening";
	ss = document.getElementById("zm_suggest");
	ss.style.overflow='hidden';	
	ss.style.height='25px';
	suggest_stage = 0;
	setTimeout(suggest_open_step,10);
}

function suggest_close()
{
	suggest_state = "closing";
	ss = document.getElementById("zm_suggest");
	ss.style.overflow='hidden';
	suggest_stage = 3;
    if (zoekassistent_noresult.substring(0,50)=="GeenrelevanteresultatenopStartpaginagevonden.")
	suggest_stage=0;suggest_stage_count=11;
		
	if(readCookieZM('zm_search_active') == "aan")
	{
		
		
		//document.getElementById('zm_pop_switch').style.display = "none";
	    //testlinks onderaan suggestiebox weer uit
		//document.getElementById('zm_pop_left').innerHTML="";
		//zoekknopjes altijd aan...
	document.getElementById('zm_pop_switch').style.display = "block";
	
	}
	else
	{
		document.getElementById('zm_pop_switch').style.display = "block";
	}
	setTimeout(suggest_close_step,10);
}



	function suggest(o)
{
	var val = o.value;
	//defeat ' js error 
	val = val.replace(/'/g, "’");
	//stel hier de timeout vertraging  in 
	var t=setTimeout("doSuggest('"+o+"', '"+val+"')",750);

	

}

function doSuggest(o,value)
{ 
	var o = document.getElementById('zm_query');
	var currestSuggestState = readCookieZM('zm_search_active');
	if(o.value == value)
	{

		if(currestSuggestState)
		{
			zm_search_active_state = currestSuggestState;
		}
		else
		{
			activate();
		}
		
		document.getElementById('zm_pop_switch').style.display = "block";
	
		
		
		if(readCookieZM('zm_search_active') == "aan")
		{
			if(o.value == suggest_last_query) return false;
			suggest_last_query = o.value;
		
			ss = document.getElementById("zm_suggest_content");
			if(ss)
			{ 
				
				
				
				if(o.value.length>0)
				{
					if(suggest_state == "close")
					{
						suggest_open();
					}
				}
				else
				{
					ss.innerHTML = "";
					if(suggest_state == "open")
						suggest_close();
					return false;
				}
				//
			}
	
	
	var url = "active/suggest.php?q="+escape(o.value)+"&version="+contentversion.toLowerCase();
		ajaxpage(url, "zm_suggest_content");
				
		}
	}


}

function doSuggesties(o)
{
	var el = document.getElementById(o);
	//defeat ' js error
	el.value = el.value.replace(/'/g, "’");
    
	var t=setTimeout("doSuggestiesAction('"+el.value+"')",750);
}

function doSuggestiesAction(value)
{
	var el = document.getElementById('suggesties_q');
	if(el.value == value)
	{
		document.getElementById('suggesties_content').style.display = "block";
//		var el = document.getElementById(id);
		
		if(el.value == suggesta_last_query) return false;
		suggesta_last_query = el.value;
	
		var url = "active/searchdemo/suggesties.php?q="+el.value;
		ajaxpage(url, "suggesties_content");
	}
}

function goSuggesties()
{

	var el = document.getElementById('suggesties_q');
	if(el.value != "")
	{
		var query	= "";
		
		if(el.value.length == 0 || el.value == ".startpagina.nl")
		{
		 // do nothing
		}
		else
		{
	
			query = el.value;
			site			=	"http://alias.pagina.nl/redirect.php?q="+query;
			
			zoekopdracht=1;
			n("ndochterzoeksuggestieblok","k4-dochtersuggestie-gadget")
			
		
		}
	}
}


function createCookieZM(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookieZM(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) {
			return c.substring(nameEQ.length,c.length);
		}
	}
	return null;
}

function eraseCookieZM(name)
{
	createCookie(name,"",-1);
}

function doSearchSuggestion(q)
{
	document.searchforit.zm_query.value = q;
	doSearch();
	void(0);
}


function activate()
{
	var currentSuggestActiveState = readCookieZM('zm_search_active');
	var aanknop = document.getElementById('suggest_aan_knop');
	var uitknop = document.getElementById('suggest_uit_knop');

	if(currentSuggestActiveState != "aan")
	{
		aanknop.style.color = "#FF9000";
		aanknop.style.fontWeight = "bold";
		
		uitknop.style.color = "";
		uitknop.style.fontWeight = "";
		
		createCookieZM('zm_search_active', "aan", 360);
	}
	
}

function deactivate()
{
	var currentSuggestActiveState = readCookieZM('zm_search_active');
	var aanknop = document.getElementById('suggest_aan_knop');
	var uitknop = document.getElementById('suggest_uit_knop');

	if(currentSuggestActiveState != "uit")
	{
		uitknop.style.color = "#FF9000";
		uitknop.style.fontWeight = "bold";
		
		aanknop.style.color = "";
		aanknop.style.fontWeight = "";
		
		arnostatDemo('zoekbox-assistent-uitgeschakeld');
		
		createCookieZM('zm_search_active', "uit", 360);
		if(suggest_state == "open")
		{
			suggest_close();
		}
	}
	
	
}



//testlinks in het suggestieblokje, onderaan
suggestie_test="<ul><li><a rel=\"nofollow\" href=\"http://www.verzekeringssite.nl/zorgverzekering/?ref=startpaginaZO\" id=\"czoekboxc57\" onclick=\"n('czoekboxc57','routeplanner','http://www.verzekeringssite.nl/zorgverzekering/?ref=startpaginaZO/#suggest');\">zorgverzekering</a></li><li><a rel=\"nofollow\" href=\"http://www.hyves.nl/\"  id=\"su01\"                                onclick=\"n('su01','hyves','http://www.hyves.nl/#suggest');\">hyves</a></li><li><a rel=\"nofollow\" href=\"http://www.marktplaats.nl/index.php?url=http%3A%2F%2Fstatisch.marktplaats.nl%2Fhtml%2Fstartpagina.htm\"  id=\"czoekboxc27386\" onclick=\"n('czoekboxc27386','marktplaats','http://www.marktplaats.nl/index.php?url=http%3A%2F%2Fstatisch.marktplaats.nl%2Fhtml%2Fstart$');\">marktplaats</a></li><li><a rel=\"nofollow\" href=\"http://ad.nl.doubleclick.net/clk;207122903;29405186;a?http://www.ziggo.nl/producten/alles-in-1/\" id=\"czoekboxc27693\" onclick=\"n('czoekboxc27693','ziggo','http://ad.nl.doubleclick.net/clk;207122903;29405186;a?http://www.ziggo.nl/producten/alles-in-1/#suggest');\">ziggo</a></li><li><a rel=\"nofollow\" href=\"http://www.youtube.nl/\" id=\"su05\" onclick=\"n('su05','youtube','http://nl.youtube.com/browse?s=mp&c=23&l=&e=nl_NL#suggest');\">youtube</a></li></ul>" 



function suggestie_test_links()
{

 //if (contentversion=="B")
 //{
  document.getElementById('zm_pop_left').innerHTML=suggestie_test
 //}

}

function zm_search_switch(currentSuggestActiveState)
{  

	var currentSuggestActiveState = readCookieZM('zm_search_active');
	var aanknop = document.getElementById('suggest_aan_knop');
	var uitknop = document.getElementById('suggest_uit_knop');

	if(currentSuggestActiveState != "null" && currentSuggestActiveState != null)
	{
		document.getElementById('zm_pop_switch').style.display = "block";	
	    
		
	
	}
	
	
	
	if(currentSuggestActiveState == "uit")
	{
		uitknop.style.color = "#FF9000";
		uitknop.style.fontWeight = "bold";
		
		aanknop.style.color = "";
		aanknop.style.fontWeight = "";
	}
	
	if (currentSuggestActiveState == "aan" || currentSuggestActiveState == null)
	{
		aanknop.style.color = "#FF9000";
		aanknop.style.fontWeight = "bold";
		
		uitknop.style.color = "";
		uitknop.style.fontWeight = "";
	}
	
}

var zm_query_fill_var = "new";

var selected = 0;




//end zoekbox suggestion code


	///////////////////////////////////////////////
	// STATISTIC CODES
	///////////////////////////////////////////////


	///////////////////////////////////////////////
	// ARNOSTAT
	///////////////////////////////////////////////

	// arnostat breed
	function lc_void()
	{
		return true;
	}

	function lc_handle(url)
	{
		var url = 'http://stats.ilsemedia.nl/click.gif'+url;
		if(document.images)
		{
			var lc_img=new Image(1,1);
			lc_img.src=url;
			lc_img.onload=function (){lc_void();}
		}
		else
		{
			document.write('<img src="'+url+'" width="1" height="1" alt="">');
		}
	}

	function lc_click(lc_s, lc_p, lc_pv, lc_c, lc_l)
	{
		var lc_url='?a=c&s='+lc_s+'&p='+lc_p+'&pv='+lc_pv+'&c='+lc_c+'&l='+escape(lc_l)+'&t='+(new Date()).getTime();
		lc_handle(lc_url);
	}

	function lc_click2(lc_s, lc_p, lc_pv, lc_c, lc_l, lc_q)
	{
		var lc_url='?a=c&s='+lc_s+'&p='+lc_p+'&pv='+lc_pv+'&c='+lc_c+'&cp[q]='+escape(lc_q)+'&l='+escape(lc_l)+'&t='+(new Date()).getTime();
		lc_handle(lc_url);
	}

	function lc_visit(lc_s, lc_p, lc_pv, lc_c)
	{
		var lc_url='?a=v&s='+lc_s+'&p='+lc_p+'&pv='+lc_pv+'&c='+lc_c+'&t='+(new Date()).getTime();
		var ref=document.referrer;
		ref=(ref.lastIndexOf('/')==ref.length-1)?ref.substring(ref.lastIndexOf('/'),0):ref;
		if(ref.length>0)
			lc_url+='&r='+escape(ref);
		lc_handle(lc_url);
	}


function alias_focus()
{
	if(document.getElementById('suggesties_q').value == ".startpagina.nl")
	{
		document.getElementById('suggesties_q').style.color = "black";
		document.getElementById('suggesties_q').value = "";
	}	
}

function alias_blur()
{
	if(document.getElementById('suggesties_q').value == "")
	{
		document.getElementById('suggesties_q').style.color = "#969696";
		document.getElementById('suggesties_q').value = ".startpagina.nl";
	}
}


			

///////////////////////////////////////////////
// Zoekbox
///////////////////////////////////////////////
   

function doSearch(originForm)
{
	zoekopdracht      = 1;
	dosearchcom       = "";
	wo                = document.getElementById(originForm+"_query").value;
	searchitems       = escape(wo);
	index       	  = document.getElementById(originForm+"_select").selectedIndex;
	site        	  = document.getElementById(originForm+"_select").options[index].value;
	dosearchcom 	  = site.substring(site.indexOf("(") + 1, site.indexOf(")"));
	site        	  = "http://" + site.substring(site.indexOf(")") + 1, site.length);
	//parameters vastplakken aan "technoratie" zoekmachine, voor ned resultaten
	if (site.substring(33,0)=="http://www.technorati.com/search/")
	{
		  site        += searchitems + "?language=nl&authority=n";
	}
	//parameters vastplakken aan metacrawler
	if (site.substring(54,0)=="http://www.metacrawler.com/metacrawler/ws/results/Web/")
	{ 
		  site +=searchitems +"/1/107/RightNav/Relevance/iq=true/zoom=off/_iceUrlFlag=7?_IceUrl=true";      
	}
	//10% -> 90% ab test startgoogle
	if (site.substring(45,0)=="http://startgoogle.startpagina.nl/?start=0&q=")
	{
		if(originForm == "zm")
		{
			if(Math.random()<(1/10))
			{
				site="http://startgoogle.startpagina.nl/index2.php?start=0&q="
				site += searchitems;
			}
			else
			{
				site="http://startgoogle.startpagina.nl/?start=0&q="
				site += searchitems;
			}
		}
		else
		{
			if(Math.random()<(1/10))
			{
				site="http://startgoogle.startpagina.nl/index4.php?start=0&q="
				site += searchitems;
			}
			else
			{
				site="http://startgoogle.startpagina.nl/index3.php?start=0&q="
				site += searchitems;
			}
		}
		//end ab test
	}
	else
	{
		site            += searchitems;
	}
	if((searchitems == "") || (searchitems == null))
	{
		  alert("\nOm iets te kunnen vinden dient u minimaal een keyword in te typen ...");
		  document.getElementById(originForm+"_select").focus();zoekopdracht=0;
	}
	else
	{
		  zoekmachine = document.getElementById(originForm+"_select").options[index].text ;
		  if (zoekertDisabled != '') {
				zoekmachine += "#" + "fixedbox_disabled";
			} else {
				if(originForm != 'zm')
				zoekmachine += "#" + originForm;
			}
		  n(dosearchcom, zoekmachine);
	}
}     

function close_fixedbox()
{
	if (zoekertDisabled == false) {
		setCookie("nfb","true");
		zoekertDisabled = true;
		setSearchbottombar();
	} else {
		setCookie("nfb","false");
		zoekertDisabled = false;
		setSearchbottombar();
	}
	return false;
}

/**
* Geometry.js: portable functions for querying window and document geometry
*
* This module defines functions for querying window and document geometry.
*
* getWindowX/Y( ): return the position of the window on the screen
* getViewportWidth/Height( ): return the size of the browser viewport area
* getDocumentWidth/Height( ): return the size of the document
* getHorizontalScroll( ): return the position of the horizontal scrollbar
* getVerticalScroll( ): return the position of the vertical scrollbar
*
* Note that there is no portable way to query the overall size of the
* browser window, so there are no getWindowWidth/Height( ) functions.
*
* IMPORTANT: This module must be included in the <body> of a document
*            instead of the <head> of the document.
*/
var Geometry = {};

if (window.screenLeft) { // IE and others
    Geometry.getWindowX = function( ) { return window.screenLeft; };
    Geometry.getWindowY = function( ) { return window.screenTop; };
}

else if (window.screenX) { // Firefox and others
    Geometry.getWindowX = function( ) { return window.screenX; };
    Geometry.getWindowY = function( ) { return window.screenY; };

}

if (window.innerWidth) { // All browsers but IE
    Geometry.getViewportWidth = function( ) { return window.innerWidth; };
    Geometry.getViewportHeight = function( ) { return window.innerHeight; };
    Geometry.getHorizontalScroll = function( ) { return window.pageXOffset;
};

    Geometry.getVerticalScroll = function( ) { return window.pageYOffset; };
}

else if (document.documentElement && document.documentElement.clientWidth) {
    // These functions are for IE 6 when there is a DOCTYPE
    Geometry.getViewportWidth =
        function( ) { return document.documentElement.clientWidth; };
    Geometry.getViewportHeight =
        function( ) { return document.documentElement.clientHeight; };
    Geometry.getHorizontalScroll =
        function( ) { return document.documentElement.scrollLeft; };
    Geometry.getVerticalScroll =
        function( ) { return document.documentElement.scrollTop; };
}

else if (document.body.clientWidth) {
    // These are for IE4, IE5, and IE6 without a DOCTYPE
    Geometry.getViewportWidth =
        function( ) { return document.body.clientWidth; };
    Geometry.getViewportHeight =
        function( ) { return document.body.clientHeight; };
    Geometry.getHorizontalScroll =
        function( ) { return document.body.scrollLeft; };
    Geometry.getVerticalScroll =
        function( ) { return document.body.scrollTop; };

}

// These functions return the size of the document. They are not window
// related, but they are useful to have here anyway.
if (document.documentElement && document.documentElement.scrollWidth) {
    Geometry.getDocumentWidth =
        function( ) { return document.documentElement.scrollWidth; };
    Geometry.getDocumentHeight =
        function( ) { return document.documentElement.scrollHeight; };
}

else if (document.body.scrollWidth) {
    Geometry.getDocumentWidth =
        function( ) { return document.body.scrollWidth; };
    Geometry.getDocumentHeight =
        function( ) { return document.body.scrollHeight; };

} 

function setSearchbottombar(){
	(Geometry.getVerticalScroll() < 193 && !zoekertDisabled) ? $("#fixedbox").hide():$("#fixedbox").show();
	if (zoekertDisabled) {
		$("#fixedbox").css('position','static');
		$('#fixedbox_right a:first').html('<b>+</b> activeer');
		$('#fixedbox_right a:first').attr('title','hiermee is de zoekbox altijd in beeld');
		$('#fixedboxholder').css('height','');
	} else {
		$("#fixedbox").css('position','fixed');
		$('#fixedbox_right a:first').html('<b>x</b> sluiten');
		$('#fixedbox_right a:first').attr('title','');
		$('#fixedboxholder').css('height','50px');
	}
}




//klikbare gadget box, hele div klikbaar   
	function gadgetwin(target, url, title, zlostatid, id)
{ 
			var gourl=url
			datnaam	= new Date();            
            teller_targets	= datnaam.getTime();
			   document.getElementById(id).target = teller_targets;
			
			//energieblok aanpassing, bij eerste selectie andere landings page
			if (document.getElementById("c29924"))
			{			
			   index=document.getElementById("c29924").selectedIndex;
	           site=document.getElementById("c29924").options[index].value;
			   if (site=="Anders / overige")
			   site="Onbekend";			   
			   url="http://www.laagstehypotheekofferte.nl/campagnes/?u=10480&evn1=leverancier&evw1="+site;
			    gourl=url;
			}
			//end energieblok aanpassing

         
		// zlostat
		if(zlostatid!=null)
		{
			//let op: geen c voor zlostatnummer
			if(zlostatid!='')
			{
				// zlostat
				var ici = new Image();
				ici.src = "http://dispatch.ilsemedia.nl/spc/?LINKID=" + zlostatid + "&uni=" + uniek();
			}
		}
         
		 // arnostat		
		arnostat(escape(title));url=escape(title);		
		lc_click(lc_site, lc_page, lc_pagevariant, lc_campaign, url);
		
		
		
		teller_targets = window.open(gourl,teller_targets,"toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,menubar=yes,width="+((screen.width/100)*80)+",height="+(((screen.height/100)*85)-200)+",left="+((screen.width/100)*9)+",top="+((screen.height/100)*14));
		

}


//autotrack code

function awin(target, url, title, zlostatid)
{ 
			datnaam	= new Date();            
            teller_targets	= datnaam.getTime();
			if (document.getElementById("autotrack_zoek"))
			document.getElementById("autotrack_zoek").target = teller_targets;
		


// zlostat
		if(zlostatid!=null)
		{
			if(zlostatid!='')
			{
				// zlostat
				var ici = new Image();
				ici.src = "http://dispatch.ilsemedia.nl/spc/?LINKID=" + zlostatid + "&uni=" + uniek();
			}
		}
         
		 // arnostat
		
		arnostat(escape(title));url=escape(title);		
		lc_click(lc_site, lc_page, lc_pagevariant, lc_campaign, url);
		
		
		
		teller_targets = window.open("",teller_targets,"toolbar=yes,location=yes,resizable=yes,status=yes,scrollbars=yes,menubar=yes,width="+((screen.width/100)*80)+",height="+(((screen.height/100)*85)-200)+",left="+((screen.width/100)*9)+",top="+((screen.height/100)*14));
		

}
//einde autotrack code

function saveBTCategory (linkObject)
{
  //Send the correspondig category title (if any) for BT profiling.
  
  if (linkObject !== undefined)
  {
    var blockTitle;
    
    if (linkObject.parentNode.parentNode.parentNode.getElementsByTagName('h1')[0] !== undefined)
    {
      blockTitle = linkObject.parentNode.parentNode.parentNode.getElementsByTagName('h1')[0].innerHTML;
    }
    
    else if (linkObject.parentNode.parentNode.parentNode.getElementsByTagName('h2')[0] !== undefined)
    {
      blockTitle = linkObject.parentNode.parentNode.parentNode.getElementsByTagName('h2')[0].innerHTML;
    }
    
    if (blockTitle !== undefined)
    {
      //Additional check to make sure it's a category
      if (linkObject.parentNode.parentNode.parentNode.parentNode.attributes['id'] !== undefined)
      {
        var columnId = linkObject.parentNode.parentNode.parentNode.parentNode.attributes['id'].nodeValue;
        
        if (columnId === 'kolomlinks' || columnId == 'kolommidden' || columnId == 'kolomrechts')
        {
          var btImageUrl = 'http://tr.bt.ilsemedia.nl/Cnt/ilsemedia/CP/startpagina.nl/blok/' + escape(blockTitle.toLowerCase());
          
          var btImage = new Image();
          btImage.src = btImageUrl;
        }
      }
    }
  }
}



// initialize the dynamic content function calls
addLoadEvent(initDynamicContent);

// initialize the block styles array
addLoadEvent(initBlockStyles);
	

function setHrefs()
{
    //Replace href of two links in category 'Nieuws'
    
    //rtl boulevard
    if (document.getElementById('n11687895591') !== null)
    {
      document.getElementById('n11687895591').href = 'http://jmp.ilsemedia.nl/?a=r&s=startpagina&p=www&l=' + escape(document.getElementById('n11687895591').href);
    }
    
    //mexicaanse griep
    if (document.getElementById('n124929531728') !== null)
    {
      document.getElementById('n124929531728').href = 'http://jmp.ilsemedia.nl/?a=r&s=startpagina&p=www&l=' + escape(document.getElementById('n124929531728').href);
    }
}	
