if (typeof(V_COUNTER) == 'undefined') { var V_COUNTER = {}; } V_COUNTER = { temparr: [], cookie_enabled: null, rpc: function(script,params) { var head = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribute('language', 'javascript'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src',script+'?'+params); head.appendChild(js); return false; }, readCookie: function(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }, createCookie: function( name, value, domain,path, expires, secure ) { var today = new Date(); today.setTime( today.getTime() ); if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); }, clean_temparr: function() { this.temparr=[]; }, serialize: function(o) { var p = 0, sb = [], ht = [], hv = 1; var classname = function(o) { if (typeof(o) == 'undefined' || typeof(o.constructor) == 'undefined') return ''; var c = o.constructor.toString(); //c = utf16to8(c.substr(0, c.indexOf('(')).replace(/(^\s*function\s*)|(\s*$)/ig, '')); return ((c == '') ? 'Object' : c); }; var is_int = function(n) { var s = n.toString(), l = s.length; if (l > 11) return false; for (var i = (s.charAt(0) == '-') ? 1 : 0; i < l; i++) { switch (s.charAt(i)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default : return false; } } return !(n < -2147483648 || n > 2147483647); }; var in_ht = function(o) { for (var k in ht) if (ht[k] === o) return k; return false; }; var ser_null = function() { sb[p++] = 'N;'; }; var ser_boolean = function(b) { sb[p++] = (b ? 'b:1;' : 'b:0;'); }; var ser_integer = function(i) { sb[p++] = 'i:' + i + ';'; }; var ser_double = function(d) { if (isNaN(d)) d = 'NAN'; else if (d == Number.POSITIVE_INFINITY) d = 'INF'; else if (d == Number.NEGATIVE_INFINITY) d = '-INF'; sb[p++] = 'd:' + d + ';'; }; var ser_string = function(s) { //var utf8 = utf16to8(s); var utf8 = s; sb[p++] = 's:' + utf8.length + ':"'; sb[p++] = utf8; sb[p++] = '";'; }; var ser_date = function(dt) { sb[p++] = 'O:4:"Date":7:{'; sb[p++] = 's:4:"year";'; ser_integer(dt.getFullYear()); sb[p++] = 's:5:"month";'; ser_integer(dt.getMonth() + 1); sb[p++] = 's:3:"day";'; ser_integer(dt.getDate()); sb[p++] = 's:4:"hour";'; ser_integer(dt.getHours()); sb[p++] = 's:6:"minute";'; ser_integer(dt.getMinutes()); sb[p++] = 's:6:"second";'; ser_integer(dt.getSeconds()); sb[p++] = 's:11:"millisecond";'; ser_integer(dt.getMilliseconds()); sb[p++] = '}'; } var ser_array = function(a) { sb[p++] = 'a:'; var lp = p; sb[p++] = 0; sb[p++] = ':{'; for (var k in a) { if (typeof(a[k]) != 'function') { is_int(k) ? ser_integer(k) : ser_string(k); __serialize(a[k]); sb[lp]++; } } sb[p++] = '}'; }; var ser_object = function(o) { var cn = classname(o); if (cn == '') ser_null(); else if (typeof(o.serialize) != 'function') { sb[p++] = 'O:' + cn.length + ':"' + cn + '":'; var lp = p; sb[p++] = 0; sb[p++] = ':{'; if (typeof(o.__sleep) == 'function') { var a = o.__sleep(); for (var kk in a) { ser_string(a[kk]); __serialize(o[a[kk]]); sb[lp]++; } } else { for (var k in o) { if (typeof(o[k]) != 'function') { ser_string(k); __serialize(o[k]); sb[lp]++; } } } sb[p++] = '}'; } else { var cs = o.serialize(); sb[p++] = 'C:' + cn.length + ':"' + cn + '":' + cs.length + ':{' +cs + '}'; } }; var ser_pointref = function(R) { sb[p++] = 'R:' + R + ';'; }; var ser_ref = function(r) { sb[p++] = 'r:' + r + ';'; }; var __serialize = function(o) { if (o == null || o.constructor == Function) { hv++; ser_null(); } else switch (o.constructor) { case Boolean: { hv++; ser_boolean(o); break; } case Number: { hv++; is_int(o) ? ser_integer(o) : ser_double(o); break; } case String: { hv++; ser_string(o); break; } case Date: { hv++; ser_date(o); } case Object: case Array: { var r = in_ht(o); if (r) { ser_pointref(r); } else { ht[hv++] = o; ser_array(o); } break; } default: { var r = in_ht(o); if (r) { hv++; ser_ref(r); } else { ht[hv++] = o; ser_object(o); } break; } } }; __serialize(o); return sb.join(''); }, sendMoves: function() { if (V_COUNTER.temparr.length > 0) { document.getElementById('position').value = V_COUNTER.serialize(V_COUNTER.temparr); document.getElementById('moves_form').submit(); V_COUNTER.clean_temparr(); } }, getMouseXY: function(e) { if (this.IE) { V_COUNTER.tempX = event.clientX + document.body.scrollLeft V_COUNTER.tempY = event.clientY + document.body.scrollTop } else { // grab the x-y pos.s if browser is NS V_COUNTER.tempX = e.pageX V_COUNTER.tempY = e.pageY } if (V_COUNTER.tempX < 0){V_COUNTER.tempX = 0} if (V_COUNTER.tempY < 0){V_COUNTER.tempY = 0} coordinate = V_COUNTER.tempX+'_'+V_COUNTER.tempY switch(e.type) { case 'mousemove': type = 1; break; case 'mousedown': type = 2; break; } V_COUNTER.add_coordinates(V_COUNTER.tempX,V_COUNTER.tempY,type); }, add_coordinates: function(x,y,type) { this.temparr.push(x+'_'+y+'_'+type); }, IE: document.all?true:false, addevent_action: function(event,func) { if (document.attachEvent) { document.attachEvent(event,func); } else { document.addEventListener(event.replace(/on/,''),func,false); } }, getHttpProtocol : function() { /* Determine protocol */ this.httpProtocol = ('https:' == document.location.protocol ? 'https://' : 'http://'); if(!this.httpProtocol) { return 'http://'; } return this.httpProtocol; }, sw: screen.width, sh: screen.height, referer: document.referrer, platform: navigator.platform, java_enabled: navigator.javaEnabled(), path_name: document.location, domain: document.domain, k: 'R1C19828W19828', requested: false, httpProtocol: '', tempX: 0, tempY: 0, coordinate: 0, init: function() { if (!V_COUNTER.requested) { V_COUNTER.requested = true; //if (!this.IE) { // document.captureEvents(Event.MOUSEMOVE) //} //V_COUNTER.addevent_action('onmousemove',this.getMouseXY); //V_COUNTER.addevent_action('onmousedown',this.getMouseXY); //V_COUNTER.createCookie('ewc_test_cookie','please accept for the counter','','/'); V_COUNTER.createCookie('ewc_test_cookie','please accept for the counter',V_COUNTER.domain.replace('www.',''),'/'); V_COUNTER.cookie_enabled = (V_COUNTER.readCookie('ewc_test_cookie'))?1:0; V_COUNTER.visit_id = V_COUNTER.readCookie('ewc_visit'); V_COUNTER.hit_id = V_COUNTER.readCookie('ewc_hit'); var counterUrl = V_COUNTER.getHttpProtocol()+'tracker.euroweb.net/counter.js'; if (V_COUNTER.visit_id==null && V_COUNTER.hit_id==null) { V_COUNTER.rpc(counterUrl,'cookie_enabled='+V_COUNTER.cookie_enabled+'&isnew=1&path_name='+escape(V_COUNTER.path_name)+'&referer='+escape(V_COUNTER.referer)+'&domain='+V_COUNTER.domain+'&k='+V_COUNTER.k+'&sw='+V_COUNTER.sw+'&sh='+V_COUNTER.sh); } else { V_COUNTER.rpc(counterUrl,'isnew=0&hit_id='+V_COUNTER.hit_id+'&visit_id='+V_COUNTER.visit_id+'&path_name='+escape(V_COUNTER.path_name)+'&referer='+escape(V_COUNTER.referer)+'&domain='+V_COUNTER.domain+'&k='+V_COUNTER.k+'&sw='+V_COUNTER.sw+'&sh='+V_COUNTER.sh); } //setInterval('V_COUNTER.sendMoves()',3000); } } } V_COUNTER.init();