function SIMAdHandler(_1,_2,_3,_4){
var _5=arguments.callee;
_5.VERSION="$Revision: 1.62 $Date: 2010/04/19 13:33:51 $";
this.__DOM_SAFE_ID="simadwriter-dom-safe";
this.__config=typeof (_4)=="object"?_4:{};
this.adType=this.adserver=_1&&typeof (_5.EXTENSIONS)=="object"&&typeof (_5.EXTENSIONS[_1])=="object"?_1:"DUMMY";
this.__start_time=new Date().getTime();
this.__adserver_call=_2;
this.__dimensions={};
this.__adtrace={};
this.__loading_starts={};
this.__display_ads_cleared=false;
if(!this.__log){
this.__log=[];
}
if(!this.__tmp_logs){
this.__tmp_logs={};
}
if(!this.__config.tld){
this.__config.tld="";
}
if(!this.__config.available_ad_ids){
this.__config.available_ad_ids=[];
}
if(!this.__config.available_video_ads){
this.__config.available_video_ads=[];
}
this.bannerAdRequests={};
this.videoAdRequests={};
if(!_5.__init_general){
_5.__init_general=1;
_5.prototype.__default_ad_iframe="./adtags.iframe.php";
_5.prototype.getAdtrace=function(_6){
var _7="";
if(arguments.length==0){
for(var _8 in this.__adtrace){
_7+=_8+" - "+this.__adtrace[_8]+"\n";
}
}else{
_7=this.__adtrace[_6]||"";
if(_7){
_7=_6+" - "+_7;
}
}
return _7;
};
_5.prototype.getAdDimensions=function(_9){
var _a=this.__dimensions[_9]||[0,0];
return [_a[0]||0,_a[1]||0];
};
_5.prototype.getOffsetDimensions=function(_b){
var _c=document.getElementById(this.getSelector("target",_b));
if(!_c){
return [];
}
return [_c.offsetWidth,_c.offsetHeight];
};
_5.prototype.getSelector=function(){
if(!arguments.length){
return "";
}
var s="";
for(var i=0;i<arguments.length;i++){
if(!arguments[i]){
continue;
}
if(s){
s+="_";
}
s+=arguments[i];
}
return s?(this.__getConfig("container_prefix")||"")+s:"";
};
_5.prototype.start=function(){
if(typeof (this.__start)=="function"){
this.__start();
}
};
_5.prototype.finish=function(_f){
var _10;
try{
_10=typeof (SIMAdLayoutHandler.adjust.finish)=="function"?true:false;
}
catch(e){
this.__logMsg("finish:\n"+this.__catchMe(e));
}
if(!_10){
return;
}
var f=function(){
SIMAdLayoutHandler.adjustLayoutFor("finish",_f);
};
this.__addOnloadEvent(f);
};
_5.prototype.finishAd=function(id,_13){
if(typeof (_13)!="object"){
_13={};
}
var pos=_13.pos||"";
var _15=id=="shoppingtipp"?id+pos:id;
var _16=_13.triggered_from_iframe?true:false;
var _17=this.__findMaster();
if(id=="shoppingtipps"){
if(_17||_16){
return;
}
try{
SIMAdDeliveryHandler.moveAd(_13.block_id);
}
catch(e){
this.__logMsg("finishAd for "+id+":\n"+this.__catchMe(e));
}
return;
}
if(_17){
this.setAdInfo(_15);
this.syncVars(window,parent,"after");
_17.finishAd(_15,{triggered_from_iframe:true});
var _18=window.onunload;
var _19=this;
window.onunload=function(){
if(typeof (_18)=="function"){
_18();
}
_19.__clearDominoIFrame();
};
}else{
try{
if(_16){
this.__finishIFrameAd(_15);
}else{
this.setAdInfo(_15);
}
var _1a=SIMAdDeliveryHandler.isDelivered(_15);
if(id=="shoppingtipp"){
if(!_16){
var _1b=_13.block_id;
var _1c=_13.last||0;
if(_1a){
SIMAdLayoutHandler.renderAd(id,{pos:pos,last:_1c});
}
SIMAdDeliveryHandler.controlAdContainer(_15,this.getSelector(_1b));
SIMAdLayoutHandler.adjustLayoutFor(id,{pos:pos,last:_1c});
}
}else{
if(_1a&&!_16){
SIMAdDeliveryHandler.moveAd(_15);
}
SIMAdDeliveryHandler.controlAdContainer(_15,this.getSelector(_15));
SIMAdLayoutHandler.adjustLayoutFor(_15);
}
}
catch(e){
this.__logMsg("finishAd for "+id+":\n"+this.__catchMe(e));
return;
}
}
var _1d="";
if(this.__loading_starts[_15]){
_1d=" [loading time: "+((new Date().getTime()-this.__loading_starts[_15])/1000)+" secs]";
}
this.__logMsg("finishAd for "+_15+_1d,{},2);
};
_5.prototype.isUpdateStart=function(){
return (this.__is_update_start||0);
};
_5.prototype.updateAds=function(_1e){
var _1f=this.__isDOMSafe();
if(_1f==0){
var _20=this;
setTimeout(function(){
_20.updateAds(_1e);
},50);
return;
}else{
if(_1f<0){
}
}
this.__logMsg("updateAds called with arguments:",_1e);
this.__initUpdateConfig(_1e);
if(this.adType=="DUMMY"){
this.__doCallback(0);
}else{
this.__startAdUpdate();
}
};
_5.prototype.handleEvent=function(_21){
if(!_21||typeof (_21)!="object"){
return;
}
var _22=_21.event;
if(!_22){
return;
}
var _23=this.__getUpdateConfig("content_type");
if(_22=="screen"){
var _24;
if(_23=="MCcontent"){
_24=1;
}else{
if(_23=="MCplayer"||_23=="CPplayer"){
var _25=_21.screen_mode||"normal";
_24=_25=="normal"?1:0;
}else{
return;
}
}
this.__logMsg("handleEvent called with arguments:",_21);
this.__setDisplayForAdIFrames(_24);
}
};
_5.prototype.loadNextIFrameAd=function(_26,_27){
if(!_26){
if(this.__getUpdateConfig("pausing")){
this.__logMsg("loadNextIFrameAd is pausing",{},3);
return;
}
var _28=this.__getUpdateConfig("pause_after");
if(typeof (_28)!="undefined"&&_28!=null){
if(_28===this.__getCurrentAdID()||_28===this.__getCurrentUpdateIndex()){
this.__setUpdateConfig("pausing",true);
this.__logMsg("loadNextIFrameAd: set pausing after "+this.__getCurrentAdID(),{},3);
return;
}
}
}
var _29=this.__getNextAdID(_26,_27);
if(!_29){
return;
}
var _2a=this.__getUpdateConfig("ad_iframe")||this.__getConfig("ad_iframe")||this.__default_ad_iframe;
if(!_2a){
return;
}
if(typeof (this.__update_config)!="object"){
this.updateAds();
return;
}
var _2b=(this.__getUpdateConfig("content_type")||"");
var url=_2a+"?ad_tld="+escape(this.getTLD())+"&path="+escape(this.__getUpdateConfig("path"))+"&ad_id="+escape(_29);
if(_2b){
url+="&content_type="+escape(_2b);
}
var _2d=this.__getUpdateConfig("available_ad_ids")||[];
if(_2d.length){
url+="&all_iframe_ads="+escape(_2d.join("-"));
}
if(_2b.match(/^(video|CPplayer|MCplayer)$/)){
var _2e=this.__getUpdateConfig("video_type");
var _2f=this.__getUpdateConfig("screen_mode");
if(_2e){
url+="&video_type="+escape(_2e);
}
if(_2f&&_2f!="normal"){
url+="&video_screen_mode="+escape(_2f);
}
if(this.__getUpdateConfig("ad_exclude_all")){
url+="&video_no_ad=1";
}
if(this.__getUpdateConfig("ad_exclude_sponsor")){
url+="&video_no_sponsor=1";
}
if(this.__getUpdateConfig("ad_exclude_midroll")){
url+="&video_no_midroll=1";
}
if(this.__getUpdateConfig("ad_exclude_overlays")){
url+="&video_no_overlay=1";
}
}
var _30=window.location.search;
if(_30){
var _31=_30.match(/(?:[ios]+_[a-z]+_[a-z]+|[df][a-z]+_ads_?[a-z]*|ad_[a-z]+)=[a-zA-Z0-9_-]*/g);
if(_31){
url+="&"+_31.join("&");
}
}
var ok=false;
try{
ok=this.__getIFrameHandler().loadIFrame(_29,url);
this.__logMsg("loadNextIFrameAd for "+_29+" session id: "+this.getSessionID()+(ok?" successful":" failed"));
if(!ok){
ok=this.loadNextIFrameAd(_26,true);
}
}
catch(e){
this.__logMsg("loadNextIFrameAd for "+_29+":\n"+this.__catchMe(e));
}
return ok?true:false;
};
_5.prototype.resumeUpdate=function(){
var _33=this.__getUpdateConfig("pausing");
this.__logMsg(_33?"resumeUpdate started":"resumeUpdate impossible");
if(!_33){
return;
}
this.__setUpdateConfig("pausing",false);
this.__setUpdateConfig("pause_after",null);
this.loadNextIFrameAd();
};
_5.prototype.resizeIFrame=function(_34){
var _35=this.getAdDimensions(_34);
var x=_35[0];
var y=_35[1];
if(x==1&&y==1){
x=y=0;
}
try{
this.__getIFrameHandler().resizeIFrame(_34,[x,y]);
this.__logMsg("resizeIFrame for "+_34+": "+[x,y].join("x"),{},3);
}
catch(e){
this.__logMsg("resizeIFrame for "+_34+":\n"+this.__catchMe(e));
return;
}
return true;
};
_5.prototype.clearAdContainer=function(_38){
this.clearLog("clear");
var _39=document.getElementById(this.getSelector(_38));
if(_39){
_39.style.display="none";
}
var _3a=document.getElementById(this.getSelector("target",_38));
if(!_3a){
return;
}
var _3b=_3a.childNodes;
if(!_3b){
return;
}
var _3c=this.getSelector("iframe",_38);
var t0=new Date().getTime();
for(var i=_3b.length-1;i>=0;i--){
var _3f=_3b[i];
var id=_3f.id||"";
if(id==_3c){
this.__clearIFrameAd(_38);
}else{
this.__freeNode(_3f,true);
}
}
var _41=this.showLog("clear");
if(_41){
_41="\n"+_41;
this.clearLog("clear");
}
this.__logMsg("clearAdContainer for "+_38+" on "+_3a.tagName+" "+_3a.id+" took "+(new Date().getTime()-t0)+" millisecs"+_41);
};
_5.prototype.clearAdContainers=function(){
if(this.__display_ads_cleared){
return;
}
var _42=this.__getConfig("available_ad_ids")||[];
for(var i=0;i<_42.length;i++){
var _44=_42[i];
this.clearAdContainer(_44);
}
this.__display_ads_cleared=true;
};
_5.prototype.syncVars=function(_45,to,_47){
if(typeof (_45)!="object"||typeof (to)!="object"){
return;
}
if(_45==to){
return;
}
if(typeof (this.__syncVars)=="function"){
this.__syncVars(_45,to,_47);
}
if(typeof (this.__sync_vars)!="object"){
return;
}
var _48=this.__sync_vars[_47]||[];
for(var i=0;i<_48.length;i++){
to[_48[i]]=_45[_48[i]];
}
};
_5.prototype.resetVars=function(){
if(typeof (this.__resetVars)=="function"){
this.__resetVars();
}
if(typeof (this.__sync_vars)!="object"){
return;
}
var _4a;
for(var key in this.__sync_vars){
var _4c=this.__sync_vars[key]||[];
for(var i=0;i<_4c.length;i++){
window[_4c[i]]=_4a;
}
}
};
_5.prototype.hasVideoAds=function(){
if(arguments.length){
this.__setConfig("videoad",arguments[0]);
}
return this.__getConfig("videoad");
};
_5.prototype.getTLD=function(){
return this.__getConfig("tld");
};
_5.prototype.getSessionID=function(){
return this.__session_id||"";
};
_5.prototype.doLog=function(_4e){
if(typeof (_4e)!="undefined"){
this.__setConfig("do_log",parseInt(_4e));
}
return this.__getConfig("do_log")||0;
};
_5.prototype.showLog=function(tmp){
var _50="";
if(tmp){
if(this.__tmp_logs&&this.__tmp_logs[tmp]){
_50=this.__tmp_logs[tmp].join("\n");
}
}else{
if(this.__log){
_50=this.__log.join("\n\n");
if(_50){
_50="ALL TIMES ARE GIVEN IN SECS AFTER INIT OF SIMAdWriter\n\n"+_50;
}
}
}
return _50;
};
_5.prototype.clearLog=function(tmp){
if(tmp){
if(this.__tmp_logs){
this.__tmp_logs[tmp]=[];
}
}else{
this.__log=[];
}
};
_5.prototype.__getProtocol=function(){
if(!this.__protocol){
if(typeof (this.__setProtocol)=="function"){
this.__setProtocol();
}else{
this.__protocol="http:";
}
}
return this.__protocol;
};
_5.prototype.__initInstance=function(){
try{
this.__extend();
}
catch(e){
this.__logMsg("__initInstance:\n"+this.__catchMe(e));
}
this.__setSessionID();
if(typeof (this.__setSpecialProperties)=="function"){
this.__setSpecialProperties();
}
if(typeof (this.__setSyncVars)=="function"){
this.__setSyncVars();
}
if(!document.getElementById(this.__DOM_SAFE_ID)){
document.write("<div id=\""+this.__DOM_SAFE_ID+"\" style=\"display:none\"></div>");
}
try{
var _52=top.location.search.match(/simadwriter_debug=([0-9]+)/);
if(_52){
this.doLog(_52[1]);
}
}
catch(e){
this.__logMsg("__initInstance:\n"+this.__catchMe(e));
}
if(this.adType!="DUMMY"){
this.__logMsg("new\nadType: "+this.adType,this.__config);
}
};
_5.prototype.__addOnloadEvent=function(f){
if(window.addEventListener){
window.addEventListener("load",f,false);
}else{
if(window.attachEvent){
window.attachEvent("onload",f);
}else{
f();
}
}
};
_5.prototype.__extend=function(){
if(!_5.EXTENSIONS){
return;
}
var _54=_5.EXTENSIONS[this.adType];
if(typeof (_54)!="object"){
return;
}
for(var key in _54){
this[key]=_54[key];
}
};
_5.prototype.__setSessionID=function(){
var _56=this.__findMaster();
var _57=String(Math.random()).substring(2,11);
this.__session_id=_56?(_56.getSessionID()||_57):_57;
return this.__session_id;
};
_5.prototype.__getAdserverCall=function(){
var _58=this.__adserver_call;
var _59=typeof (_58);
if(_59=="string"){
_58=window[_58];
}
if(typeof (_58)!="function"){
_58=function(){
return "";
};
}
return _58;
};
_5.prototype.__startAdUpdate=function(){
this.__setSessionID();
this.clearAdContainers();
this.__clearDebugPanel();
this.resetVars();
this.bannerAdRequests={};
this.videoAdRequests={};
this.__dimensions={};
this.__adtrace={};
this.__loading_starts={};
this.__display_ads_cleared=false;
this.loadNextIFrameAd(true);
};
_5.prototype.__findMaster=function(key){
if(window==parent){
return;
}
if(!this.__master){
try{
if(parent.SIMAdWriter){
this.__master=parent.SIMAdWriter;
}
}
catch(e){
this.__logMsg("__findMaster:\n"+this.__catchMe(e));
}
}
return this.__master;
};
_5.prototype.__getConfig=function(key){
if(!key||typeof (this.__config)!="object"){
return;
}
return this.__config[key];
};
_5.prototype.__setConfig=function(key,_5d){
if(!key){
return;
}
if(typeof (this.__config)!="object"){
this.__config={};
}
this.__config[key]=_5d;
};
_5.prototype.__initUpdateConfig=function(_5e){
this.__update_config={};
this.__video_ads_skip={};
if(typeof (_5e)=="object"){
for(var key in _5e){
var _60=_5e[key];
if(key=="pause_after"){
if(typeof (_60)=="string"){
if(_60.match(/^[0-9]+$/)){
_60=Number(_60);
}
}else{
if(typeof (_60)!="number"){
continue;
}
}
}
this.__setUpdateConfig(key,_60);
}
}
var _61=(this.__getUpdateConfig("triggered_for")||"");
if(_61=="CPplayer"){
this.__setUpdateConfig("content_type","CPplayer");
}else{
if(_61=="MCplayer"){
this.__setUpdateConfig("content_type","MCplayer");
}else{
if(_61=="MCcontent"){
this.__setUpdateConfig("content_type","MCcontent");
}else{
if(_61=="video"){
this.__setUpdateConfig("content_type","video");
}else{
if(_61=="contentgallery"){
this.__setUpdateConfig("content_type","gallery");
}
}
}
}
}
if(!this.__getUpdateConfig("available_ad_ids")){
this.__setUpdateConfig("available_ad_ids",(this.__getConfig("available_ad_ids")||[]));
}
if(!this.__getUpdateConfig("path")){
this.__setUpdateConfig("path",(this.__getConfig("path")||"/"));
}
if(!this.__getUpdateConfig("content_type")){
this.__setUpdateConfig("content_type",(this.__getConfig("content_type")||""));
}
if(!this.__getUpdateConfig("event")){
this.__setUpdateConfig("event","");
}
if(!this.__getUpdateConfig("screen_mode")){
this.__setUpdateConfig("screen_mode","normal");
}
var _62=this.__getUpdateConfig("content_type");
var _63=this.__getUpdateConfig("screen_mode");
var _64=this.__getUpdateConfig("available_ad_ids");
var _65=this.__getUpdateConfig("callback_caller");
if(typeof (_65)!="undefined"&&String(_65).match(/^[0-9]+$/)&&_65<_64.length){
this.__setUpdateConfig("callback_caller",_64[_65]);
}
if(this.__getUpdateConfig("callback_function")){
if(!this.__getUpdateConfig("callback_caller")){
var _64=this.__getUpdateConfig("available_ad_ids");
if(_64.length){
this.__setUpdateConfig("callback_caller",_64[0]);
}
}else{
}
}
var _66=[];
for(var i=0;i<_64.length;i++){
var id=_64[i];
if(id=="skyscraper1"&&_62=="MCcontent"){
continue;
}
if(id!="popup1"&&_63.match(/^(?:fullsize|fullscreen)$/)){
continue;
}
_66.push(id);
}
this.__setUpdateConfig("available_ad_ids",_66);
if(this.__getUpdateConfig("ad_exclude_all")){
this.__video_ads_skip.all=1;
}
if(this.__getUpdateConfig("ad_exclude_sponsor")){
this.__video_ads_skip.sponsor=1;
}
if(this.__getUpdateConfig("ad_exclude_midroll")){
this.__video_ads_skip.midroll=1;
}
if(this.__getUpdateConfig("ad_exclude_overlays")){
this.__video_ads_skip.overlay=1;
}
this.__logMsg("__initUpdateConfig",this.__update_config,3);
};
_5.prototype.__getUpdateConfig=function(key){
if(!key||typeof (this.__update_config)!="object"){
return;
}
return this.__update_config[key];
};
_5.prototype.__setUpdateConfig=function(key,_6b){
if(!key){
return;
}
if(typeof (this.__update_config)!="object"){
this.__update_config={};
}
this.__update_config[key]=_6b;
};
_5.prototype.__doCallback=function(_6c){
var _6d=this.__getUpdateConfig("callback_function");
if(!_6d){
return;
}
var _6e=this.__getUpdateConfig("callback_object");
if(!_6e){
var _6f=this.__getUpdateConfig("callback_id");
_6e=_6f?document.getElementById(_6f):window;
}
if(!_6e){
return;
}
var _70={init:_6c?1:0,ad_type:this.adType,tld:this.getTLD()};
var _71=(this.__getUpdateConfig("triggered_for")||"");
try{
_6e[_6d](_70);
this.__logMsg("callback function "+_6d+" called with arguments:",_70);
}
catch(e){
this.__logMsg("__doCallback:\n"+this.__catchMe(e)+"\n"+"callback function "+_6d+" FAILED with arguments:",_70);
return;
}
return true;
};
_5.prototype.__finishIFrameAd=function(_72){
if(this.__getUpdateConfig("callback_function")){
var _73=(this.__getUpdateConfig("callback_caller")||"");
if(_73==_72){
this.__doCallback(1);
}
}
this.resizeIFrame(_72);
this.__logMsg("__finishIFrameAd for "+_72,{},2);
};
_5.prototype.__freeNode=function(_74,_75){
try{
if(_74.nodeType==1){
var _76=["onabort","onblur","onchange","onclick","ondblclick","onerror","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload"];
for(var i=0;i<_76.length;i++){
var k=_76[i];
if(typeof (_74[k])!="function"){
continue;
}
var _79=String(_74[k]);
_79=_79.replace(/^(function *[^\(]*)(?:.|\s|\n)+/,"$1");
this.__logMsg("Destroying event handler from "+_74.tagName+" "+(_74.id||"")+" "+k+" "+_79,{},3,"clear");
_74[k]=null;
}
var _7a=_74.childNodes;
if(_7a){
for(var i=_7a.length-1;i>=0;i--){
this.__freeNode(_7a[i],false);
}
}
}
if(_75&&_74.parentNode){
this.__logMsg("Removing node "+(_74.tagName||"type "+_74.nodeType)+" "+(_74.id||"")+" "+(_74.src||""),{},3,"clear");
_74.parentNode.removeChild(_74);
}
}
catch(e){
this.__logMsg("__freeNode for "+_74.id+":\n"+this.__catchMe(e));
}
};
_5.prototype.__clearDominoIFrame=function(){
if(!this.__findMaster()){
return;
}
var t0=new Date().getTime();
this.__freeNode(document.body);
var _7c=this.showLog("clear");
if(_7c){
_7c="\n"+_7c;
this.clearLog("clear");
}
var _7d=window.frameElement?window.frameElement.id:"?";
this.__logMsg("__clearDominoIFrame for "+_7d+" on body"+" took "+(new Date().getTime()-t0)+" millisecs"+_7c);
};
_5.prototype.__clearIFrameAd=function(_7e){
SIMAdLayoutHandler.setAttributeForElement(this.getSelector(_7e),"display","none");
var _7f=this.__getIFrameHandler();
_7f.resizeIFrame(_7e,[0,0]);
this.__logMsg("__clearIFrameAd for "+_7e,{},3,"clear");
try{
_7f.loadIFrame(_7e,"about:blank");
}
catch(e){
this.__logMsg("__clearIFrameAd for "+_7e+":\n"+this.__catchMe(e));
return;
}
};
_5.prototype.__clearIFrameAds=function(){
var _80=this.__getConfig("available_ad_ids")||[];
for(var i=0;i<_80.length;i++){
var _82=_80[i];
this.__clearIFrameAd(_82);
}
};
_5.prototype.__setDisplayForAdIFrames=function(_83){
var _84=this.__getUpdateConfig("available_ad_ids")||[];
if(!_84.length){
return;
}
for(var i=0;i<_84.length;i++){
var _86=_84[i];
var _87=this.getSelector(_86);
try{
this.__getIFrameHandler().setIFrameDisplay(_86,_83);
if(_83){
SIMAdDeliveryHandler.controlAdContainer(_86,_87);
}else{
var _88=document.getElementById(_87);
if(_88){
_88.style.display="none";
}
}
}
catch(e){
this.__logMsg("__setDisplayForAdIFrames for "+_86+":\n"+this.__catchMe(e));
}
}
};
_5.prototype.__clearDebugPanel=function(){
var _89="sim_ad_debug";
var _8a=document.getElementById(_89);
if(_8a){
_8a.innerHTML="";
}
};
_5.prototype.__getCurrentUpdateIndex=function(){
return this.__update_index;
};
_5.prototype.__getCurrentAdID=function(){
var _8b=this.__getUpdateConfig("available_ad_ids")||[];
var _8c=_8b.length;
var _8d=this.__getCurrentUpdateIndex();
return !_8c||typeof (_8d)!="number"||_8d>=_8c?"":_8b[_8d]||"";
};
_5.prototype.__getNextAdID=function(_8e,_8f){
var _90=this.__getUpdateConfig("available_ad_ids")||[];
var _91=_90.length;
if(!_91){
this.__updating=false;
return;
}
if(!_8e&&!this.__updating){
return;
}
if(_8e){
this.__updating=true;
if(!_8f){
this.__update_index=0;
}else{
++this.__update_index;
}
this.__is_update_start=true;
}else{
++this.__update_index;
}
if(!_8e||this.__update_index>=_91){
this.__is_update_start=false;
if(this.__update_index>=_91){
this.__updating=false;
this.__update_index=null;
return;
}
}
return _90[this.__update_index];
};
_5.prototype.__getIFrameID=function(_92){
return this.getSelector("iframe",_92);
};
_5.prototype.__getIFrameHandler=function(){
if(!this.__ad_iframe_handler){
this.__ad_iframe_handler=new SIMAdIFrameHandler();
}
return this.__ad_iframe_handler;
};
_5.prototype.__skipVideoAdRequest=function(_93){
if(!this.hasVideoAds()){
return true;
}
if(!this.__video_ads_skip){
return false;
}
if(this.__video_ads_skip.all){
return true;
}
if(_93){
if(_93.match(/^(presplit|midroll|postsplit)/)&&this.__video_ads_skip.midroll){
return true;
}
if(_93.match(/^overlay/)&&this.__video_ads_skip.overlay){
return true;
}
if(_93.match(/^sponsor/)&&this.__video_ads_skip.sponsor){
return true;
}
}
return false;
};
_5.prototype.__isDOMSafe=function(){
var _94;
if(!this.__dom_check){
var _95=document.getElementById(this.__DOM_SAFE_ID);
var _96=!/msie/.test(window.navigator.userAgent.toLowerCase())||window.opera?1:0;
var _97=_96||(_95&&_95.doScroll)?0:1;
this.__dom_check={counter:1,safe:_96,container:_95,hopeless:_97,max_rounds:_97?10:40};
}
if(this.__dom_check.safe){
_94=1;
}else{
if(this.__dom_check.hopeless){
if(++this.__dom_check.counter>this.__dom_check.max_rounds){
_94=-1;
}else{
_94=0;
}
}else{
try{
this.__dom_check.container.doScroll("left");
_94=1;
}
catch(e){
this.__logMsg("__isDOMSafe:\n"+this.__catchMe(e));
_94=++this.__dom_check.counter>this.__dom_check.max_rounds?-1:0;
}
}
if(_94!=0){
this.__dom_check.safe=1;
}
if(_94<0&&this.__dom_check.safe){
this.__logMsg("__isDOMSafe check impossible. Considered safe in round "+this.__dom_check.counter);
}else{
if(_94>0){
this.__logMsg("__isDOMSafe ok in round "+this.__dom_check.counter);
}
}
}
return _94;
};
_5.prototype.__logMsg=function(msg,_99,_9a,tmp){
if(!_9a){
_9a=0;
}
var _9c=this.doLog();
if(!_9c||_9a>_9c){
return;
}
if(typeof (msg)=="undefined"){
msg="";
}
if(typeof (_99)=="object"){
var x="";
for(var k in _99){
if(k=="industries"&&typeof (_99[k]=="object")){
var y="";
for(var m in _99[k]){
if(!_99[k][m].industry){
continue;
}
y+="    "+m+":\n";
if(typeof (_99[k][m])=="object"){
for(var n in _99[k][m]){
if(n=="indtarget"){
continue;
}
y+=["        "+n,_99[k][m][n]].join(": ")+"\n";
}
}
}
x+=y?k+":\n"+y:k+": [EMPTY OBJECT]\n";
}else{
x+=[k,_99[k]].join(": ")+"\n";
}
}
if(x){
msg+="\n"+x.replace(/\n+$/,"");
}
}
if(tmp){
if(!this.__tmp_logs){
this.__tmp_logs={};
}
if(!this.__tmp_logs[tmp]){
this.__tmp_logs[tmp]=[];
}
this.__tmp_logs[tmp].push(msg);
}else{
var _a2=this.__findMaster();
if(_a2){
var _a3=window.frameElement;
var _a4=_a3?_a3.id:"";
_a2.__logMsg(msg+"\nfrom domino iframe "+_a4,{},_9a,tmp);
}else{
var _a5=(new Date().getTime()-this.__start_time)/1000;
this.__log.push("* "+_a5+" secs\n"+msg);
}
}
};
_5.prototype.__catchMe=function(e){
return "<span style=\"color:red\">"+(typeof (e)=="string"?e:[e.name,e.message].join("\n"))+"</span>\n";
};
}
if(!_5.__init_ad_type){
if(this.adType!="DUMMY"){
_5.__init_ad_type=1;
}
var _a7=["doAd","getVideoAdRequest","setAdInfo","loadScripts"];
for(var i=0;i<_a7.length;++i){
var _a9=_a7[i];
if(!_5.prototype[_a9]){
_5.prototype[_a9]=function(){
return "";
};
}
}
}
this.__initInstance();
};
SIMAdHandler.EXTENSIONS={};
SIMAdHandler.EXTENSIONS.SHARED={doAd:function(_aa){
var _ab=this.__getMyAdID(_aa);
if(!_ab){
return;
}
this.__logMsg("doAd for "+_aa+" ("+_ab+")");
this.__loading_starts[_aa]=new Date();
var _ac=this.__getAdserverCall();
_ac(_ab,{session_id:this.getSessionID(),path:this.__getConfig("path")||"/",protocol:this.__getProtocol()});
},setAdInfo:function(_ad,_ae){
var _af=this.__getMyAdID(_ad);
if(!_af){
return;
}
if(typeof (_ae)=="undefined"){
_ae={};
}
var _b0=_ae.info||"";
if(!_b0){
_b0="assume existence";
}
if(!_b0){
_b0="fallback";
}
var _b1=_ae.dimensions;
if(!_b1&&this.__dimension_map){
_b1=this.__dimension_map[_ad];
}
if(!_b1){
_b1=[0,0];
}
this.__adtrace[_ad]=_b0+" "+_b1.join("x")+" ("+_af+")";
this.__dimensions[_ad]=_b1;
var msg="setAdInfo for "+_ad+" ("+_af+")";
var _b3=this.__findMaster();
if(_b3){
_b3.setAdInfo(_ad,{info:_b0,dimensions:_b1});
msg+=" - setting iframe and master info";
}
this.__logMsg(msg,{},3);
},__startAdUpdate:function(){
this.__doCallback(0);
},__setSyncVars:function(){
this.__sync_vars={};
},__getMyAdID:function(_b4){
var _b5=this.__SOI_to_MY[_b4];
if(!_b5){
_b5="";
}
return _b5;
}};
SIMAdHandler.EXTENSIONS.SOI={__setSyncVars:SIMAdHandler.EXTENSIONS.SHARED.__setSyncVars,doAd:function(_b6){
this.__logMsg("doAd for "+_b6);
this.__loading_starts[_b6]=new Date();
var _b7=this.__getAdserverCall();
var _b8=_b7(_b6);
document.write(_b8);
var _b9=this.__findMaster();
var _ba=_b8.match(/src=["']?([^"'< ]+)/);
var src=_ba&&_ba[1]?_ba[1]:"";
this.bannerAdRequests[_b6]=src;
if(_b9){
_b9.bannerAdRequests[_b6]=src;
}
},getVideoAdRequest:function(_bc,_bd){
if(this.__skipVideoAdRequest(_bc)){
return "";
}
if(typeof (_bd)!="object"){
_bd={};
}
var _be="";
if(typeof (window.soi_VideoAdRequest)=="function"){
var _bf={};
if(typeof (_bd.industries)=="object"){
_bf.industries=_bd.industries;
}
if(_bd.prefetch){
_bf.prefetch=true;
}
_be=window.soi_VideoAdRequest(_bc,_bf);
}
this.videoAdRequests[_bc]=_be;
this.__logMsg("getVideoAdRequest for "+_bc,_bd);
if(_be&&_bc.match(/(presplit|midroll)/)){
this.clearAdContainers();
}
return _be;
},setAdInfo:function(_c0,_c1){
if(typeof (_c1)=="undefined"){
_c1={};
}
var _c2=_c1.info||"";
if(!_c2&&window.soi_adtrace){
var _c3=unescape(window.soi_adtrace).match(new RegExp(_c0+"(?: *-? *)?(.*)"));
if(_c3){
_c2=_c3[1];
}
}
if(!_c2){
_c2="fallback";
}
var _c4=_c1.dimensions;
if(!_c4&&window.soi_dimension){
_c4=window.soi_dimension[_c0];
}
if(!_c4){
_c4=[0,0];
}
this.__adtrace[_c0]=_c2;
this.__dimensions[_c0]=_c4;
var msg="setAdInfo for "+_c0;
var _c6=this.__findMaster();
if(_c6){
_c6.setAdInfo(_c0,{info:_c2,dimensions:_c4});
msg+=" - setting iframe and master info";
}
this.__logMsg(msg,{},3);
},__setProtocol:function(){
this.__protocol="http:";
},__syncVars:function(_c7,to,_c9){
if(_c7==to){
return;
}
if(_c9!="after"){
return;
}
if(typeof (window.soi_SyncVars)=="function"){
window.soi_SyncVars(_c7,to);
}
},__resetVars:function(){
if(typeof (window.soi_ResetVars)=="function"){
window.soi_ResetVars();
}
},__start:function(){
var _ca=this.__findMaster();
if(_ca){
if(_ca.isUpdateStart()){
_ca.hasVideoAds(this.hasVideoAds());
}else{
_ca.syncVars(parent,window,"after");
}
}
}};
SIMAdHandler.EXTENSIONS.OAS={doAd:SIMAdHandler.EXTENSIONS.SHARED.doAd,getVideoAdRequest:function(_cb,_cc){
if(this.__skipVideoAdRequest(_cb)){
return "";
}
if(typeof (_cc)!="object"){
_cc={};
}
var _cd=this.__getMyAdID(_cb);
var _ce=window["OAS_"+_cd];
this.__logMsg("getVideoAdRequest for "+_cb);
this.videoAdRequests[_cb]=_ce;
if(!_ce){
return "";
}
if(typeof (_cc.industries)=="object"){
var _cf={};
var _d0="";
for(var key in _cc.industries){
var _d2=_cc.industries[key].industry||"";
_d2=_d2.replace(/^ +/,"").replace(/ +$/,"");
if(!_d2){
continue;
}
if(_cf[_d2]){
continue;
}
_cf[_d2]=1;
if(_d0){
_d0+="&";
}
_d0+="ind="+escape(_d2);
}
if(_d0){
_ce+="&"+_d0;
}
}
this.__writeCounterPixel("OAS_"+_cd+"_counter");
return _ce;
},loadScripts:function(_d3){
if(typeof (_d3)!="object"){
return;
}
var _d4=_d3.taxonomie;
if(!_d4){
return;
}
var _d5=_d3.method;
if(!_d5){
return;
}
var _d6;
if(_d5=="jx"){
ad_id=_d3.ad_id;
if(!ad_id){
return;
}
_d6=this.__getMyAdID(ad_id);
if(!_d6){
return;
}
}
var _d7=this.__getConfig("content_type");
var _d8="?content_type="+escape(_d7);
var _d9=_d3.info||{};
for(var key in _d9){
var _db=_d9[key];
if(typeof (_db)=="undefined"||!String(_db).length){
continue;
}
if(_d8){
_d8+="&";
}
_d8+=[escape(key),escape(_d9[key])].join("=");
}
try{
var _dc=top.location.search.match(/(showroom)=([a-zA-Z0-9_-]*)/);
if(_dc){
if(_d8){
_d8+="&";
}
_d8+=[_dc[1],_dc[2]||"standard"].join("=");
}
}
catch(e){
this.__logMsg("loadScripts:\n"+this.__catchMe(e));
}
var _dd=this.__getConfig("available_ad_ids")||[];
var _de="";
for(var i=0;i<_dd.length;i++){
var _e0=this.__getMyAdID(_dd[i]);
if(!_e0){
continue;
}
if(_de){
_de+=",";
}
_de+=_e0;
}
var _e1=this.__findMaster();
var _e2=_e1&&_e1.isUpdateStart();
var _e3=[];
var _e4="";
if(this.hasVideoAds()){
var _e5=this.__getConfig("available_video_ads")||[];
for(var k=0;k<_e5.length;k++){
var _e7=_e5[k];
if(!this.__canRolltype(_e7)){
continue;
}
if(_e7.match(/^(presplit|postsplit)$/)){
continue;
}
if(_d5=="jx"){
if(_e7.match(/^(preroll|sponsor)$/)){
var _e8=this.__getVideoBlockListPos(_e7);
if(_e8){
var _e9=_e8.split(",");
for(var i=0;i<_e9.length;i++){
_e3.push(_e9[i]);
}
if(_de){
_de+=",";
}
_de+=_e8;
}
}else{
if(_e7.match(/^(midroll|overlay|postroll)$/)&&_e2){
var _e8=this.__getVideoBlockListPos(_e7);
if(_e8){
if(_e4){
_e4+=",";
}
_e4+=_e8;
}
}
}
}else{
if(_d5=="mjx"){
var _e8=this.__getVideoBlockListPos(_e7);
if(_e8){
if(_de){
_de+=",";
}
_de+=_e8;
}
}
}
}
}
if(_de){
var _ea=this.__adserver+"/adstream_"+_d5+".ads"+"/"+_d4+"/1"+this.getSessionID()+"@";
var src=_ea+_de+(_d5=="jx"?"!"+_d6:"")+_d8;
document.write("<script src=\""+src+"\"></script>");
this.__logMsg("loadScripts:\n"+src);
}
if(_d5=="jx"&&this.hasVideoAds()){
if(_e2){
for(var i=0;i<_e3.length;i++){
src=_ea+_de+"!"+_e3[i]+_d8;
document.write("<script src=\""+src+"\"></script>");
this.__logMsg("loadScripts:\n"+src);
}
if(_e4){
src=this.__adserver+"/adstream_mjx.ads"+"/"+_d4+"/1"+this.getSessionID()+"@"+_e4+_d8;
document.write("<script src=\""+src+"\"></script>");
this.__logMsg("loadScripts:\n"+src);
}
}
}
},setAdInfo:function(_ec,_ed){
var _ee=this.__getMyAdID(_ec);
if(!_ee){
return;
}
if(typeof (_ed)=="undefined"){
_ed={};
}
var _ef=_ed.info||"";
var _f0=document.getElementById("oasinfo_"+_ee);
if(!_ef&&_f0){
_ef=_f0.title;
}
if(!_ef){
_ef="fallback";
}
var _f1=_ed.dimensions;
if(!_f1&&_f0){
x=parseInt(_f0.style.width||0);
y=parseInt(_f0.style.height||0);
if(_ec=="fullbanner1"||_ec=="fullbanner2"){
if(x>1.2*728){
x=728;
}
if(y>1.2*90){
y=90;
}
}else{
if(_ec=="rectangle1"){
if(x>1.2*300){
x=300;
}
if(y>1.2*250){
y=250;
}
}else{
if(_ec=="rectangle2"){
if(x>1.2*180){
x=180;
}
if(y>1.2*150){
y=150;
}
}else{
if(_ec=="skyscraper1"){
if(x>1.2*160){
x=160;
}
if(y>1.2*600){
y=600;
}
}
}
}
}
_f1=[x||0,y||0];
}
if(!_f1){
_f1=[0,0];
}
this.__dimensions[_ec]=_f1;
this.__adtrace[_ec]=_ef+" "+_f1.join("x")+" ("+_ee+")";
var msg="setAdInfo for "+_ec+" ("+_ee+")";
var _f3=this.__findMaster();
if(_f3){
_f3.setAdInfo(_ec,{info:_ef,dimensions:_f1});
msg+=" - setting iframe and master info";
}
this.__logMsg(msg,{},3);
},__setProtocol:function(){
this.__protocol="http:";
},__initVideoAdRequests:function(){
if(!this.hasVideoAds()){
return "";
}
var _f4=this.__getAdserverCall();
var _f5=this.__getRolltypes();
for(var k=0;k<_f5.length;k++){
var _f7=_f5[k];
var _f8=this.__getRolltypeMax(_f7);
var _f9=this.__getRolltypeBlockIDs(_f7);
for(var i=1;i<=_f8;i++){
var _fb=this.__getMyAdID(_f7+i);
if(!_fb){
continue;
}
if(_f7=="midroll"){
var _fc=["presplit","postsplit"];
for(var l=0;l<_fc.length;l++){
var _fe=this.__getMyAdID(_fc[l]+i);
if(_fe){
_f4(_fe);
}
}
}
for(var j=0;j<_f9.length;j++){
_f4(_fb+_f9[j]);
}
}
}
document.write("<div id=\""+this.__videoad_pixel_id+"_container\" style=\"position:absolute;top:-100px;\"></div>");
this.__logMsg("__initVideoAdRequests done",{},2);
},__setSpecialProperties:function(){
this.__videoad_pixel_id="oas_videoad_pixel";
this.__rolltypes=["preroll","sponsor","midroll","overlay","postroll"];
this.__preroll_max=1;
this.__preroll_block_ids=["","b"];
this.__sponsor_max=1;
this.__sponsor_block_ids=["","b"];
this.__midroll_max=5;
this.__midroll_block_ids=["","b"];
this.__overlay_max=5;
this.__overlay_block_ids=["","b"];
this.__postroll_max=1;
this.__postroll_block_ids=["","b"];
var _100=this.__getProtocol();
this.__adserver=_100+"//austria1.adverserve.net/RealMedia/ads";
},__getRolltypeMax:function(_101){
return this["__"+_101+"_max"]||0;
},__getRolltypeBlockIDs:function(_102){
return this["__"+_102+"_block_ids"]||[];
},__getRolltypes:function(){
return this.__rolltypes||[];
},__canRolltype:function(_103){
_103=_103.replace(/[0-9]+[a-z]?$/,"");
var _104=this.__getRolltypes();
for(var i=0;i<_104.length;i++){
if(_103==_104[i]){
return true;
}
}
return false;
},__getVideoBlockListPos:function(_106){
if(!this.__canRolltype(_106)){
return "";
}
var _107="";
var _108=this.__getRolltypeMax(_106);
var _109=this.__getRolltypeBlockIDs(_106);
for(var i=1;i<=_108;i++){
if(_106=="midroll"){
var _10b=["presplit","postsplit"];
for(var l=0;l<_10b.length;l++){
var _10d=this.__getMyAdID(_10b[l]+i);
if(_10d){
if(_107){
_107+=",";
}
_107+=_10d;
}
}
}
for(var j=0;j<_109.length;j++){
var _10f=this.__getMyAdID(_106+i+_109[j]);
if(!_10f){
continue;
}
if(_107){
_107+=",";
}
_107+=_10f;
}
}
return _107;
},__writeCounterPixel:function(_110){
var uri=window[_110];
if(!uri){
return;
}
var id=this.__videoad_pixel_id;
var _113=document.getElementById(id);
if(!_113){
var _114=document.getElementById(id+"_container");
if(!_114){
_114=document.createElement("div");
_114.style.position="absolute";
_114.style.top="-100px";
document.getElementsByTagName("body")[0].appendChild(_114);
}
_113=document.createElement("img");
_113.id=id;
_113.style.width="1px";
_113.style.height="1px";
_113.style.borderStyle="none";
_114.appendChild(_113);
_114=null;
}
_113.src=uri;
_113=null;
this.__logMsg("__writeCounterPixel for "+_110+":\n"+uri,{},2);
},__setSyncVars:function(){
this.__sync_vars={};
this.__sync_vars.video_ad_requests=[];
var _115=this.__getRolltypes();
for(var k=0;k<_115.length;k++){
var _117=_115[k];
var _118=this.__getRolltypeMax(_117);
var _119=this.__getRolltypeBlockIDs(_117);
for(var i=1;i<=_118;i++){
var _11b=this.__getMyAdID(_117+i);
if(!_11b){
continue;
}
if(_117=="midroll"){
var _11c=["presplit","postsplit"];
for(var l=0;l<_11c.length;l++){
var _11e=this.__getMyAdID(_11c[l]+i);
if(_11e){
this.__sync_vars.video_ad_requests.push("OAS_"+_11e);
this.__sync_vars.video_ad_requests.push("OAS_"+_11e+"_counter");
}
}
}
for(var j=0;j<_119.length;j++){
this.__sync_vars.video_ad_requests.push("OAS_"+_11b+_119[j]);
this.__sync_vars.video_ad_requests.push("OAS_"+_11b+_119[j]+"_counter");
}
}
}
},__start:function(){
var _120=this.__findMaster();
if(_120){
if(_120.isUpdateStart()){
_120.hasVideoAds(this.hasVideoAds());
this.__initVideoAdRequests();
_120.syncVars(window,parent,"video_ad_requests");
}
}else{
this.__initVideoAdRequests();
}
},__getMyAdID:function(_121){
var _122={popup1:"Popup",fullbanner1:"Top1",fullbanner2:"Top",rectangle1:"Middle1",rectangle2:"Position1",rectangle3:"Position2",maxiad1:"Middle2",skyscraper1:"Right1",preroll1:"Video1",sponsor1:"Sponsor1",presplit1:"Presplit1",presplit2:"Presplit2",presplit3:"Presplit3",presplit4:"Presplit4",presplit5:"Presplit5",midroll1:"Video3",midroll2:"Video4",midroll3:"Video5",midroll4:"Video6",midroll5:"Video7",overlay1:"Overlay1",overlay2:"Overlay2",overlay3:"Overlay3",overlay4:"Overlay4",overlay5:"Overlay5",postroll1:"Video2"};
var _123=_122[_121];
if(!_123){
var _124=_121.match(/^(.*)([0-9]+)([a-z])$/,"");
if(_124){
var type=_124[1];
var pos=_124[2];
var vpos=_124[3];
if(_122[type+pos]){
var _128=this.__getRolltypeBlockIDs(type);
for(var i=0;i<_128.length;i++){
if(_128[i]==vpos){
_123=_122[type+pos]+vpos;
break;
}
}
}
}
}
return _123||"";
}};
SIMAdHandler.EXTENSIONS.ADBE={doAd:SIMAdHandler.EXTENSIONS.SHARED.doAd,getVideoAdRequest:SIMAdHandler.EXTENSIONS.SHARED.getVideoAdRequest,setAdInfo:SIMAdHandler.EXTENSIONS.SHARED.setAdInfo,__setSyncVars:SIMAdHandler.EXTENSIONS.SHARED.__setSyncVars,__getMyAdID:SIMAdHandler.EXTENSIONS.SHARED.__getMyAdID,__startAdUpdate:SIMAdHandler.EXTENSIONS.SHARED.__startAdUpdate,loadScripts:function(){
var path=this.__getConfig("path")||"/";
var _12b=path.split("/");
var zone=(_12b[2]||"")=="home"?"homepage":"others";
var _12d=this.__getProtocol();
window.adlSite="be.sevengames.nl";
window.adlZone=zone;
window.adlPro=_12d;
var src=adlPro+"//js.adlink.net/js?lang=be&amp;s="+adlSite+"&amp;z="+zone+"&amp;d="+this.getSessionID();
document.write("<script type= \"text/javascript\" src=\""+src+"\"></"+"script>");
this.__logMsg("loadScripts\n"+src);
},__setProtocol:function(){
this.__protocol=window.location.protocol=="https:"?"https:":"http:";
},__adserver_call:function(_12f,args){
var _131=window.getAdLinkAdTag;
if(typeof (_131)!="function"){
return;
}
var me=arguments.callee;
if(!me.__init){
me.__init=1;
var path=args.path||"/";
var _134=path.split("/");
me.__zone=(_134[2]||"")=="home"?"homepage":"others";
}
_131(_12f,me.__zone);
},__setSpecialProperties:function(){
this.__SOI_to_MY={fullbanner2:"728x90,468x60",rectangle1:"300x250",skyscraper1:"160x600,120x600"};
this.__dimension_map={fullbanner2:[728,90],rectangle1:[300,250],skyscraper1:[160,600]};
}};
SIMAdHandler.EXTENSIONS.ADNL={doAd:SIMAdHandler.EXTENSIONS.SHARED.doAd,getVideoAdRequest:SIMAdHandler.EXTENSIONS.SHARED.getVideoAdRequest,setAdInfo:SIMAdHandler.EXTENSIONS.SHARED.setAdInfo,__setSyncVars:SIMAdHandler.EXTENSIONS.SHARED.__setSyncVars,__getMyAdID:SIMAdHandler.EXTENSIONS.SHARED.__getMyAdID,__startAdUpdate:SIMAdHandler.EXTENSIONS.SHARED.__startAdUpdate,loadScripts:function(_135){
var src="";
var _137=this.__getProtocol();
if(_135==1){
src=_137+"//rc.wl.sbs.nl/Get/SBS/JS/GetRcmd.js?d="+this.getSessionID();
document.write("<script type=\"text/javascript\" src=\""+src+"\"></script>");
}else{
if(_135==2){
var path=this.__getConfig("path")||"/";
var _139=path.split("/");
var zone=_139[2]||"_default";
src=_137+"//tr.wl.sbs.nl/Cnt/SBS/CP/sevengames/"+zone+"?d="+this.getSessionID();
document.write("<img src=\""+src+"\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" style=\"display:none;\" />");
}
}
if(src){
this.__logMsg("loadScripts ["+_135+"]\n"+src);
}
},__setProtocol:function(){
this.__protocol="http:";
},__adserver_call:function(_13b,args){
var me=arguments.callee;
if(!me.__init){
me.__init=1;
me.__tile=0;
me.__protocol=args.protocol||"http:";
}
var _13e={fullbanner2:"468x60,728x90",rectangle1:"300x250",skyscraper1:"120x600,160x600"};
var sz=_13e[_13b];
if(!sz){
return;
}
var path=args.path||"/";
var _141=path.split("/");
var zone=_141[2]||"_default";
var _143={sz:sz,tile:++me.__tile,ord:args.session_id};
var _144="";
for(var key in _143){
var _146=_143[key];
_144+=";"+[key,_146].join("=");
}
var src=me.__protocol+"//ad.nl.doubleclick.net/adj/sbs.sevengames.nl/"+zone+_144+"?";
document.write("<script type=\"text/javascript\" src=\""+src+"\"></script>");
},__setSpecialProperties:function(){
this.__SOI_to_MY={fullbanner2:"fullbanner2",rectangle1:"rectangle1",skyscraper1:"skyscraper1"};
this.__dimension_map={fullbanner2:[728,90],rectangle1:[300,250],skyscraper1:[160,600]};
}};
SIMAdHandler.EXTENSIONS.ADNO={doAd:SIMAdHandler.EXTENSIONS.SHARED.doAd,getVideoAdRequest:SIMAdHandler.EXTENSIONS.SHARED.getVideoAdRequest,setAdInfo:SIMAdHandler.EXTENSIONS.SHARED.setAdInfo,__setSyncVars:SIMAdHandler.EXTENSIONS.SHARED.__setSyncVars,__getMyAdID:SIMAdHandler.EXTENSIONS.SHARED.__getMyAdID,__startAdUpdate:SIMAdHandler.EXTENSIONS.SHARED.__startAdUpdate,__setProtocol:function(){
this.__protocol="http:";
},__adserver_call:function(_148,args){
var me=arguments.callee;
if(!me.__init){
me.__init=1;
if(!document.MAX_used){
document.MAX_used=",";
}
me.__charset=document.charset||document.characterSet;
if(me.__charset){
me.__charset="&charset="+escape(me.__charset);
}
me.__referrer=document.referrer?"&referer="+escape(document.referrer):"";
me.__location="&loc="+escape(window.location);
me.__context=document.context?"&context="+escape(document.context):"";
me.__protocol=args.protocol||"http:";
}
var _14b=document.MAX_used!=","?"&exclude="+document.MAX_used:"";
var fo=document.mmm_fo?"&mmm_fo=1":"";
var src=me.__protocol+"//openx.tvnorge.no/www/delivery/ajs.php?zoneid="+_148+"&cb="+args.session_id+_14b+me.__charset+me.__location+me.__referrer+me.__context+fo;
document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\""+src+"\"></script>");
},__setSpecialProperties:function(){
this.__SOI_to_MY={rectangle1:14,skyscraper1:39};
this.__dimension_map={"rectangle1":[468,400],"skyscraper1":[180,500]};
}};
SIMAdHandler.EXTENSIONS.ADSE={doAd:SIMAdHandler.EXTENSIONS.SHARED.doAd,getVideoAdRequest:SIMAdHandler.EXTENSIONS.SHARED.getVideoAdRequest,setAdInfo:SIMAdHandler.EXTENSIONS.SHARED.setAdInfo,__setSyncVars:SIMAdHandler.EXTENSIONS.SHARED.__setSyncVars,__getMyAdID:SIMAdHandler.EXTENSIONS.SHARED.__getMyAdID,__startAdUpdate:SIMAdHandler.EXTENSIONS.SHARED.__startAdUpdate,loadScripts:function(_14e,args){
if(typeof (args)!="object"){
args={};
}
var _150=this.__getProtocol();
var src;
if(_14e==1){
var src=_150+"//fusion.adtoma.com/script.js";
document.write("<script type=\"text/javascript\" src=\""+src+"\"></script>");
this.__logMsg("loadScripts ["+_14e+"]\n"+src);
}else{
if(_14e==2){
var path=args.path||"/";
var _153=path.split("/");
var zone=(_153[2]||"")=="home"?"start":"start";
window.Fusion.mediaZone="sevengames."+zone;
window.Fusion.layout="sevengames_main";
window.Fusion.adServer="fusion.adtoma.com";
window.Fusion.protocol=_150+"//";
window.Fusion.loadAds();
this.__logMsg("loadScripts ["+_14e+"]\n"+"loadAds() - "+window.Fusion.mediaZone);
}
}
},__setProtocol:function(){
this.__protocol=window.location.protocol=="https:"?"https:":"http:";
},__adserver_call:function(_155,args){
if(!window.Fusion){
return;
}
var _157=window.Fusion.space;
if(typeof (_157)!="function"){
return;
}
var me=arguments.callee;
if(!me.__init){
me.__init=1;
}
if(_155=="TWS"){
var _159=3;
for(var i=1;i<=_159;i++){
_157(_155+i);
}
}else{
_157(_155);
}
},__setSpecialProperties:function(){
this.__SOI_to_MY={popup1:"RichMedia",fullbanner2:"panorama",skyscraper1:"TWS"};
this.__dimension_map={popup1:[0,0],fullbanner2:[980,120],skyscraper1:[250,3*360]};
}};
function SIMAdIFrameHandler(){
var self=arguments.callee;
if(!self.__init){
self.__init=1;
self.prototype.loadIFrame=function(_15c,url){
if(!url){
url="about:blank";
}
try{
var _15e=this.__getIFrameWindow(_15c);
_15e.location.replace(url);
}
catch(e){
try{
var _15f=document.getElementById(this.getSelector("iframe",_15c));
_15f.src=url;
}
catch(e){
return;
}
}
return true;
};
self.prototype.resizeIFrame=function(_160,_161){
var _162=this.getSelector("iframe",_160);
var _163=document.getElementById(_162);
if(!_163){
return;
}
_163.style.display="inline-block";
if(_163.style.border){
_163.style.borderStyle="none";
}
_163.style.width=_161[0]+"px";
_163.style.height=_161[1]+"px";
};
self.prototype.setIFrameDisplay=function(_164,flag){
var _166=this.getSelector("iframe",_164);
var _167=document.getElementById(_166);
if(!_167){
return;
}
_167.style.display=flag?"inline-block":"none";
};
self.prototype.__getIFrameWindow=function(_168){
var _169=this.__getAdIFrame(_168);
if(!_169){
return;
}
var _16a=_169.contentWindow;
if(!_16a){
try{
_16a=_169.contentDocument.defaultView;
}
catch(e){
try{
var _16b=this.getSelector("iframe",_168);
_16a=window.frames[_16b];
}
catch(e){
}
}
}
return _16a;
};
self.prototype.__getAdIFrame=function(_16c){
if(!_16c){
return;
}
var _16d=this.getSelector("iframe",_16c);
var _16e=document.getElementById(_16d);
if(!_16e){
var _16f=this.getSelector("target",_16c);
var _170=document.getElementById(_16f);
if(!_170){
return;
}
var _171=0;
var _172=0;
var _173=0;
var _174="none";
_16e=document.createElement("iframe");
_16e.id=_16d;
_16e.name=_16d;
_16e.style.width=_171+"px";
_16e.style.height=_172+"px";
_16e.style.borderStyle=_174;
_16e.style.borderWidth=_173+"px";
_16e.style.padding="0px";
_16e.style.margin="0px";
_16e.src="about:blank";
_16e.frameBorder=_173;
_16e.border=_173;
_16e.scrolling="no";
_16e.allowTransparency=true;
_170.appendChild(_16e);
_170=null;
}
return _16e;
};
self.prototype.getSelector=function(){
return (SIMAdWriter.getSelector).apply(SIMAdWriter,arguments);
};
}
};
var SIMAdDeliveryHandler={isType:function(_175,type){
var _177=SIMAdWriter.getAdtrace(_175);
if(!_177){
return false;
}
if(typeof (type)=="undefined"){
type="";
}
return (new RegExp(_175+".+"+type,"i")).test(_177)?true:false;
},isDelivered:function(_178){
return this.isType(_178)&&!this.isType(_178,"fallback")?true:false;
},hasBlockpixel:function(_179){
return this.isType(_179,"block[_-]?pixel")?true:false;
},reserveSowefoSpace:function(_17a){
return this.isType(_17a,"block[_-]?pixel.+"+_17a)?true:false;
},controlAdContainer:function(_17b,_17c){
if(!_17c){
_17c=_17b;
}
var elem=document.getElementById(_17c);
if(!elem){
return _17e;
}
var _17e=this.isDelivered(_17b)?true:false;
if(_17e){
SIMAdLayoutHandler.removeStyleAttribute(elem,"inline-block");
if(this.hasBlockpixel(_17b)){
if(this.reserveSowefoSpace(_17b)){
elem.style.backgroundColor="transparent";
elem.style.backgroundImage="none";
elem.style.borderColor="transparent";
if(SIMAdLayoutHandler.getCurrentStyle(elem,"border-left-color")=="#000000"){
elem.style.borderStyle="none";
}
}else{
elem.style.display="none";
return;
}
}
}else{
elem.style.display="none";
}
return _17e;
},moveAd:function(id){
var _180=this.getSelector("source",id);
var _181=this.getSelector("target",id);
var _182=document.getElementById(_180);
var _183=document.getElementById(_181);
if(!_182||!_183){
return;
}
var _184=_182.getElementsByTagName("script");
for(var i=0;i<_184.length;i++){
if(!_184[i].src){
continue;
}
_184[i].removeAttribute("src");
}
var _186=_183.parentNode;
_186.replaceChild(_182,_183);
_182.id=_181;
SIMAdLayoutHandler.removeStyleAttribute(_182);
_183=null;
_182=null;
_186=null;
},getSelector:function(){
return (SIMAdWriter.getSelector).apply(SIMAdWriter,arguments);
}};
var SIMAdLayoutHandler={callMethod:function(_187,what,args){
if(!_187){
return;
}
var slot=this[_187];
if(typeof (slot)!="object"){
return;
}
var _18b=slot[what];
if(typeof (_18b)!="function"){
return;
}
_18b.call(this,args);
},adjustLayoutFor:function(what,args){
return this.callMethod("adjust",what,args);
},renderAd:function(what,args){
return this.callMethod("render",what,args);
},isType:function(_190,type){
return SIMAdDeliveryHandler.isType(_190,type);
},getAdDimensions:function(_192){
return SIMAdWriter.getAdDimensions(_192)||[0,0];
},getOffsetDimensions:function(_193){
return SIMAdWriter.getOffsetDimensions(_193);
},isDelivered:function(_194){
return SIMAdDeliveryHandler.isDelivered(_194);
},getAdType:function(){
return SIMAdWriter.adType;
},getSelector:function(){
return (SIMAdWriter.getSelector).apply(SIMAdWriter,arguments);
},setAttributeForElement:function(id,_196,_197){
var _198=document.getElementById(id);
if(!_198){
return;
}
if(_196=="class"){
_198.className=_197;
}else{
if(_196=="id"){
_198.id=_197;
}else{
if(_196=="readOnly"){
_198.readOnly=_197;
}else{
_198.style[_196]=_197;
}
}
}
return true;
},getScreenDimensions:function(){
var _199=[];
try{
var x=top.innerWidth;
if(typeof (x)!="undefined"){
_199.push(x);
_199.push(top.innerHeight);
}else{
var t=top.document;
var _19c=t.documentElement||t.body;
if(_19c){
x=_19c.clientWidth;
}
if(typeof (x)!="undefined"){
_199.push(x);
_199.push(_19c.clientHeight);
}else{
_199.push(t.body.offsetWidth);
_199.push(t.body.offsetHeight);
}
}
}
catch(e){
}
return _199;
},getCurrentStyle:function(arg,_19e){
var _19f=typeof (arg)=="string"?document.getElementById(arg):arg;
if(!_19f){
return;
}
var _1a0=document.defaultView?document.defaultView.getComputedStyle:window.getComputedStyle;
if(typeof (_1a0)=="function"){
var _1a1=_1a0(_19f,null);
if(_1a1){
var _1a2=_19e.match(/^(?:float|styleFloat)$/)?"cssFloat":_19e.replace(/([A-Z])/g,function(x,c){
return "-"+c.toLowerCase();
});
value=_1a1.getPropertyValue(_1a2);
}
}else{
var _1a1=_19f.currentStyle;
if(_1a1){
var _1a2=_19e.match(/^(?:float|cssFloat)$/)?"styleFloat":_19e.replace(/-(.)/g,function(x,c){
return c.toUpperCase();
});
value=_1a1[_1a2];
}
}
return value;
},removeStyleAttribute:function(arg,_1a8){
var elem=typeof (arg)=="string"?document.getElementById(arg):arg;
if(!elem){
return;
}
var xxx=elem.getAttribute("style");
elem.removeAttribute("style");
if(elem.className){
elem.className=elem.className;
}
if(_1a8&&elem.style.display&&elem.style.display!=_1a8){
elem.style.display=_1a8;
}
var _1ab=this.getCurrentStyle(elem,"width")||"auto";
if(_1ab=="0px"){
_1ab="auto";
}
elem.style.width=_1ab;
},adjust:{fullbanner2:function(args){
var _1ad="fullbanner2";
if(typeof (args)!="object"){
args={};
}
var mode=args.mode||"";
var _1af=this.getAdType();
var _1b0=this.isDelivered(_1ad);
if(!_1b0){
return;
}
var _1b1=_1af=="ADSE"?120:90;
var _1b2=0;
if(mode!="finish"){
this.removeStyleAttribute("sgp"+_1ad);
this.removeStyleAttribute("sgpright");
var _1b3=this.isType("fullbanner2","PB2");
var _1b4=this.getAdDimensions(_1ad);
if(_1af=="SOI"&&_1b3){
_1b4[1]=180;
}
_1b2=_1b1-_1b4[1];
if(_1b2<0&&_1af=="SOI"&&!_1b3){
_1b2=0;
}
}else{
if(_1af.match(/^(SOI|OAS)$/)){
return;
}
var _1b5=this.getOffsetDimensions(_1ad);
var ox=_1b5[0];
var oy=_1b5[1];
if(typeof (oy)=="number"){
if(oy<15){
this.setAttributeForElement(this.getSelector(_1ad),"display","none");
}else{
_1b2=_1b1-oy;
if(_1b2){
if(_1b2>0){
_1b2=0;
}else{
if(_1b2>-9){
if(_1b2>-9){
_1b2=0;
}
}
}
}
}
}
}
if(!this.isType("fullbanner2","blockpixel")){
if(_1b2>0){
var _1b8=this.getSelector(_1ad);
var _1b9=parseInt(this.getCurrentStyle(_1b8,"padding-top"))||0;
this.setAttributeForElement(_1b8,"paddingTop",(_1b2+_1b9)+"px");
}else{
if(_1b2<0){
var _1b8="sgp"+_1ad;
var _1ba=parseInt(this.getCurrentStyle(_1b8,"height"))||_1b1;
this.setAttributeForElement(_1b8,"height",(_1ba+Math.abs(_1b2))+"px");
var _1bb=parseInt(this.getCurrentStyle("sgpright","top")||0);
this.setAttributeForElement("sgpright","top",(_1bb+Math.abs(_1b2))+"px");
}
}
}
},skyscraper1:function(args){
var _1bd="skyscraper1";
if(typeof (args)!="object"){
args={};
}
var mode=args.mode||"";
if(mode!="finish"){
return;
}
var _1bf=this.getAdType();
if(_1bf=="SOI"||_1bf=="OAS"){
return;
}
var _1c0=this.isDelivered(_1bd);
if(!_1c0){
return;
}
var _1c1=this.getOffsetDimensions(_1bd);
var ox=_1c1[0];
var oy=_1c1[1];
if(typeof (oy)=="number"&&oy<15){
this.setAttributeForElement(this.getSelector(_1bd),"display","none");
}
},rectangle1:function(args){
var _1c5="rectangle1";
if(typeof (args)!="object"){
args={};
}
var mode=args.mode||"";
var _1c7=this.getAdType();
var _1c8=this.isDelivered(_1c5);
var _1c9=document.getElementById("sgp"+_1c5);
var slot;
if(_1c9){
var _1cb=_1c9.parentNode;
var _1cc=100;
var _1cd=0;
while(_1cb&&!slot){
if(++_1cd>_1cc){
break;
}
if(_1cb.tagName.toLowerCase().match(/^(?:body|html)$/)){
break;
}
if(_1cb.className=="Module"&&_1cb.tagName.toLowerCase()=="div"){
slot=_1cb;
break;
}
_1cb=_1cb.parentNode;
}
}
var _1ce=document.getElementById(this.getSelector("fallback",_1c5));
if(_1ce){
_1ce.style.display=_1c8?"none":"block";
if(slot){
slot.style.display="block";
}
}else{
if(slot){
slot.style.display=_1c8?"block":"none";
}
}
if(mode!="finish"){
return;
}
if(_1c7=="SOI"||_1c7=="OAS"){
return;
}
if(!_1c8){
return;
}
var _1cf=this.getOffsetDimensions(_1c5);
var ox=_1cf[0];
var oy=_1cf[1];
if(typeof (oy)=="number"&&oy<15){
this.setAttributeForElement(this.getSelector(_1c5),"display","none");
if(_1ce){
_1ce.style.display="block";
if(slot){
slot.style.display="block";
}
}else{
if(slot){
slot.style.display="none";
}
}
}else{
if(_1ce){
_1ce.style.display="none";
if(slot){
slot.style.display="block";
}
}else{
if(slot){
slot.style.display="block";
}
}
}
},finish:function(args){
if(typeof (args)!="object"){
args={};
}
var _1d3=["rectangle1","fullbanner2","skyscraper1"];
for(var i=0;i<_1d3.length;i++){
var _1d5=_1d3[i];
if(args.iframe&&args.iframe!=_1d5){
continue;
}
this.adjustLayoutFor(_1d5,{mode:"finish"});
}
}},render:{shoppingtipp:function(args){
if(typeof (args)!="object"){
args={};
}
var pos=args.pos;
if(typeof (pos)=="undefined"){
return;
}
var _1d8="shoppingtipp"+pos;
var me=arguments.callee;
if(!me.headline_done){
me.headline_done=0;
}
var head,lnk,img,txt1,txt2,txt3,type;
if(typeof (window.SOI_SHOPPINGTIP)=="object"){
head=SOI_SHOPPINGTIP.headline||"";
type=SOI_SHOPPINGTIP.type||"";
lnk=SOI_SHOPPINGTIP.linkHref||"";
img=SOI_SHOPPINGTIP.imageURL||"";
txt1=SOI_SHOPPINGTIP.teaserHeadline||"";
txt2=SOI_SHOPPINGTIP.teaserText||"";
txt3=SOI_SHOPPINGTIP.linkText||"";
}else{
head="Shopping Tipps";
type="image";
lnk=window.SOI_LNK||"";
img=window.SOI_IMG||"";
txt1=window.SOI_TXT1||"";
if(txt1=="Shopping Tipps"){
txt1="";
}
txt2=window.SOI_TXT2||"";
txt3=window.SOI_TXT3||"";
}
if(!(lnk&&(txt1||txt2||txt3||img))){
return;
}
if(!img){
type="text";
}
var s="";
if(type=="image"&&img){
s="<a href=\""+lnk+"\" target=\"_blank\"><img style=\"width:60px;height:60px\" src=\""+img+"\" /></a>\n";
}
if(txt1){
s+="<p><a style=\"font-weight:bold\" href=\""+lnk+"\" target=\"_blank\">"+txt1+"</a></p>\n";
}
if(txt2){
s+="<p><a href=\""+lnk+"\" target=\"_blank\">"+txt2+"</a></p>\n";
}
if(txt3){
s+="<p><a style=\"text-decoration:underline\" href=\""+lnk+"\" target=\"_blank\">"+txt3+"</a></p>\n";
}
var _1e2=type!="image"?" text":"";
s="<div class=\"shoppingtipp"+_1e2+"\">"+s+"</div>";
if(!me.headline_done++&&head){
s="<h6>"+head+"</h6>\n"+s;
}
if(args.last){
me.headline_done=0;
}
window.SOI_SHOPPINGTIP={};
var _1e3=["SOI_LNK","SOI_IMG","SOI_TXT1","SOI_TXT2","SOI_TXT3"];
for(var i=0;i<_1e3.length;i++){
window[_1e3[i]]="";
}
var _1e5=document.getElementById(this.getSelector("target",_1d8));
if(_1e5){
_1e5.innerHTML=s;
}
}}};
if(!window.soi_adtrace){
soi_adtrace="";
}
if(!window.soi_ad){
soi_ad="";
}
if(!window.SIMAdWriter){
window.SIMAdWriter=new SIMAdHandler("DUMMY",null,window,0);
}

