var kalooga,kalooga_wf,kalooga_settings_default,kalooga_settings;if(typeof kalooga=="undefined"){kalooga=new (function(){this.widgets=[];this.initialized=true;this.isIE=(navigator.appVersion.indexOf("MSIE")>=0||navigator.appName.indexOf("Opera")>=0);this.isFF=(navigator.userAgent.indexOf("Firefox")>=0);this.merge=function(c,b){if(c==null||typeof(c)!="object"){return merge({},b)}if(b==null||typeof(b)!="object"){return merge({},obj1)}for(var a in b){if(!c[a]){c[a]=b[a]}}return c};this.getCookie=function(b){var g=document.cookie.split(";"),c="",e="",f="",a,d=false;for(a=0;a<g.length;a++){c=g[a].split("=");e=c[0].replace(/^\s+|\s+$/g,"");if(e==b){d=true;if(c.length>1){f=unescape(c[1].replace(/^\s+|\s+$/g,""))}return f;break}c=null;e=""}if(!d){return null}};this.cookie=function(b,a){if(this.getCookie(b)){return this.getCookie(b)}else{var d=new Date(),c=this.uid();d.setDate(d.getDate()+a);document.cookie=b+"="+escape(c)+((a==null)?"":";expires="+d.toGMTString());return c}};this.isElementInViewportId=function(a){if(a==null||a=="null"){return false}return this.isElementInViewport(document.getElementById(a))};this.isElementIdInViewport=this.isElementInViewportId;this.isElementInViewport=function(c){if(c==null){return false}var g=c.offsetTop,d=c.offsetLeft,a=c.offsetWidth,i=c.offsetHeight,b=0,e=0,h=0,f=0;while(c.offsetParent){c=c.offsetParent;g+=c.offsetTop;d+=c.offsetLeft}if(typeof(window.innerWidth)=="number"){b=window.pageYOffset;e=window.pageXOffset;h=window.innerWidth;f=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.scrollTop;e=document.documentElement.scrollLeft;h=document.documentElement.clientWidth;f=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.scrollTop;e=document.body.scrollLeft;h=document.body.clientWidth;f=document.body.clientHeight}}}return(g<(b+f)&&d<(e+h)&&(g+i)>b&&(d+a)>e)};this.addEventImage=function(d,b){var a=document.createElement("img"),c=this.getEventUrl(d,b);a.style.width="0px";a.style.height="0px";a.style.border="0px";a.style.position="absolute";a.src=c;d.div.appendChild(a)};this.sendFlashEvent=function(b){if(b){var a=this.getFlash(b);if(a&&typeof a.movieInViewport=="function"){a.movieInViewport("nothing")}else{setTimeout("kalooga.sendFlashEvent('"+b+"')",1000)}}};this.sendEventIfVisible=function(b){var a=this.widgets[b];if(a&&a.visible){return true}if(this.isElementInViewport(a.div)){if(a.visible){return true}a.visible=true;this.addEventImage(a,"impression");if(a.adId){this.sendFlashEvent(a.flashId)}}return true};this.done=function(c){if(this.isIE){return}var a=this.widgets[c],b;if(a&&a.div){b=document.createElement("img");b.setAttribute("src","http://publishing.kalooga.com/media/1x1.gif");b.setAttribute("style","display: none;");a.div.appendChild(b)}};this.addJs=function(b){var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("src",b);document.getElementsByTagName("head")[0].appendChild(a)};this.resources={"nl-Read more":"Lees meer","nl-Source":"Bron","nl-Discover more galleries with Kalooga":"Ontdek meer galleries met Kalooga","nl-Related search results":"Gerelateerde zoekresultaten","nl-Search results":"Zoekresultaten","nl-Go to":"Ga naar","de-Read more":"Mehr","de-Source":"Quelle","de-Discover more galleries with Kalooga":"Entdecken Sie mehr Galerien mit Kalooga","de-Related search results":"Verwandte Suchergebnisse","de-Search results":"Suchergebnisse","de-Go to":"Gehe zu"};this.i18nL=function(f,c,a){var e,b,d=this.resources[f+"-"+c]||this.resources[c]||c;if(!(d)){return"---"+c+"---"}if(a&&a.length){e=d.split("{}");d=e[0];for(b=1;b<e.length;b++){if(a[b-1]){d+=a[b-1]}d+=e[b]}}return d};this.i18n=function(b,a){return this.i18nL(this.language,b,a)};this.printWidget=function(b){var a;if(b==null||!b.id){return}b.visible=false;this.widgets[b.id]=b;kalooga_wf=true;this.print(b);if(kalooga_settings.preview){return}a=function(c){kalooga.sendEventIfVisible(b.id)};a();if(navigator.appName=="Microsoft Internet Explorer"){window.attachEvent("onscroll",a);window.attachEvent("onload",a)}else{window.addEventListener("scroll",a,false);window.addEventListener("load",a,false)}};this.getEventUrl=function(c,b){var a="";if(typeof c.adId!="undefined"){a="&adId="+c.adId+"&advertiserId="+c.advertiserId+"&campaignId="+c.campaignId+"&iab="+c.iab}return"http://events.kalooga.com/event?eventtype="+b+"&pid="+c.publisherId+"&wid="+c.widgetId+"&type="+c.type+"&query="+encodeURIComponent(c.queryTerm)+"&preselections="+c.preselections+"&location="+encodeURIComponent(window.location)+"&pcid="+this.pcid+"&sid="+this.sid+"&xpos="+c.div.offsetLeft+"&ypos="+c.div.offsetTop+a+"&random="+(new Date().getTime())+"&target="};this.addCss=function(c){var b,e,a,d=document.getElementsByTagName("link");for(b=d.length;b>=0;b--){if(d[b]&&d[b].getAttribute("href")!=null&&d[b].getAttribute("href").indexOf(c)!=-1){return}}e=document.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("href",c);a=document.getElementsByTagName("head")[0];if(a){a.insertBefore(e,a.firstChild)}};this.writeDiv=function(c,a,b){var d=document.getElementById(c.id);if(!d){document.write('<div id="'+c.id+'"'+(b?(' style="'+b+'"'):"")+">"+(a?a:"")+"</div>");d=document.getElementById(c.id)}else{if(a){d.innerHTML=a}}c.div=d};this.getConfiguration=function(a){if(this.widgets[a]&&typeof(this.widgets[a].configuration)=="function"){return(this.widgets[a].configuration)()}};this.print=function(h){var j="",o="",l,m,e,a,k,p,g,d,b,c,n,f;kalooga_settings.alterWidget(h);switch(h.type){case"gallery":this.writeDiv(h);m=h.additionalEncryptedQuery?("&qh="+h.additionalEncryptedQuery):"";m+=h.displayQuery?("&qd="+h.displayQuery):"";n=h.searchLink;if(n.indexOf("http")!=0){f=(n.charAt(0)=="/")?location.href.indexOf("/",8):(location.href.lastIndexOf("/")+1);if(f>0){n=location.href.substring(0,f)+n}}k=this.getEventUrl(h,"click")+encodeURIComponent(n+m);l=this.getEventUrl(h,"click")+encodeURIComponent(h.showLink);j+='<div class="gallery"><div><a href="'+l+'" target="'+h.clickTarget+'" style="color: '+h.text_color+'">'+h.title+'</a></div><div><table bgcolor="'+h.background_color+'" cellspacing="'+h.margin+'"><tr>';for(e=0;e<h.thumbs.length;e++){a=h.thumbs[e];j+='<td bgcolor="'+h.image_background_color+'" width="'+h.thumb_width+'" height="'+h.thumb_height+'" align="center" valign="middle"><div style="overflow:hidden; width:'+h.thumb_width+'px;"><a href="'+l+'" target="'+h.clickTarget+'"><img src="'+a.url+'" height="'+h.thumb_height+'" border="0" /></a></div></td>'}j+='</tr></table></div></div><div class="query"><a href="'+k+'" target="'+h.clickTarget+'" style="color: '+h.text_color+'">Meer galleries over "'+h.decodedQueryTerm+'"</a></div>';h.div.innerHTML=j;break;case"searchbox":this.writeDiv(h);j+='<div class="searchBox"><form name="_'+h.widgetId+'" action="'+h.searchUrl+'" method="get" accept-charset="utf-8" target="'+h.clickTarget+'"><input type="text" name="query" class="queryField" style="background-color:'+h.background_color+";color:"+h.text_color+';" /><input type="hidden" name="partnerid" value="'+h.publisherId+'" /><input type="hidden" name="widgetid" value="'+h.widgetId+'" /><input type="submit" value="'+h.submit_text+'" style="color:'+h.text_color+';" /><input type="hidden" name="lang1" value="'+h.language+'" /><input type="hidden" name="start" value="true" /></form></div>';h.div.innerHTML=j;break;case"kameleon":this.writeKameleon(h);break;case"caroussel":case"photostring":case"icatcher":h.flashId="gallery_"+h.id;this.writeDiv(h,false,"text-align:left;position:relative;width:"+h.width+"px;height:"+h.height+"px;");b="flexWidget_v1.19.swf";c="scriptFunction=kalooga.getConfiguration&id="+h.id;j+="<object "+(h.html_code?'style="position:absolute"':"")+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+h.flashId+'" width="'+h.width+'" height="'+h.height+'" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,0,0"> <param name="movie" value="http://publishing.kalooga.com/'+b+'" /> <param name="quality" value="high" />'+(h.background_color==""?' <param name="wmode" value="transparent" />':(' <param name="bgcolor" value="'+h.background_color+'" /><param name="wmode" value="Opaque"/>'))+' <param name="allowScriptAccess" value="always" /> <param name="flashvars" value="'+c+'" /> <embed id="kalooga_embed_'+h.id+'" src="http://publishing.kalooga.com/'+b+'" quality="high" '+(h.background_color==""?'wmode="transparent" ':('bgcolor="'+h.background_color+'" wmode="Opaque" '))+' width="'+h.width+'" height="'+h.height+'" name="'+h.flashId+'" align="middle" play="true" loop="false"  allowScriptAccess="always" flashvars="'+c+'" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed></object>';if(h.html_code&&!kalooga_settings.preview){p="iframe_"+h.id+"0";g="KaloogaBannerfold"+h.id;d=g+"o";o+='<div id="'+h.id+'0" style="border: 0px; overflow: hidden; position: absolute; display: none;">';o+='<iframe id="'+p+'" width="'+h.width+'" height="'+h.height+'" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="position: absolute; display: block;"></iframe>';o+='<div id="'+g+'" class="KaloogaBannerfold" onmouseover="kalooga.show(\''+d+"');\"></div>";o+='<div id="'+d+'" class="KaloogaBannerorange" onclick="kalooga.removeFlash(\''+h.flashId+"');\">";o+='<table width="100%" height="100%"><tbody><tr><td class="KaloogaBannerorangeText" width="100%" height="100%">BACK TO<br>SEARCH RESULTS</td></tr></tbody></table>';o+="</div></div>";this.addCss("http://publishing.kalooga.com/css/bannerPool.css")}h.div.innerHTML=j+o;if(o!=""){this.printAd(p,h.html_code)}break;default:document.write('<div id="'+h.id+'"><!-- Unknown widgettype '+h.type+'-->"</div>')}if(!kalooga_settings.preview){this.addEventImage(h,"request")}};this.printAd=function(c,a){var b=document.getElementById(c);if(typeof b=="undefined"){return}b=(b.contentWindow)?b.contentWindow:(b.contentDocument&&b.contentDocument.document)?b.contentDocument.document:(b.contentDocument?b.contentDocument:null);if(!(b&&b.document)){return}b.document.open();b.document.write("<html><head></head><body>"+(kalooga.isFF?'<script type="text/javascript">var iframe_buffer=""; document.o_writeln = document.writeln; document.writeln=function(line) { if ( line.match("^<IFRAME") && ! line.match("</IFRAME>") ) { iframe_buffer=line+" "; } else { document.o_writeln(iframe_buffer+line); iframe_buffer="";};};<\/script>':"")+a+'<script type="text/javascript">setTimeout(function(){ document.close();}, 0);<\/script></body></html>')};this.uid=function(){var d=new Date(1582,10,15,0,0,0,0),g=new Date(),j=g.getTime()-d.getTime(),b="-",k=this.getIntegerBits(j,0,31),i=this.getIntegerBits(j,32,47),f=this.getIntegerBits(j,48,59)+"1",c=this.getIntegerBits(this.rand(4095),0,7),e=this.getIntegerBits(this.rand(4095),0,7),a=this.getIntegerBits(this.rand(8191),0,7)+this.getIntegerBits(this.rand(8191),8,15)+this.getIntegerBits(this.rand(8191),0,7)+this.getIntegerBits(this.rand(8191),8,15)+this.getIntegerBits(this.rand(8191),0,15);return k+b+i+b+f+b+c+e+b+a};this.getIntegerBits=function(f,g,b){var a=(f).toString(16).toUpperCase(),d=new Array(),e="",c;for(c=0;c<a.length;c++){d.push(a.substring(c,c+1))}for(c=Math.floor(g/4);c<=Math.floor(b/4);c++){if(!d[c]||d[c]==""){e+="0"}else{e+=d[c]}}return e};this.rand=function(a){return Math.floor(Math.random()*(a+1))};this.pcid=this.cookie("pcid","10");this.sid=this.cookie("sid");this.getFlash=function(a){if(navigator.appName.indexOf("Microsoft")!=-1){return window[a]}else{return document[a]}};this.removeFlash=function(a){this.getFlash(a).removeBannerEXT("1")};this.hide=function(a){if(a&&document.getElementById(a)){document.getElementById(a).style.visibility="hidden"}};this.show=function(a){if(a&&document.getElementById(a)){document.getElementById(a).style.visibility="visible";setTimeout("kalooga.hide('"+a+"')",2000)}};this.addCss=function(c){var b,e,a,d=document.getElementsByTagName("link");for(b=d.length;b>=0;b--){if(d[b]&&d[b].getAttribute("href")!=null&&d[b].getAttribute("href").indexOf(c)!=-1){return}}e=document.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("href",c);a=document.getElementsByTagName("head")[0];if(a){a.insertBefore(e,a.firstChild)}};this.getNewDivId=function(c){var b="kalooga_"+c,a=1;if(b&&document.getElementById(b)==null){do{b="kalooga_"+c+"_"+a++}while(document.getElementById(b)!=null)}return b};this.xmlEncode=function(a){return a.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\'/g,"&apos;").replace(/\"/g,"&quot;")};this.xmlDecode=function(a){return a.replace(/\&amp;/g,"&").replace(/\&lt;/g,"<").replace(/\&gt;/g,">").replace(/\&apos;/g,"'").replace(/\&quot;/g,'"')}})();kalooga_settings_default={alterSearchParameters:function(a){},alterSearchResults:function(a){},afterSearch:function(a){},preview:typeof kalooga_preview=="boolean"?kalooga_preview:typeof kalooga_preview!="undefined",alterClickUrl:function(a){return a},alterSearchUrl:function(a){return(typeof kalooga_searchUrl=="undefined")?a:kalooga_searchUrl},alterConfiguration:function(a){if(kalooga_settings.preview){return a.replace(/<advertisement>.*?<\/advertisement>/g,"")}return a},alterWidget:function(a){}};kalooga_settings=(typeof kalooga_settings=="undefined")?kalooga_settings_default:kalooga.merge(kalooga_settings,kalooga_settings_default)};
(function() {
	var k_id = kalooga.getNewDivId('4103');
	kalooga.printWidget({
		id: k_id,
		type: "icatcher",
		variation: "",
		widgetId: "4103",
		publisherId: "529",
		background_color: "#ffffff",
		width : 695,
		height : 117,
		queryTerm : "Turkije",
	    additionalEncryptedQuery: "",
		preselections : "",
			configuration : function() {
			var language = "en";
			var serviceResponse = '<searchResults><numberOfResultPages>19071<\/numberOfResultPages><currentPage>0<\/currentPage><start>1<\/start><end>2<\/end><total>38142<\/total><searchTime>32<\/searchTime><gallery><title>Turkije 2007 by Klaaspbommel - PicturePush<\/title><url>http:\/\/klaaspbommel.picturepush.com\/album\/8798\/p-Turkije-2007.html<\/url><domain>picturepush.com<\/domain><adult>false<\/adult><urlHash>55c264d9cebe909bed87b673e7307e5b352ff6b6<\/urlHash><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=55c264d9cebe909bed87b673e7307e5b352ff6b6zcf250ed3a5aa0ca2457ed6cdf15368ff7354c8c1&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=55c264d9cebe909bed87b673e7307e5b352ff6b6z2151152f62ba4bd10ed1a75865c4cc2aa6740342&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=55c264d9cebe909bed87b673e7307e5b352ff6b6zd3e7d00a3d9c2e74d19b349e67bedfe0fe0c938f&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=55c264d9cebe909bed87b673e7307e5b352ff6b6zdb84a715584f8495d1a52cbdda8faf494a8c3343&amp;tt=L<\/url><\/thumbnail><\/gallery><gallery><title>Foto\'s van Turkije: Istanbul, Ankara, Cappadoci\u00EB, Pamukkale, Efeze, Bergama --- Wereldreiziger.net<\/title><url>http:\/\/wereldreiziger.net\/foto\/turkije\/turkije22.html<\/url><domain>wereldreiziger.net<\/domain><adult>false<\/adult><urlHash>8c71db83918ad3a98978e1b62af63afd3b7779f2<\/urlHash><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=8c71db83918ad3a98978e1b62af63afd3b7779f2za4cd60e5180123e6d8b0253e532a7e2dadd35e54&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=8c71db83918ad3a98978e1b62af63afd3b7779f2z34937df4779dcd52d2a2d07892a24a0c9530f86c&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=8c71db83918ad3a98978e1b62af63afd3b7779f2z64ca7f724a56bf54fb169defb7a9444b9ac5d043&amp;tt=L<\/url><\/thumbnail><thumbnail><url>http:\/\/img.kalooga.com\/thumbimage?id=8c71db83918ad3a98978e1b62af63afd3b7779f2z4edcd0dbf00c9142d7494e8fbe9438aed8b36c2a&amp;tt=L<\/url><\/thumbnail><\/gallery><\/searchResults>'.replace(/<clickUrl>([^<]*)<\/clickUrl>/g, 
				function () { return "<clickUrl>" + kalooga.xmlEncode(kalooga.getEventUrl(kalooga.widgets[k_id], 'click') + 
							  encodeURIComponent(kalooga_settings.alterClickUrl(kalooga.xmlDecode(arguments[1])))) + "</clickUrl>"; } );
		    var searchUrl = kalooga_settings.alterSearchUrl("http://www.kalooga.co.uk/search.html");
		    if ( searchUrl.indexOf("http")!=0 ) {
		    	var index = (searchUrl.charAt(0) == '/')  ? location.href.indexOf('/', 8) : (location.href.lastIndexOf('/')+1);
		    	if ( index > 0 ) searchUrl = location.href.substring(0,index) + searchUrl;
		    }
		    var addQueryUrl = ""
		    		    ;
			var result = '<gallery><settings>'
					+'<thumbCountHor>8</thumbCountHor>'
					+'<thumbCountVert>1</thumbCountVert>'
					+'<width>695</width>'
					+'<height>117</height>'			
					+'<horizontalMargin>5</horizontalMargin>'
					+'<verticalMargin>5</verticalMargin>'
					+'<clickUrl>' + kalooga.xmlEncode(kalooga.getEventUrl(kalooga.widgets[k_id], 'click') + encodeURIComponent(searchUrl + '?query=Turkije&partnerid=529&filter=default&cat=travel' + addQueryUrl)) + '</clickUrl>'
					+'<backgroundColor>#ffffff</backgroundColor>'
					+'<textColor>#388dca</textColor>'
									+'<infoTextField>true</infoTextField>'
					+'<type>icatcher</type>'
									+'<target>_blank</target>'	
																													+'<kaloogaURL>http://www.kalooga.co.uk/</kaloogaURL>'
					+'<text>'
						+'<readMore>' + kalooga.i18nL(language, 'Read more') + '</readMore>'
						+'<source>' + kalooga.i18nL(language, 'Source') + '</source>'
						+'<kalooga>' + kalooga.i18nL(language, 'Discover more galleries with Kalooga') + '</kalooga>'
						+'<relatedSearchResults>' + kalooga.i18nL(language,   'Related search results'  ) + '</relatedSearchResults>'
						+'<goTo>' + kalooga.i18nL(language, 'Go to') + '</goTo>'	
					+'</text>'	
				+'</settings>'
				+'<serviceResponse>' + serviceResponse + '</serviceResponse>'
				+'</gallery>';

			return kalooga_settings.alterConfiguration(result);
		}
	});
})();
