if(typeof MTVi=="undefined"){ //* Packages *// var MTVi=function(){ return{ reporting:{}, util:{}, ads:{} }; }(); //* Methods *// MTVi.loadModule=function(name){ try{ if(name.indexOf("/")!=-1){ name=(name.indexOf(".js")==-1?name+".js":name); }else{ name=(name.indexOf(".js")==-1?this.scriptpath+name+".js":this.scriptpath+name); } if(typeof document.createElement!="undefined"){ var h=document.getElementsByTagName('head').item(0); var s=document.createElement('script'); s.setAttribute("type","text/javascript"); s.setAttribute("src",name); s.setAttribute("defer", true); h.appendChild(s); this.loaded.push(name); }else{ document.write("<" + "/" + "scr" + "ipt>"); this.loaded.push(name); } }catch(e){} } MTVi.loadModules=function(){ try{ for(var i=0; i"; }catch(e){} } MTVi.addOnloadEvent=function(func){ try{ if(window.attachEvent){window.attachEvent("onload",func);} if(window.addEventListener){window.addEventListener("load",func,false);} return this; }catch(e){} } MTVi.init=function(){ try{ this.version="1.0"; this.scriptname="mtvi.js"; this.sectionSetup={}; this.modules=[]; this.loaded=[]; /* check compatibility for older browsers array and add module if necessary */ if(typeof Array.prototype.push=="undefined"){this.modules[this.modules.length]="Compat";} this.scripts=document.getElementsByTagName("script"); for(var i=0;i0)? this.getSectionArray().pop():"";//strip off the page name tempPageName=(tempPageName.indexOf(".")!=-1)? tempPageName.substring(0,tempPageName.indexOf(".")):tempPageName; if(!MTVi.util.isDefined(tempPageName)){ tempPageName="index"; } this.setPageName(tempPageName); this.setZone(tempPageName);//asign zone value to be page name value as default } this.populateNamesValuesObj=function(a_obj,a_overwrite){//adManager.populateNamesValuesObj() method if(MTVi.util.isDefined(a_obj) && typeof(a_obj)==="object"){ if(MTVi.util.isDefined(this.getNamesValuesObj())){ if(MTVi.util.isDefined(a_overwrite) && a_overwrite===true){}//only override the default object when explicitly set else{ for(var i in this.getNamesValuesObj()){ a_obj[i]=this.getNamesValuesObj()[i]; } } } this.setNamesValuesObj(a_obj); } else{ this.setNamesValuesObj(new function(){ var names=new Array(); var values=new Array(); for(var i in top.location.search.substring(1).split("&")){ for(var j=0;j'; } else if(this.getMedia()=="adi"){ retVal+='"><\/ifr'+'ame>'; } else if(this.getMedia()=="ad"){ retVal+='"\/>'; } return retVal; } this.isOK=function(){//adObject.isOK() method (checks for allowed values in ad URL) var retVal=true; if(!MTVi.util.isDefined(this.getZone())){ if(MTVi.ads.adManager.getDebug()===true){ MTVi.debug("Error - Missing zone value in ad URL!"); } retVal=false; } if(this.isSizeOK()===false){ if(MTVi.ads.adManager.getDebug()===true){ MTVi.debug("Error - Wrong or missing size value in ad URL!"); } retVal=false; } if(this.isMediaOK()===false){ if(MTVi.ads.adManager.getDebug()===true){ MTVi.debug("Error - Wrong or missing media value in ad URL!"); } retVal=false; } if(!MTVi.util.isDefined(this.getDartSite())){ if(MTVi.ads.adManager.getDebug()===true){ MTVi.debug("Error - Missing dart site value in ad URL!"); } retVal=false; } if(this.is_pTileFlagOK()===false){ if(MTVi.ads.adManager.getDebug()===true){ MTVi.debug("Error - Wrong or missing pTile usage flag value in ad URL!"); } retVal=false; } return retVal; } this.is_pTileFlagOK=function(){//adObject.is_pTileFlagOK() method (checks for boolean pTile flag value in ad URL) var retVal=false; if(MTVi.util.isDefined(this.getPTileFlag()) && typeof(this.getPTileFlag())=="boolean"){ retVal=true; } return retVal; } this.isMediaOK=function(){//adObject.isMediaOK() method (checks for allowed media value in ad URL) var retVal=false; var okMedia=new Array("ad","adj","adx","pfadx","adi"); for(var i=0;i