
var smulweb_ads_url = location.href.substr(0, (location.href.lastIndexOf("/")+1));
var request_uri = location.href.substr((location.href.lastIndexOf("?")+1));
var zoek_query_banner = "";

if(request_uri.indexOf("query=")!=-1){
	request_uri_query = request_uri.substr((request_uri.lastIndexOf("query=")+6));
	
	if(request_uri_query.indexOf("&")!=-1){
		zoek_query_banner = request_uri_query.substr(0, request_uri_query.indexOf("&"));
		zoek_query_banner = escape(zoek_query_banner);
	}else{
		zoek_query_banner = escape(request_uri_query);
	}
}

if(request_uri.indexOf("keuken_id=")!=-1 && zoek_query_banner==""){
	request_uri_keuken = request_uri.substr((request_uri.lastIndexOf("keuken_id=")+10));
	zoek_query_banner = request_uri_keuken.substr(0, request_uri_keuken.indexOf("&"));
	
	if(escape(zoek_query_banner)=="D"){
		zoek_query_banner = "barbecue";
	}else{
		zoek_query_banner = "";
	}
}

if(request_uri.indexOf("bereidingstechniek_id=")!=-1 && zoek_query_banner==""){
	request_uri_techniek = request_uri.substr((request_uri.lastIndexOf("bereidingstechniek_id=")+22));
	zoek_query_banner = request_uri_techniek.substr(0, request_uri_techniek.indexOf("&"));
	
	if(escape(zoek_query_banner)=="BQ"){
		zoek_query_banner = "barbecue";
	}else{
		zoek_query_banner = "";
	}
}

if(request_uri.indexOf("moment_id=")!=-1 && zoek_query_banner==""){
	request_uri_moment = request_uri.substr((request_uri.lastIndexOf("moment_id=")+10));
	zoek_query_banner = request_uri_moment.substr(0, request_uri_moment.indexOf("&"));
	
	if(escape(zoek_query_banner)=="Q"){
		zoek_query_banner = "barbecue";
	}else{
		zoek_query_banner = "";
	}
}

if (typeof(et_ord)=='undefined')
et_ord=Math.floor(Math.random()*10000000000000000);
if (typeof(et_tile)=='undefined') et_tile=1;

var re = new RegExp("http://(.*).smulweb.nl/");

if(smulweb_ads_url.indexOf("test.smulweb.tv")!=-1 || smulweb_ads_url.indexOf("www.smulweb.tv")!=-1){
	var smulweb_ads_zone = "smulweb_tv";
}else if(smulweb_ads_url=="http://www.smulweb.nl/" || smulweb_ads_url=="http://smulweb.nl/" || smulweb_ads_url=="http://test-v2.smulweb.nl/"){
	var smulweb_ads_zone = "homepage";
}else if(smulweb_ads_url.indexOf("community")!=-1 || (smulweb_ads_url.match(re) && smulweb_ads_url.indexOf("www.smulweb.nl")==-1 && smulweb_ads_url.indexOf("test-v2.smulweb.nl")==-1)){
	var smulweb_ads_zone = "community";
}else if(smulweb_ads_url.indexOf("restaurant")!=-1 || smulweb_ads_url.indexOf("recensie")!=-1 || location.href.indexOf("type=resto")!=-1){
	var smulweb_ads_zone = "restaurant";
}else if(smulweb_ads_url.indexOf("shop/winkelwagen")!=-1){
	var smulweb_ads_zone = "shop_ssl";
}else if(smulweb_ads_url.indexOf("shop")!=-1 || smulweb_ads_url.indexOf("shops")!=-1){
	var smulweb_ads_zone = "shop";
}else if(smulweb_ads_url.indexOf("recept")!=-1 || smulweb_ads_url.indexOf("recepten")!=-1 || location.href.indexOf("type=recept")!=-1 || location.href.indexOf("-recept-")!=-1){
	var smulweb_ads_zone = "recepten";
}else if(smulweb_ads_url.indexOf("kookstudio")!=-1){
	var smulweb_ads_zone = "kookstudios";
}else if(smulweb_ads_url.indexOf("culinair")!=-1 || smulweb_ads_url.indexOf("artikel")!=-1 || smulweb_ads_url.indexOf("webgroep")!=-1 || smulweb_ads_url.indexOf("special")!=-1 || smulweb_ads_url.indexOf("product")!=-1 || smulweb_ads_url.indexOf("winkel")!=-1 || smulweb_ads_url.indexOf("evenement")!=-1){
	var smulweb_ads_zone = "culinair";
}else{
	var smulweb_ads_zone = "ros";
}

