ado.js
| 16.6 KB | Satir:
0
| js
Geri
var AdoElement=function(e){var t=this;this.loadingLib=!1,this.buff=ado.placeholder,this.tmpBuff="",this.config=e,this.onLoad=e.onLoad,this.DOMElement={},this.DOMElementBufor="",this.regs={scriptBegin:/^\s*(<script\s*)(\s*(\w+)\s*=\s*(([^\s\"\'>]{1}[^\s>]*)|\"([^\"]*)\"|\'([^\']*)\'))*[^\w>]*>/i,scriptEnd:/(<\/script\b([^>\"\']|\"[^\"]*\"|\'[^\']*\')*>)/i,attr:/(\s*(\w+)\s*=\s*(([^\s\"\'>]{1}[^\s>]*)|\"([^\"]*)\"|\'([^\']*)\'))/},this.myWrite=function(e){t.tmpBuff+=e},this.myWriteln=function(e){t.myWrite(e+"\n")},this.isMaster=function(){return this.config.master},this.isSlave=function(){return this.config.slave},this.initBuffor=function(){ado.busy=!0,window.document.open=function(){},window.document.close=function(){},document.write=t.myWrite,document.writeln=t.myWriteln},this.rewriteBuffor=function(){-1!==this.buff.indexOf(ado.placeholder)?this.buff=t.buff.replace(ado.placeholder,t.tmpBuff):this.buff=this.tmpBuff+this.buff,this.tmpBuff=""},this.preDispatch=function(){"object"==typeof this.config&&this.config.id&&this.config.server&&"http"===ado.protocol.substr(0,4)&&(this.getDOMElement(),this.emptyDOMElement(),this.DOMElementBufor="",this.isSlave()||(this.config.preview?this.config.url=this.config.server:this.makeUrl()),this.appendRedirUrl(),"old"!==ado.mode&&ado.isBrowserSupport()?(this.initBuffor(),this.appendScript(this.config.url,null,!0)):(document.write("<script type='text/javascript' src='"+t.config.url+"'><\/script>"),"function"==typeof e.onLoad&&(e.onLoad=!1)))},this.postDispatch=function(){this.flushDOMBufor(),ado.busy=!1,ado.start()},this.dispatch=function(){this.deleteComment();var e=[],t=this;if(this.regs.scriptBegin.test(this.buff)&&this.regs.scriptBegin.test(this.buff)){e=this.regs.scriptBegin.exec(t.buff);var i=this.processAttributes(e[0]);i.src?this.processSrcScript(e,i.src,i.charset):"VBScript"!==i.language&&"text/vbscript"!=i.type?this.processInlineScript(e):this.processVBScript(e)}else{if(!this.regs.scriptBegin.test(this.buff))if(e=/<script/i.exec(this.buff)){var o=t.buff.indexOf(e[0]);t.DOMElement=ado.getById(t.config.id),t.DOMElement&&t.addToDOMElement(this.buff.substr(0,o).replace(ado.placeholder,"")),this.buff=this.buff.substr(o),this.dispatch()}else t.DOMElement&&(t.addToDOMElement(t.buff.replace(ado.placeholder,"")),t.buff=""),"function"==typeof t.config.onLoad&&(t.onLoad(),t.onLoad=!1),t.postDispatch()}},this.deleteComment=function(){for(var e=/\<!\s*--(.*?)(--\s*\>)/m;e.test(t.buff);)t.buff=t.buff.replace(e,"")},this.processVBScript=function(e){var i=this.regs.scriptEnd.exec(t.buff);td_flashinstalled=2,td_browserFlashversion=8,this.buff=ado.placeholder+this.buff.substr(i.index+i[0].length),t.dispatch()},this.processSrcScript=function(e,i,o){this.buff=t.buff.substr(e[0].length);var n=this.regs.scriptEnd.exec(t.buff);this.buff=ado.placeholder+this.buff.substr(n.index+n[0].length),this.appendScript(i,o)},this.appendScript=function(e,i,o,n){this.loadingLib=!0,ado.loadScript(e,function(e){t.loadingLib=!1,"function"==typeof n&&n(),t.rewriteBuffor(),t.dispatch()},i)},this.onServerEmission=function(){var e=function(){"function"==typeof t.config.onServerEmissionEmpty&&t.config.onServerEmissionEmpty()};if("object"==typeof adserver_emissions2){var i=0;for(var o in adserver_emissions2)"function"!=typeof adserver_emissions2[o]&&i++;i>ado.adserverEmissions?(ado.adserverEmissions++,"function"==typeof t.config.onServerEmission&&t.config.onServerEmission()):e()}else e()},this.processInlineScript=function(e){if(!t.loadingLib){this.buff=this.buff.substr(e[0].length);var i=this.regs.scriptEnd.exec(t.buff),o=this.buff.substr(0,i.index);this.buff=ado.placeholder+this.buff.substr(i.index+i[0].length),o=(o=(o=(o=(o=(o=(o=(o=(o=o.replace("/*<![CDATA[*/","")).replace("<![CDATA[","")).replace("/* <![CDATA[ */","")).replace("/* ]]> */","")).replace("/*]]>*/","")).replace("\x3c!--","")).replace("//--\x3e","")).replace("//]]>--\x3e","")).replace(/\/\*.*\*\//g,"");try{ado.evaluate(o)}catch(e){}this.rewriteBuffor(),this.dispatch()}},this.processAttributes=function(e){for(var i={};e.length>0;){var o=t.regs.attr.exec(e);if(!o)break;e=e.substr(o.index+o[1].length);var n=null;o[4]&&(n=o[4]),o[5]&&(n=o[5]),o[6]&&(n=o[6]),i[o[2].toLowerCase()]=n}return i},this.getDOMElement=function(){this.DOMElement=ado.getById(this.config.id),this.DOMElement},this.emptyDOMElement=function(){this.DOMElement&&(this.DOMElement.innerHTML="",this.DOMElement.style.display="none")},this.flushDOMBufor=function(){this.insertToDOMElement(this.DOMElementBufor),this.DOMElementBufor=""},this.addToDOMElement=function(e){this.DOMElementBufor+=e},this.insertToDOMElement=function(e){this.DOMElement&&""!==e&&(this.DOMElement.style.display="block",this.DOMElement.innerHTML=e)},this.makeUrl=function(){this.config.preview&&(this.config.server=this.config.emiter);var e=this.config.contentType;switch(e){case"txt":case"xml":case"js":break;default:e="js"}this.config.url=ado.protocol+"//"+this.config.server,this.config.url+="/_"+(new Date).getTime()+"/ad."+e+"?id="+ado.trimAdoPrefix(this.config.orgId)+"/x="+screen.width+"/y="+screen.height,this.config.url+=ado.makeKeywords(this.config.keys)+ado.makeVars(this.config.vars),this.config.url+=ado.makeCluster(this.config.clusters)+ado.makeFlash()},this.appendRedirUrl=function(){this.config.redir&&""!==this.config.redir&&"<%%REDIR%%>"!=this.config.redir&&(this.config.url=this.config.url+"/redir="+this.config.redir)}},AdoContainer=function(){var that=this,userAgent=navigator.userAgent.toLowerCase(),tuneId=function(e){e.orgId=e.id,e.id=e.id+""+ado.iterator++;var t=ado.getById(e.orgId);return t&&(t.id=e.id),e},keywordEncode=function(e){var t="",i=0,o="";if(e){for(i=0;i<e.length;i++)t+=(o=e.charCodeAt(i))<128?e.charAt(i):o>=128&&o<=2047?String.fromCharCode(o>>6&31|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128);return escape(t).replace(/\//g,"%2F").replace(/\@/g,"%40").replace(/\*/g,"%2A").replace(/\+/g,"%2B").replace(/\%/g,"$")}};this.elems=[],this.urlsMapping=[],this.masterSlaves=[],this.queue=[],this.iterator=0,this.busy=!1,this.placeholder="__MARKER__",this.mode="old",this.characterEncoding=!0,this.xml=!1,this.previewUrl="",this.previewEnabled=[],this.tmp=[],this.adserverEmissions=0,this.windowLoad=!1,this.protocol="",this.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)},this.config=function(e){this.mode=e.mode,this.xml=e.xml,this.characterEncoding=e.characterEncoding,e.protocol?this.protocol=e.protocol:this.protocol=location.protocol},this.resolvId=function(e,t){for(var i in ado.elems){var o=ado.elems[i].config;if(o)if(t){if(o.orgId===e||o.orgId==="ado-"+e)return i}else if((o.orgId===e||o.orgId==="ado-"+e)&&!1===ado.elems[i].begin)return i}return!1},this.addAdoPrefix=function(e){return 46===e.id.length&&(e.id="ado-"+e.id),e},this.trimAdoPrefix=function(e){return 46==e.length?e:0===e.indexOf("ado-")?e.substring(4,50):e},this.beginCreative=function(e){var t=this.elems[ado.resolvId(e.id,!0)];return t&&t.onServerEmission(),t},this.beginExternal=function(){},this.endExternal=function(){},this.refresh=function(e){var t=ado.elems[ado.resolvId(e,!0)];if(t.isMaster()){ado.master(t.config),this.masterSlaves[t.config.orgId]=[];for(var i in ado.elems)if("object"==typeof ado.elems[i]&&ado.elems[i].config.slave&&ado.elems[i].config.myMaster===t.config.orgId){var o=ado.elems[i].config;ado.elems[i].emptyDOMElement(),ado.slave(o.orgId,o)}}else ado.placement(t.config),ado.start()},this.placement=function(e){if(e.id&&e.server){e.orgId||(e=tuneId(e));"new"==ado.mode&&!ado.windowLoad&&this.isBrowserSupport();"new"==ado.mode&&!ado.windowLoad&&this.isBrowserSupport()||ado.busy?ado.queue.unshift(function(){ado.placement(e)}):(ado.previewEnabled["http://"+e.server]&&(e.preview=!0,e.server=ado.previewUrl+"?id="+ado.trimAdoPrefix(e.orgId)),this.elems[e.id]=new AdoElement(e),ado.elems[e.id].DOMElement&&this.elems[e.id].preDispatch())}},this.master=function(e){e.master=!0,"new"==ado.mode&&!ado.windowLoad&&this.isBrowserSupport()||ado.busy?ado.queue.unshift(function(){ado.master(e)}):(e.orgId||(e=tuneId(e)),void 0===this.masterSlaves[e.orgId]&&(this.masterSlaves[e.orgId]=[]),this.elems[e.id]=new AdoElement(e),ado.previewEnabled["http://"+e.server]&&(e.preview=!0,e.server=ado.previewUrl+"?id="+ado.trimAdoPrefix(e.orgId)),this.elems[e.id].preDispatch())},this.slave=function(e,t){e&&"string"==typeof e&&""!==e&&t&&t.myMaster&&(t.id||(t.id=e),t.slave=!0,"new"==ado.mode&&!ado.windowLoad&&this.isBrowserSupport()||ado.busy?ado.queue.unshift(function(){ado.slave(e,t)}):("object"!=typeof this.masterSlaves[t.myMaster]&&(this.masterSlaves[t.myMaster]=[]),this.masterSlaves[t.myMaster].push(e),t.orgId||(t=tuneId(t)),this.elems[t.id]=new AdoElement(t),this.elems[t.id].getDOMElement(),this.elems[t.id].emptyDOMElement(),"old"!==ado.mode&&this.isBrowserSupport()?this.slaveStart(t):(document.write("<script type='text/javascript'>if(typeof "+t.orgId+"=='function'){"+t.orgId+"();}<\/script>"),"function"==typeof t.onLoad&&(t.onLoad(),t.onLoad=!1))))},this.slaveStart=function(config){eval(config.orgId),this.elems[config.id].buff='<script type="text/javascript">if(typeof '+config.orgId+"=='function'){"+config.orgId+"();}<\/script>",this.elems[config.id].begin=!1,this.elems[config.id].initBuffor(),this.elems[config.id].dispatch()},this.preview=function(e){!1!==e.enabled&&(e.server=e.emiter,!0!==e.preview&&(e.url=ado.protocol+"//"+e.server+"/_"+(new Date).getTime()+"/ad.js?id="+e.id),e.orgId||(e=tuneId(e)),"new"!=ado.mode||ado.windowLoad||!ado.isBrowserSupport()?"old"==ado.mode?document.write('<script src="'+e.url+'"><\/script>'):(this.elems[e.id]=new AdoElement(e),this.elems[e.id].preDispatch()):ado.queue.unshift(function(){ado.preview(e)}))},this.turnOnPreview=function(){for(var e in ado.tmp)"function"!=typeof ado.previewEnabled[ado.tmp[e]]&&(ado.previewEnabled[ado.tmp[e]]=!0);ado.tmp=[]},this.turnOffPreview=function(){for(var e in ado.previewEnabled)"function"!=typeof ado.previewEnabled[e]&&(ado.previewEnabled[e]&&ado.tmp.push(e),ado.previewEnabled[e]=!1)},this.getByTag=function(e,t){return t||(t=0),ado.getAllByTag(e)[t]},this.getAllByTag=function(e){var t=[];return document.all?t=document.all.tags(e):document.getElementsByTagName?t=document.getElementsByTagName(e):document.layers&&(t=document.layers[e]),t},this.bind=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent?e.attachEvent("on"+t,i):document.getElementById},this.isBrowserSupport=function(){return!!(document.createElement&&document.appendChild&&document.getElementById)},this.evaluate=function(code){if(window.execScript)return window.execScript(code),null;var result=globalScope.eval?globalScope.eval(code):eval(code);return result},this.loadScript=function(e,t,i){var o=!1,n=document.createElement("script"),r=e.indexOf("javascript:");if(-1!==e.indexOf("javascript:")){var s=e.substr(r);return ado.evaluate(s),void t(this)}var a=function(){o||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(o=!0,t(this))};ado.browser.msie?n.onreadystatechange=a:n.onload=a,n.src=e,void 0!==i&&null!==i&&(n.charset=i),ado.browser.msie&&ado.loadingPreviewSettings?ado.onDOMReady(function(){ado.head.appendChild(n)}):(ado.busy&&-1!=n.src.indexOf("redot.js")&&(ado.browser.msie?n.onreadystatechange=function(){}:n.onload=function(){},setTimeout(function(){a()},1)),ado.head.appendChild(n))},this.makeKeywords=function(e){"string"==typeof e&&(e=e.split(","));var t="";if("object"==typeof e&&e.length>0){for(var i in e)"string"==typeof e[i]&&(ado.characterEncoding?t+=","+keywordEncode(e[i].toLowerCase()):t+=","+e[i].toLowerCase());t="/key="+t.slice(1)}return t=function(e){return"string"==typeof na_prof&&(""===e?e="/key=":e+=",",e+=na_prof),e}(t)},this.makeVars=function(e){var t="";if("object"==typeof e)for(var i in e)"string"!=typeof e[i]&&"number"!=typeof e[i]||(t+="/"+i+"="+e[i]);else if("string"==typeof e){for("&"!==e.charAt(0)&&(e="&"+e),"&"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1)),e=e.replace("&","/");-1!==e.indexOf("&");)e=e.replace("&","/");t=e}return t},this.makeCluster=function(e){var t=this;if(this.a={1:"1000000000000000000",2:"2000000000000000000",3:"4000000000000000000",4:"8000000000000000000",5:"6100000000000000000",6:"2300000000000000000",7:"4600000000000000000",8:"8210000000000000000",9:"6520000000000000000",10:"2150000000000000000",11:"4201000000000000000",12:"8402000000000000000",13:"6904000000000000000",14:"2918000000000000000",15:"4836100000000000000",16:"8672300000000000000",17:"6355600000000000000",18:"2701310000000000000",19:"4412620000000000000",20:"8824250000000000000",21:"6758401000000000000",22:"2517902000000000000",23:"4034914000000000000",24:"8068838000000000000",25:"6127776100000000000",26:"2344553300000000000",27:"4688017600000000000",28:"8277124310000000000",29:"6545348620000000000",30:"2190786350000000000",31:"4281473701000000000",32:"8463847412000000000",33:"6927694924000000000",34:"2954399858000000000",35:"4819689717100000000",36:"8638379534300000000",37:"6376749178600000000",38:"2743598347310000000",39:"4496097784720000000",40:"8883185579450000000",41:"6777261159901000000",42:"2555523209912000000",43:"4011156408934000000",44:"8022203906978000000",45:"6144406812957100000",46:"2388802734815300000",47:"4667714478630700000",48:"8235538847370410000",49:"6560176794741820000",50:"2131243599492650000",51:"4262486099985211000",52:"8425863189971522000",53:"6940737269953054000",54:"2990474529917009000",55:"4891849058934108100",56:"8693698107978206300",57:"6397297304957502700",58:"2785585708815114410",59:"4471171516730328820",60:"8843243032570646750",61:"6796486064051292511",62:"2593963129003485032",63:"4097837248106861164"},this.c="",this.res=function(e,o){var n=[],r=[];for(i in o)o.hasOwnProperty(i)&&(o[i]<0?r.push(-o[i]):n.push(o[i]));return"/ADD_"+e+"="+t.conv(n)+"/REM_"+e+"="+t.conv(r)},this.conv=function(e){r=new t.wy;for(i in e)e.hasOwnProperty(i)&&t.a[e[i]]&&r.add(t.a[e[i]]);return r.get()},this.wy=function(){var e=this;this.value="0000000000000000000",this.add=function(t){var i=!1,o="";for(x=0;x<t.length;x++){var n=parseInt(t.charAt(x))+parseInt(e.value.charAt(x));i&&(n++,i=!1),2==(n=""+n).length&&(i=!0,n=n.charAt(1)),o+=n}e.value=o},this.get=function(){var t="";for(i=e.value.length-1;i>=0;i--)t+=e.value.charAt(i);return wyn=/0*([1-9][0-9]*)/.exec(t),wyn?wyn[1]:"0"}},"object"==typeof e)for(b in e)e.hasOwnProperty(b)&&(this.c+=this.res(b,e[b]));return this.c},this.makeFlash=function(){var fv="-",fo=null;return eval('try { f=(d==top.document)?1:2; if (typeof top.document.referrer=="string") { ref=top.document.referrer } } catch(e) {f=3;}'),eval('try { fv=navigator.plugins["Shockwave Flash"].description; } catch (e) {}'),eval('if (typeof ActiveXObject!="undefined") { try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch(e) { try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); fv="X"; fo.AllowScriptAccess="always"; } catch(e) { if (fv=="X") { fv="WIN 6,0,20,0"; }} try { fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e) {} } if ((fv=="-" || fv=="X") && fo) { fv=fo.GetVariable("$version"); }}'),"/fv="+escape(fv)},this.getById=function(e){return document.getElementById(e)},this.onDOMReady=function(e){var t=function(){var e=ado.getAllByTag("style"),t=ado.getAllByTag("link"),i=0;for(var o in t)"stylesheet"===t[o].rel&&i++;return e.length+i};!function(){if(document.addEventListener&&!ado.browser.opera)return document.addEventListener("DOMContentLoaded",e,!1),void(ado.windowLoad=!0);if(ado.browser.msie&&window==top)!function(){if(!ado.windowLoad){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,1)}e(),ado.windowLoad=!0}}();else if(ado.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(!ado.windowLoad){for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].disabled)return void setTimeout(arguments.callee,0);e(),ado.windowLoad=!0}},!1);else{if(!ado.browser.safari)return window.onload=e,void(ado.windowLoad=!0);var i;!function(){ado.windowLoad||("loaded"==document.readyState||"complete"==document.readyState?(void 0===i&&(i=t()),document.styleSheets.length==i?(e(),ado.windowLoad=!0):setTimeout(arguments.callee,0)):setTimeout(arguments.callee,0))}()}}()},this.closeLivePreview=function(){window.location=ado.previewDisableUrl+"?url="+encodeURIComponent(encodeURIComponent(window.location.href))},this.start=function(){if(ado.queue.length>0){var e=ado.queue.pop();"function"==typeof e&&e()}}};if("undefined"==typeof ado){ado=new AdoContainer,void 0===ado.head&&(ado.head=ado.getByTag("head",0));var go=function(){ado.windowLoad=!0,ado.start()};window.addEventListener?window.addEventListener("load",go,!0):window.attachEvent?window.attachEvent("onload",go):document.getElementById&&(window.onload=go)}var globalScope=this;
Kaydet
Ctrl+S ile kaydet