var _clickTrue={options:{login_url:'http://tools.my/clicktrue.cz/iframe.php',login_hash:null},variables:{interval:null,iframe:null,centerElement:null,offset:{top:0,left:0},initialize:false},id:0,init:function(){if(this.variables.initialize)return false;this.variables.initialize=true;if(this.variables.centerElement){this.variables.offset=this.getElementOffset(this.variables.centerElement)}this.addEvent(document,'mousedown',this.click.action,this);this.addEvent(window,'resize',this.resize,this);this.addEvent(window,'scroll',this.scroll.action,this);this.addEvent(window,'unload',this.scroll.send,this)},send:function(a,b){var c=new Image();b.id=_clickTrue.id;b.host=document.URL;c.src=_clickTrue.createParams(a,b)},resize:function(){if(this.variables.centerElement){this.variables.offset=this.getElementOffset(this.variables.centerElement)}},unload:function(){this.removeEvent(document,'mousedown',this.click.action);this.removeEvent(window,'scroll',this.scroll.action);this.removeEvent(window,'unload',this.scroll.send)},setCenterElement:function(a){var b=document.getElementById(a);if(b){this.variables.centerElement=b;return true}return false},getElementOffset:function(a){var b=0;var c=0;if(a.offsetParent){do{b+=a.offsetLeft;c+=a.offsetTop}while(a=a.offsetParent)}return{'top':c,'left':b}},getEvent:function(e){return(e?e:window.event)},createParams:function(a,b){var c=[];for(key in b){var t=typeof(b[key]);if(t=='string'||t=='number'){c.push(encodeURIComponent(key)+'='+encodeURIComponent(b[key]))}}return a+'?'+c.join('&')},addEvent:function(a,b,c,d){if(a.addEventListener){a.addEventListener(b,function(){c.apply(d,arguments)},false)}else if(a.attachEvent){a["e"+b+c]=c;a[b+c]=function(){a["e"+b+c].call(d,window.event)};a.attachEvent("on"+b,a[b+c])}},removeEvent:function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,false);else if(a.detachEvent){a.detachEvent("on"+b,a[b+c]);a[b+c]=null;a["e"+b+c]=null}}};_clickTrue.click={options:{url:'http://tools.my/clicktrue.cz/click_log.php',url:'http://click.gigacomputer.cz/click_log.php'},getMouseXY:function(e){return{'x':(e.pageX)?e.pageX:e.clientX+document.body.scrollLeft,'y':(e.pageY)?e.pageY:e.clientY+document.body.scrollTop}},action:function(e){var e=this.getEvent(e);var a=this.click.getMouseXY(e);if(this.variables.offset.left)a.x-=this.variables.offset.left;if(this.variables.offset.top)a.y-=this.variables.offset.top;this.send(this.click.options.url,a)}};_clickTrue.scroll={options:{url:'http://tools.my/clicktrue.cz/scroll_log.php',url:'http://click.gigacomputer.cz/scroll_log.php'},variables:{maxScrollXY:{top:0,left:0}},send:function(){this.send(this.scroll.options.url,this.scroll.variables.maxScrollXY)},action:function(){var a=this.scroll.getScrollXY();this.scroll.variables.maxScrollXY.top=Math.max(this.scroll.variables.maxScrollXY.top,a.top);this.scroll.variables.maxScrollXY.left=Math.max(this.scroll.variables.maxScrollXY.left,a.left);return true},getScrollXY:function(){var a=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;a=window.pageXOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;a=document.body.scrollLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;a=document.documentElement.scrollLeft}return{top:scrOfY,left:a}}};