var smulweb_ads_item_type = "";
var smulweb_ads_item_id = "";

if(smulweb_ads_url.indexOf("restaurant")!=-1){
	smulweb_ads_item_type = "restaurant";
}else if(smulweb_ads_url.indexOf("recept")!=-1 || smulweb_ads_url.indexOf("recepten")!=-1){
	smulweb_ads_item_type = "recept";
}else if(smulweb_ads_url.indexOf("artikel")!=-1){
	smulweb_ads_item_type = "artikel";
}else if(smulweb_ads_url.indexOf("special")!=-1){
	smulweb_ads_item_type = "artikel";
}else if(smulweb_ads_url.indexOf("recensie")!=-1){
	smulweb_ads_item_type = "recensie";
}else if(smulweb_ads_url.indexOf("video")!=-1){
	smulweb_ads_item_type = "video";
}else if(location.href.indexOf("nl/lg")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "163209";
}else if(location.href.indexOf("nl/conimex")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "175010";
}else if(location.href.indexOf("nl/calve")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "176058";
}else if(location.href.indexOf("nl/granditalia")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "176057";
}else if(location.href.indexOf("nl/pataks")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "176258";
}else if(location.href.indexOf("nl/kuhne")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	//smulweb_ads_item_id = "176691";
	smulweb_ads_item_id = "178950";
}else if(location.href.indexOf("nl/valess")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "178657";
}else if(location.href.indexOf("nl/voedingscentrum")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "177650";
}else if(location.href.indexOf("nl/maldonsalt")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "177747";
}else if(location.href.indexOf("nl/aeg")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "178112";
}else if(location.href.indexOf("/boska_emmi")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "178917";
}else if(location.href.indexOf("nl/mosselen")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "178398";
}else if(location.href.indexOf("nl/knorrauthentiekevleesjus")!=-1){
	var smulweb_ads_zone = "culinair";
	smulweb_ads_item_type = "artikel";
	smulweb_ads_item_id = "179435";
}

