// ADMOTION - Banner/Videobanner POLITE - v2r16 - 12/11/2009 new function() { function ADM_BannerPolite_Config() { with(ADM_cData) { this.swfPre = files[1].name; this.swfMain = files[2].name; this.swfWdth = files[2].width; this.swfHght = files[2].height; this.bckupName = files[3].name; this.bckupWdth = files[3].width; this.bckupHght = files[3].height; this.CodMovie = CodMovie; this.webCode = WebCode; this.clickURL = getClickUrl(ClickUrl, WebCode); this.hostADS = hostADS; // this.diferido = diferido; this.feeds = {}; for (var i=4,j=1;i"; } this.appendTo = function(node) { _str += ""; var container = node.ownerDocument.createElement("span"); node.insertBefore(container, node.firstChild); container.innerHTML = _str; return container.firstChild; } } EmbedElement = function() { var _str = " -1; var getWindowAccess = function(_window) { try { return !!_window.location.href; } catch (e) { return false; } } var getTheMostLevelWindow = function() { if (getWindowAccess(top)) return top; else if (getWindowAccess(parent.parent)) return parent.parent; else if (getWindowAccess(parent)) return parent; else return self; } var LoadEvent = new function() { var __top = ADM_CHROME ? self : getTheMostLevelWindow(); var fireLoadEvent = function() { if (__top.document.__admLoadEventHandler.loaded) return; __top.document.__admLoadEventHandler.loaded = true; for (var i=0; i<__top.document.__admLoadEventHandler.handlers.length; i++) setTimeout(__top.document.__admLoadEventHandler.handlers[i], 0); } if (!__top.document.__admLoadEventHandler) { __top.document.__admLoadEventHandler = {loaded: false, handlers: []}; ADM_aEvn(__top, "load", fireLoadEvent); //setTimeout(fireLoadEvent, 7000); } this.add = function(handler) { if (__top.document.__admLoadEventHandler.loaded) setTimeout(handler, 0); else __top.document.__admLoadEventHandler.handlers.push(handler); } } var Timer = function() { var _sec, _tot = 0, _status = false, _startTimes = 0; this.reset = function() { _tot = 0; _sec = (new Date).getTime(); } this.getElapsedTime = function() { return _status ? _tot + ((new Date).getTime() - _sec) : _tot; } this.start = function() { _startTimes++; if(!_status) { _sec = (new Date).getTime(); _status = true; } } var stop = this.stop = function() { _startTimes--; if(_startTimes==0) { if (_status) { _tot += (new Date).getTime() - _sec; _status = false; } } } } var Interactor = function(){ var _interacting = false; var _timeout; var _this = this; var setAutoResetInteracting = function() { if (!_timeout) { if(_interacting==0 && _this.oninteractionbegin) _this.oninteractionbegin(); } else clearTimeout(_timeout); _timeout = setTimeout(function() { if(_interacting==0 && _this.oninteractionend) _this.oninteractionend(); _timeout = null; }, 1000);//1sec. } this.addElement = function(elem){ if(elem.attachEvent) elem.attachEvent("onmousemove", setAutoResetInteracting); else if (elem.addEventListener) elem.addEventListener("mousemove", setAutoResetInteracting, true); else elem.onmousemove = setAutoResetInteracting; } this.setInteracting = function(){ _interacting++; if(_interacting==1) { if (!_timeout && _this.oninteractionbegin) _this.oninteractionbegin(); } } this.resetInteracting = function(){ _interacting--; if(_interacting <= 0) { if(!_timeout && _this.oninteractionend) _this.oninteractionend(); } } } var Position = function(id){ //var _nodeId = "ADM_ID_NODE_" + ADM_ID; document.write("
"); document.close(); var pnode=ADM_DE("ADM_node"+id).parentNode; this.getNode = function(){ var node = document.getElementById("ADM_node"+id); return node || pnode; } this.clear = function(elemid) { // var node = document.getElementById("ADM_node"+id); // node.innerHTML = ""; var flash = document.getElementById(elemid); if(flash) flash.parentNode.removeChild(flash); } } new function() { var admBasic=new BasicMethods(ADM_BannerPolite_Config); var oPreload=new preloadPack(ADM_CHROME); var ADM_data=admBasic.getData(); if (ADM_data.urlAudit)admBasic.admPing(admBasic.addRnd(ADM_data.urlAudit)); var ADM_ID=admBasic.uniqueID(); var pos = new Position(ADM_ID); var preFlashId = "admPreload_"+ADM_ID; var mainFlashId = "admMain_"+ADM_ID; var ADM_Flash, ADM_FlashMain, FSCommandFunc; var timer = new Timer(); var createBackup = function(node, id, src, click) { var img=new Image; with(img.style) { width=ADM_data.bckupWdth+'px'; height=ADM_data.bckupHght+'px'; cursor="pointer"; } img.id = id; img.src=admBasic.getFilePath(src); img.onclick=function(){admTracking();window.open(ADM_data.clickURL);} node.insertBefore(img, node.firstChild); return img; } var admTracking = new function(){ var _pinger = document.createElement('iframe'); _pinger.style.display = 'none'; document.body.insertBefore(_pinger, document.body.firstChild); var _data = typeof ADM_data=='undefined' ? admData : ADM_data; return function(){ if(_data.clicktracking) _pinger.src = _data.clicktracking; } } var initFlashMode = function() { if (BasicMethods.isImg(ADM_data.swfPre)) ADM_Flash = createBackup(pos.getNode(), preFlashId, ADM_data.swfPre, ADM_data.clickURL); else ADM_Flash = ADM_CreateFlash(pos.getNode(), admBasic.getFilePath(ADM_data.swfPre),ADM_data.swfWdth,ADM_data.swfHght,preFlashId,admBasic.getFlshVars(ADM_data.swfPre)); var _nums=[],_calls=[]; var findNum=function(n){ n=parseInt(n); for(var i=0;i<_nums.length;i++) if(_nums[i]==n) return true; _nums.push(n); return false; } var POI=function(num) { if(findNum(num))return; _calls.push(new Image); _calls[_calls.length-1].src="http://nspmotion.com/poi_full.aspx?m="+ADM_data.CodMovie+"&p="+num+"&rnd="+Math.round(Math.random()*99999999); } var interactor = new Interactor(); interactor.oninteractionbegin = function(){ timer.start(); } interactor.oninteractionend = function(){ timer.stop(); } interactor.addElement(ADM_Flash); FSCommandFunc=function() { switch (arguments[0]) { case 'click': admTracking(); break; case "CallPOI": POI(arguments[1]); break; case "interactionresume": interactor.setInteracting(); break; case "interactionstop": interactor.resetInteracting(); break; } } var changeFlash = function() { ADM_FlashMain=ADM_CreateFlash(pos.getNode(), admBasic.getFilePath(ADM_data.swfMain),1,1,mainFlashId,admBasic.getFlshVars(ADM_data.swfMain), 0, 0); if (ADM_MSIE) ADM_FlashMain.attachEvent('FSCommand',FSCommandFunc); else window[mainFlashId+'_DoFSCommand']=FSCommandFunc; interactor.addElement(ADM_FlashMain); oPreload.checkFlashLoad(ADM_FlashMain,function(){ ADM_FlashMain.style.position='static'; ADM_FlashMain.style.visibility='visible'; ADM_FlashMain.style.width=ADM_data.swfWdth+'px'; ADM_FlashMain.style.height=ADM_data.swfHght+'px'; pos.clear(preFlashId); }); } if(ADM_data.fixOperationAborted && ADM_MSIE) setTimeout(changeFlash, 1000); else LoadEvent.add(changeFlash); } if (admBasic.flashVer()>=ADM_data.flashMinVer) { if(ADM_data.fixOperationAborted && ADM_MSIE) LoadEvent.add(initFlashMode); else initFlashMode(); } else createBackup(pos.getNode(), "admBackup", ADM_data.bckupName, ADM_data.clickURL); var probability=function(percentage){ var prob = Math.round(Math.random() * 100); return prob <= percentage; } if (probability(6)) { var _timer = new Timer(); _timer.start(); var img = new Image(); ADM_aEvn(window,"unload",function(){ img.src="http://nspmotion.com/adm_tc.aspx?m="+ADM_data.CodMovie+"&t="+parseInt(_timer.getElapsedTime()/1000)+"&it="+parseInt(timer.getElapsedTime()/1000); }); } } }