function SporeTracking(d){this._address="http://trackingpic.marten-online.com/trac/tracking.gif?";this._clientID=d;this.DebugElement=null;this._prefixTime="smdt";if(!this._defined){SporeTracking.prototype._defined=true;function a(){this._customParams=new Array()}a.prototype._actualPageHash="assalt";a.prototype._clientIDName="TracDevClientID";a.prototype._sessionIDName="TracDevSessionID";a.prototype._reffererMarkerName="TracDevRefferer";a.prototype._classCode="pi";a.prototype._prefixReferrer="pirf";a.prototype._prefixActualPage="pavref";a.prototype._prefixClassCode="picc";a.prototype._prefixIsOriginal="piio";a.prototype._prefixSessionID="pisid";a.prototype._prefixClientID="picid";a.prototype._prefixPageTitle="pitit";a.prototype._prefixPageID="pavpid";a.prototype._prefixCategoryID="pavcid";a.prototype._prefixElementName="elnm";a.prototype._prefixElementID="elid";a.prototype._getRandomChars=function(g,h){g+=(new Date()).getMilliseconds().toString();var i="",e=0,f;while(e<h){f=g.charAt(Math.round(Math.random()*(g.length-1)));if(f==" "){continue}i+=f;g+=(new Date()).getMilliseconds().toString();e++}return i};a.prototype._generateID=function(){return this._getRandomChars(navigator.userAgent,15)+this._getRandomChars(location,15)};a.prototype._actualPageHashValue=a.prototype._generateID();a.prototype._getCookie=function(h){h+="=";var g="";if(document.cookie.length>0){var f=document.cookie.split(";");for(var e=0;e<f.length;e++){if(f[e].indexOf(h)>-1){g=unescape(f[e].split("=")[1]);break}}}return g};a.prototype._setCookie=function(i,h,e){var g=e?(";expires="+(new Date((new Date).getTime()+e*1000*60*60*24)).toGMTString()):"";var f=i+"="+escape(h)+g+";path=/";document.cookie=f};a.prototype._isOriginal=function(){if(!document.referrer||document.referrer.split("?")[0].indexOf(document.location.hostname,0)>-1||document.location==this._getReferrerMarker()){return 0}this._setReferrerMarker(document.location);return 1};a.prototype._getClientID=function(){var e=this._getCookie(this._clientIDName);if(!e){e=this._generateID();this._setCookie(this._clientIDName,e,360)}return e};a.prototype._getSessionID=function(){var e=this._getCookie(this._sessionIDName);if(!e){e=this._generateID();this._setCookie(this._sessionIDName,e)}return e};a.prototype._getReferrerMarker=function(){return this._getCookie(this._reffererMarkerName)};a.prototype._setReferrerMarker=function(e){this._setCookie(this._reffererMarkerName,e)};a.prototype.serializeProp=function(f,e){return e?(f+"="+escape(e)+"&"):""};a.prototype.serializeToURL=function(){var e="";return e+this.serializeProp(this._prefixClassCode,this._classCode)+this.serializeProp(this._prefixActualPage,location)+this.serializeProp(this._prefixIsOriginal,this._isOriginal())+this.serializeProp(this._prefixReferrer,document.referrer)+this.serializeProp(this._prefixSessionID,this._getSessionID())+this.serializeProp(this._prefixClientID,this._getClientID())+this.serializeProp(this._prefixPageTitle,document.title)};function c(e,f){this._pageID=e;this._recordID=f}c.prototype=new a;c.prototype._classCode="clsPageView";c.prototype.serializeToURL=function(){return a.prototype.serializeToURL.call(this)+this.serializeProp(this._prefixPageID,this._pageID)+this.serializeProp(this._prefixCategoryID,this._recordID)};function b(f,g,h){this._elementName=f;this._elementID=g;this._element=h}b.prototype=new a;b.prototype._classCode="elemClick";b.prototype.serializeToURL=function(){return a.prototype.serializeToURL.call(this)+this.serializeProp(this._prefixElementName,this._elementName)+this.serializeProp(this._prefixElementID,this._elementID)};SporeTracking.prototype.getPageView=function(e,f){return new c(e,f)};SporeTracking.prototype.getElementClick=function(e,f){var g=new b(e,f);SporeTracking.sendInfo(g)};SporeTracking.prototype.sendInfo=function(e){var f=this._address+this._serializeProp("ver",this._version)+this._serializeProp("clid",this._clientID)+e.serializeToURL()+this._serializeProp(a.prototype._actualPageHash,a.prototype._actualPageHashValue)+this._prefixTime+"="+(new Date()).getTime();if(this.DebugElement==null){document.write("<img src='"+f+"' style='display: none' />")}else{document.getElementById(this.DebugElement).innerHTML=f}this.registerUnload();return f};SporeTracking.prototype.registerUnload=function(){var e=window.onunload;window.onunload=function(){SporeTracking.sendPing()}};SporeTracking.prototype.sendPing=function(){try{var g=this._address+this._serializeProp("ver",this._version)+this._serializeProp("clid",this._clientID)+this._serializeProp(a.prototype._prefixClassCode,"_ping_")+this._serializeProp(a.prototype._prefixSessionID,a.prototype._getSessionID())+this._serializeProp(a.prototype._prefixClientID,a.prototype._getClientID())+this._serializeProp(a.prototype._actualPageHash,a.prototype._actualPageHashValue)+this._prefixTime+"="+(new Date()).getTime();if(this.DebugElement==null){var e=new Image(1,1);e.src=g}else{document.getElementById(this.DebugElement).innerHTML=g;alert("unload")}return g}catch(f){}};SporeTracking.prototype._serializeProp=function(f,e){return e?(f+"="+escape(e)+"&"):""};SporeTracking.prototype._version="0.1"}};
