// var _woo_settings={}; var _woo_visitor={}; var _woo_actions=[{'type':'pageview','title':document.title,'url':window.location.pathname}]; if(typeof(woo_settings) != 'undefined' && woo_settings != false){ _woo_settings=woo_settings; } if(typeof(woo_visitor) != 'undefined' && woo_visitor!=false){ _woo_visitor=woo_visitor; } if(typeof(woo_actions) != 'undefined' && woo_actions != false){ _woo_actions=woo_actions; } var woopraTracker=false; function WoopraScript(_src,_hook,_async){ this.src=_src; this.hook=_hook; this.async=_async; var pntr=false; this.init=function(){ pntr=this; } this.load=function(){ var script=document.createElement('script'); script.type='text/javascript'; script.src=pntr.src; script.async=pntr.async; if(pntr.hook){ script.onload=function(){ setTimeout(function(){pntr.hook.apply();},400); } script.onreadystatechange = function() { if (this.readyState == 'complete'|| this.readyState=='loaded') { setTimeout(pntr.hook,400); } } } var ssc = document.getElementsByTagName('script')[0]; ssc.parentNode.insertBefore(script, ssc); } this.init(); } function WoopraEvent(_name, options){ this.name=_name || 'unknown'; this.options = options || {}; this.mod=0; this.addProperty=function(key,value){ this.options[key] = value; } this.fire=function(){ var t=woopraTracker; var buffer=''; this.addProperty('name',this.name); for (var key in this.options) { var item = this.options[key]; if (typeof item == 'string') { // String buffer+= "&" + encodeURIComponent('ce_'+key)+'='+encodeURIComponent(this.options[key]); } else if (item instanceof Array) { // Array for (var i=0; i0){ var expires = new Date(); expires.setDate(expires.getDate() + days); exp = expires.toGMTString(); } cookieval = k + '=' + v + '; ' + 'expires=' + exp + ';' + 'path=/'+';domain=.'+pntr.site(); document.cookie = cookieval; } this.request=function(url,hook){ var script=new WoopraScript(url,hook,true); script.load(); } this.verify=function(){ } this.rescue=function(){ } this.meta=function(){ var meta=''; if(pntr.readcookie('wooMeta')){ meta=pntr.readcookie('wooMeta'); } return meta; } var pvTracked=0; this.trackPageview=function(action){ pvTracked++; var date=new Date(); var req=new Object(); req.cookie=pntr.readcookie('wooTracker'); req.vid=pntr.vid(); req.meta=pntr.meta(); req.alias=pntr.site(); req.language=pntr.langinfo(); req.page=action.url; req.pagetitle=action.title; req.referer=document.referrer; req.screen=pntr.screeninfo(); req.localtime=date.getHours()+':'+date.getMinutes(); for (var ite in action) { if(ite=='url' || ite=='title' || ite=='type'){ }else{ req['ce_'+ite]=action[ite]; } } for (var ite in _woo_visitor){ req['cv_'+ite]=_woo_visitor[ite]; } var url=''; for (var ite in req){ url+="&"+encodeURIComponent(ite)+"="+encodeURIComponent(req[ite]); } if(pvTracked>1){ url+="&mode=nil"; } var _mod = ((document.location.protocol=="https:")?'/woopras/visit.jsp?':'/visit/'); pntr.request(wx_engine + _mod +'ra='+pntr.randomstring()+url); } this.pingServer=function(){ var _mod = ((document.location.protocol=="https:")?'/woopras/ping.jsp?':'/ping/'); var _url = wx_engine + _mod; _url+='vid='+pntr.vid(); _url+='&'; _url+='cookie='+pntr.readcookie('wooTracker'); _url+='&'; _url+='alias='+pntr.site(); _url+='&'; _url+='idle='+parseInt(idle/1000); if(vs==2){ _url+='&vs=w'; vs=0; }else{ if(idle==0){ _url+='&vs=r'; }else{ _url+='&vs=i'; } } _url+='&ra='+pntr.randomstring(); pntr.request(_url); } this.typed=function(e){ vs=2; } this.clicked=function(e) { pntr.moved(); var cElem = (e.srcElement) ? e.srcElement : e.target; while (typeof cElem != 'undefined' && cElem != null) { if (cElem.tagName == "A") { break; } cElem = cElem.parentNode; } if(typeof cElem != 'undefined' && cElem != null){ var link=cElem; var _download = link.pathname.match(/(?:doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\&)/); var ev=false; if(_download && (link.href.toString().indexOf('woopra-ns.com')<0)){ ev=new WoopraEvent('download',{}); ev.addProperty('url',link.href); ev.fire(); pntr.sleep(100); } if (!_download&&link.hostname != location.host && link.hostname.indexOf('javascript')==-1 && link.hostname!=''){ ev=new WoopraEvent('exit',{}); ev.addProperty('url',link.href); ev.fire(); pntr.sleep(400); } } } var last_activity=new Date(); var idle=0; this.moved=function(){ last_activity=new Date(); idle=0; } this.ping=function(){ var timeout=4*60*1000; if(_woo_settings['idle_timeout']){ timeout=parseInt(_woo_settings['idle_timeout']); } if(idle>timeout){ return; } pntr.pingServer(); var now=new Date(); if(now-last_activity>10000){ idle=now-last_activity; } } this.loadScript=function(src,hook){ pntr.request(src,hook); } this.pushEvent=function(ev){ var ce=new WoopraEvent(ev.name,ev); ce.fire(); } } woopraTracker=new WoopraTracker(); woopraTracker.initialize(); if (typeof woopraReady == 'undefined' || woopraReady(woopraTracker) != false) { var wx=0; for(wx=0;wx<_woo_actions.length;wx++){ var action=_woo_actions[wx]; if(action.type=='pageview'){ woopraTracker.trackPageview(action); } if(action.type=='event'){ woopraTracker.pushEvent(action); } } }