if(smulweb_ads_item_type!="" && smulweb_ads_item_id==""){
	smulweb_type_url = smulweb_ads_url.replace("http://", "");
	
	if(smulweb_type_url.indexOf("/")!=-1 && smulweb_type_url.indexOf("/", smulweb_type_url.indexOf("/")+2)!=-1){
		/*positie_start = (smulweb_type_url.indexOf("/")+1);
		positie_eind = smulweb_type_url.indexOf("/", smulweb_type_url.indexOf("/")+2);
		smulweb_ads_item_id = smulweb_type_url.substr(positie_start, (positie_eind - positie_start));
		if(isNaN(smulweb_ads_item_id)){
			smulweb_ads_item_id = "";
		}*/
		
		smulweb_ads_item_id = "";
		
		var res = smulweb_type_url.match(/\/(\d+)\//);
		//alert(res.length);
		if(res != null){
			if(res[1] > 0){
				smulweb_ads_item_id = res[1];
			}
		}
		
	}
}


if(smulweb_ads_item_type=="" && smulweb_ads_item_id=="" && smulweb_ads_url.indexOf("/actie/")!=-1){
	smulweb_ads_item_type = "actie";
	smulweb_type_url = location.href.replace("http://", "");
	
	if(smulweb_type_url.lastIndexOf("/")!=-1){
		positie_start = (smulweb_type_url.lastIndexOf("/")+1);
		smulweb_ads_item_id = smulweb_type_url.substr(positie_start, (smulweb_type_url.length - positie_start));
	}
}

function dump(arr,level) {
	var dumped_text = "";
	if(!level) level = 0;
	
	//The padding given at the beginning of the line.
	var level_padding = "";
	for(var j=0;j<level+1;j++) level_padding += "    ";
	
	if(typeof(arr) == 'object') { //Array/Hashes/Objects 
		for(var item in arr) {
			var value = arr[item];
			
			if(typeof(value) == 'object') { //If it is an array,
				dumped_text += level_padding + "'" + item + "' ...\n";
				dumped_text += dump(value,level+1);
			} else {
				dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
			}
		}
	} else { //Stings/Chars/Numbers etc.
		dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
	}
	return dumped_text;
}

<!-- begin Site parameters -->
	sSite="smulweb.nl";
	sZone=smulweb_ads_zone;
	
	if(semilo_video_tags!=""){
		keyword=semilo_video_tags;
	}else if(semilo_keyword_targeting!=""){
		keyword=semilo_keyword_targeting;
	}else{
		keyword=zoek_query_banner;
	}
	
	var adParams = {
		"date":"",
		"age":"",
		"city":"",
		"pc":"",
		"gender":"",
		"artikel":(smulweb_ads_item_type=="artikel" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"recept":(smulweb_ads_item_type=="recept" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"recensie":(smulweb_ads_item_type=="recensie" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"restaurant":(smulweb_ads_item_type=="restaurant" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"special":(smulweb_ads_item_type=="special" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"video":(smulweb_ads_item_type=="video" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"actie":(smulweb_ads_item_type=="actie" && smulweb_ads_item_id!="" ? smulweb_ads_item_id : ""),
		"keuken":(semilo_keuken_keyword!="" ? semilo_keuken_keyword : ""),
		"gang":(semilo_gang_keyword!="" ? semilo_gang_keyword : ""),
		"bereidingstijd":(semilo_bereidingstijd_keyword!="" ? semilo_bereidingstijd_keyword : ""),
		"bereiding":(semilo_bereidingstechniek_keyword!="" ? semilo_bereidingstechniek_keyword : "")
	};
<!-- begin Site parameters -->

function showContentFullbanner(){
	//document.write('<scr'+'ipt language="JavaScript" src="'+(("https:" == document.location.protocol) ? "https://ad." : "http://ad.nl.")+'doubleclick.net/adj/smulweb.dqa.nl/' + smulweb_ads_zone + ';leeftijd=;sekse=;woonplaats=;postcode=;zoek='+zoek_query_banner+';dcopt=ist;sz=468x60;tile=' + (et_tile++) + ';ord=' + et_ord + '?" type="text/javascript"></scr' + 'ipt>');
	<!--// <![CDATA[
	try{
		placebanner('468x60,468x80,728x90');
	}catch(err){}
	// ]]> -->
}

function showContentRectangle(){
	//document.write('<scr'+'ipt language="JavaScript" src="'+(("https:" == document.location.protocol) ? "https://ad." : "http://ad.nl.")+'doubleclick.net/adj/smulweb.dqa.nl/' + smulweb_ads_zone + ';leeftijd=;sekse=;woonplaats=;postcode=;zoek='+zoek_query_banner+';sz=336x280;tile=' + (et_tile++) + ';ord=' + et_ord + '?" type="text/javascript"></scr' + 'ipt>');
	<!--// <![CDATA[
	try{
		placebanner('336x280,300x250');
	}catch(err){}
	// ]]> -->
} 

function showContentHalveSkyscraper(){
	//document.write('<scr'+'ipt language="JavaScript" src="'+(("https:" == document.location.protocol) ? "https://ad." : "http://ad.nl.")+'doubleclick.net/adj/smulweb.dqa.nl/' + smulweb_ads_zone + ';leeftijd=;sekse=;woonplaats=;postcode=;zoek='+zoek_query_banner+';sz=120x300;tile=' + (et_tile++) + ';ord=' + et_ord + '?" type="text/javascript"></scr' + 'ipt>');
	<!--// <![CDATA[
	try{
		placebanner('120x300');
	}catch(err){}
	// ]]> -->
}

function showContentSkyscraper(){
	//document.write('<scr'+'ipt language="JavaScript" src="'+(("https:" == document.location.protocol) ? "https://ad." : "http://ad.nl.")+'doubleclick.net/adj/smulweb.dqa.nl/' + smulweb_ads_zone + ';leeftijd=;sekse=;woonplaats=;postcode=;zoek='+zoek_query_banner+';sz=120x600;tile=' + (et_tile++) + ';ord=' + et_ord + '?" type="text/javascript"></scr' + 'ipt>');
	<!--// <![CDATA[
	try{
		placebanner('120x600');
	}catch(err){}
	// ]]> -->
}
