window.adscaleversion="1.0.0";var adscaletime=new Date();window.adscaleihhref=window.adscaleihhref?window.adscaleihhref:"http://ih.adscale.de/adscale-ih/impr?sid={sid}&v="+window.adscaleversion+"&rand="+adscaletime.getTime();window.adscalestatshref=window.adscalestatshref?window.adscalestatshref:"http://ch.adscale.de/adscale-ch/stats";window.adscaleadverts=new Array();var adscaleindex=0;var adservertag={};var renderingOnPage=false;var renderOnPageAds=new Array();var rendering;var backFillVars={writeWait:false,buffer:"",writeFunc:function(b){backFillVars.writeWait=true;backFillVars.buffer=backFillVars.buffer+b;if(b&&(b.indexOf("google_temp_span")>0||b.indexOf("google_ads_frame")>0)){writeOutBackfill()}},writelnFunc:function(b){backFillVars.writeWait=true;backFillVars.buffer=backFillVars.buffer+b+"\n";if(b&&(b.indexOf("google_temp_span")>0||b.indexOf("google_ads_frame")>0)){writeOutBackfill()}},scripts:[],currentScript:null};findAdscaleAdverts();function findAdscaleAdverts(){pattern=/adscale:(.+)/;elements=(document.body||document.documentElement).getElementsByTagName("div");var c=window.adscaleadverts;for(var d=0;d<elements.length;d++){if(elements[d].id.match(pattern)){c.push(elements[d])}}singleRequest(c)}function isDuplicate(f,e){for(var d=0;d<f.length;d++){if(f[d].id==e.id){return true}}return false}function getUniqueSlots(f){var d=new Array();for(var e=0;e<f.length;e++){if(!isDuplicate(d,f[e])){d.push(f[e])}}return d}function singleRequest(g){sid="";var h=getUniqueSlots(g);for(var f=0;f<h.length;f++){sid+=sid.length>0?",":"";sid+=formatId(getSlotId(h[f].id))}iframe=createIframe("adscaleSingleRequest",0,0);document.body.appendChild(iframe);iframeDoc=iframe.contentWindow.document||iframe.contentDocument;var e='<html><head><script>document.adscalejsenabled = true;function load() {return parent.singleResponse(document);}<\/script><style type="text/css">body {margin:0;padding:0;border:0;overflow:hidden;}</style></head><body onload=\'load()\'><script type="text/javascript" src="'+window.adscaleihhref.replace(/{sid}/,sid)+'" ><\/script></body></html>';iframeDoc.open();iframeDoc.write(e);iframeDoc.close()}function singleResponse(i){adverts=window.adscaleadverts;if(i.adscaleadvert){while(adverts.length>0){element=adverts.shift();var h=getSlotId(element.id);var j=i.adscaleadvert.backfill[h];var f=i.adscaleadvert.adservertag[h];var g=i.adscaleadvert.text[h]||i.adscaleadvert.banner[h];if(f){renderHtmlAdvert(element,h,f)}else{if(g){renderJavascriptAdvert(element,h,g)}else{if(j){renderHtmlAdvert(element,h,j)}}}}}}function createIframe(g,h,f){var e=document.createElement("iframe");e.id=g;e.width=h;e.height=f;e.frameBorder=0;e.style.overflow="hidden";e.style.display="none";e.marginWidth=0;e.marginHeight=0;e.allowTransparency=true;e.scrolling="no";return e}function renderJavascriptAdvert(n,j,h){var k=n.id+":ad";var i=formatId(j);var m=createIframe(k,n.style.width,n.style.height);m.style.display="";n.appendChild(m);iframeDoc=m.contentWindow.document||m.contentDocument;var l='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><style type="text/css">body {margin:0;padding:0;border:0;overflow:hidden;}</style></head><body><script type="text/javascript" id="adscale'+j+'">code='+h.code+";code();<\/script></body></html>";iframeDoc.open();iframeDoc.write(l);iframeDoc.close()}function renderBackfill(i,h){code="<div style='display:none'>ignore me</div>"+h.code;i.innerHTML=code;var g=i.getElementsByTagName("script");var f=[];for(var j=0;j<g.length;j++){f[j]=g[j]}if(document.write!=backFillVars.writeFunc){document.write=backFillVars.writeFunc}if(document.writeln!=backFillVars.writelnFunc){document.writeln=backFillVars.writelnFunc}backFillVars.scripts=f;processBackfillScripts()}function processBackfillScripts(){if(backFillVars.scripts.length==0){renderingOnPage=false;return}var f=backFillVars.scripts.shift();var h=document.createElement("script");backFillVars.currentScript=h;h.type="text/javascript";try{f.parentNode.replaceChild(h,f)}catch(g){}backFillVars.writeWait=false;if(f.src){h.src=f.src}else{var e=f.text+"\nwriteOutBackfill();";h.text=e}if(h.addEventListener){h.addEventListener("load",function(){waitForDocumentWrite(1500)},false)}else{h.onreadystatechange=function(){if(this.readyState=="loaded"){waitForDocumentWrite(1500)}}}}function waitForDocumentWrite(d){var c=100;if(d<=0){writeOutBackfill()}else{if(!backFillVars.writeWait){setTimeout(function(){waitForDocumentWrite(d-c)},c)}else{waitForDocumentWriteToFinish()}}}function waitForDocumentWriteToFinish(){if(backFillVars.writeWait){backFillVars.writeWait=false;setTimeout(function(){waitForDocumentWriteToFinish()},100);return}else{writeOutBackfill()}}function writeOutBackfill(){var m=backFillVars.currentScript;if(backFillVars.buffer!=""){var n=[];var h=document.createElement("div");var k="<div style='display:none'>ignore me</div>"+backFillVars.buffer;h.innerHTML=k;backFillVars.buffer="";for(var j=1;j<h.childNodes.length;j++){var i=h.childNodes[j];if(i.tagName){if(i.tagName.toUpperCase()=="SCRIPT"){fakeScript=document.createElement("div");
fakeScript.style.display="none";fakeScript.src=i.src;fakeScript.text=i.text;var l=m.parentNode.insertBefore(fakeScript,m);n.push(fakeScript)}else{var l=m.parentNode.insertBefore(h.childNodes[j],m);addScriptChild(l,n)}}}backFillVars.scripts=n.concat(backFillVars.scripts)}setTimeout("processBackfillScripts();",10)}function addScriptChild(h,e){for(var g=0;g<h.childNodes.length;g++){var f=h.childNodes[g];if(f.nodeName=="SCRIPT"){e.push(f)}else{addScriptChild(f,e)}}}function getTag(b){return adservertag[b]}function setTag(c,d){adservertag[c]=d}function renderHtmlAdvert(n,j,h){var k=n.id+":ad:"+adscaleindex++;var m=createIframe(k,n.style.width,n.style.height);m.style.display="";var l=h.code;var i=l.match(/http:\/\/.+\.googlesyndication.com/);if(i){sequentialRenderOnPage(n,h)}else{setTimeout(function(){renderInIFrame(n,m,h)},1)}}function renderInIFrame(h,g,f){g.onmouseover=function(){iframeClearFlags(g);g.mouseover_flag=true};g.onfocus=function(){if(g.mouseover_flag==true){g.focus_flag=true}};g.onmouseout=function(){if(g.focus_flag==true){g.mouseout_flag=true;iframeClearFlags(g);iframeClick(g.id,f.clickurl)}return true};var e=f.clickurl?"onfocus=\"parent.iframeFocus('"+g.id+"')\" onload=\"parent.iframeLoaded('"+g.id+"')\"":"";iframeContent='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><style type="text/css">body {margin:0;padding:0;border:0;overflow:hidden;}</style></head><body '+e+">"+f.code+"</body></html>";setTag(g.id,iframeContent);if(isSafari()||isIE6()||isServingSysComFirefox(f.code)){h.appendChild(g);iframeDoc=g.contentWindow.document||g.contentDocument;iframeDoc.open();iframeDoc.write(iframeContent);setTimeout("closeIframe('"+g.id+"')",3000)}else{h.appendChild(g);g.src="javascript:parent.getTag('"+g.id+"');"}}function iframeClearFlags(b){b.mouseover_flag=false;b.focus_flag=false;b.mouseout_flag=false}function iframeFocus(b){iframe=document.getElementById(b);if(iframe.mouseover_flag==true){iframe.focus_flag=true}}function iframeClick(c,d){iframe=document.getElementById(c);iframeClearFlags(iframe);iframeSendClick(d,iframe)}function iframeLoaded(b){iframe=document.getElementById(b);iframe.load_time=new Date()}function iframeSendClick(y,t){if(y&&t.load_time){var x=new Image();var q=new Date();x.src=y+"&rand="+q.getTime()}if(y){var u=y.substr(y.indexOf("?"));var w=new Date().getTime()-adscaletime.getTime();var s;if(!t.load_time){s=""}else{s=t.load_time.getTime()-adscaletime.getTime()}var r;if(!t.click_count){t.click_count=1}else{t.click_count++}var z;var v=new RegExp("object","gi");try{var e="width=1,height=1,scrollbars=0,resizable=0,toolbar=0,location=1,menubar=0,status=0,directories=0,titlebar=0";z=window.open("","_blank",e);z.close()}catch(p){}if(!v.test(String(z))){popupsAllowed=false}else{popupsAllowed=true}var o=new Image();statsUrl=window.adscalestatshref+u+"&startTime="+q.getTime()+"&iframeLoadTime="+s+"&clickTime="+w+"&clickCount="+t.click_count+"&referrer="+escape(document.referrer)+"&location="+escape(document.location)+"&popupsAllowed="+popupsAllowed;o.src=statsUrl}}function isSafari(){return navigator.userAgent.indexOf("Safari")>0}function isIE6(){return navigator.userAgent.indexOf("MSIE 6.0")>0}function isServingSysComFirefox(b){return b.indexOf("serving-sys.com")!=-1&&navigator.userAgent.indexOf("Firefox")>0}function closeIframe(c){var d=document.getElementById(c);iframeDoc=d.contentWindow.document||d.contentDocument;iframeDoc.close()}function sequentialRenderOnPage(c,d){if(!renderingOnPage){renderingOnPage=true;renderBackfill(c,d)}else{setTimeout(function(){sequentialRenderOnPage(c,d)},10)}}function formatId(b){if((b.length%4)==0){return b}return b+"====".substr(0,4-(b.length%4))}function getSlotId(b){pattern=/adscale:(.+)/;return pattern.exec(b)[1]};

