function readCookie(d){var b=""+document.cookie;var a=b.indexOf(d);if(a==-1||d==""){return""}var c=b.indexOf(";",a);if(c==-1){c=b.length}return unescape(b.substring(a+d.length+1,c))}function setCookieOnce(d,c,b){if(readCookie(d)==""){var a=new Date();a.setDate(a.getDate()+b);document.cookie=d+"="+c+"; expires="+a.toGMTString()}}var piwikTracker;function runPiwik(){var e=0;function b(){try{var i=(document.location.hostname).split(".");var g="*."+i[i.length-2]+"."+i[i.length-1];var h=0;switch(g){case"*.knuddels.de":h=1;break;case"*.knuddels.com":h=2;break}piwikTracker=Piwik.getTracker(d+"piwik.php",h);piwikTracker.setDocumentTitle(document.domain+"/"+document.title);piwikTracker.setCookieDomain(g);piwikTracker.setDomains(g);piwikTracker.trackPageView();piwikTracker.enableLinkTracking();window.setTimeout(function(){sendGoal(Goals.Stay10)},10000);window.setTimeout(function(){sendGoal(Goals.Stay30)},30000);window.setTimeout(function(){sendGoal(Goals.Stay60)},60000)}catch(f){e++;if(e<10){window.setTimeout(b,500)}else{if(e==10){touchUrl("http://logging.knuddels.de/piwikerror.gif?href="+document.location.href)}}}}var d="http://track.knuddels.de:8080/piwik/";var c=document.createElement("script");c.setAttribute("src",d+"piwik.js");c.setAttribute("type","text/javascript");if(c.attachEvent){b()}else{c.onload=b}var a=document.getElementsByTagName("body")[0];a.appendChild(c)}var sentGoals={};var goalQueue=[];var lastGoalSent=0;var millisToNextGoal=2000;function sendGoal(a){if(piwikTracker&&!sentGoals[a]){if(a!=Goals.NoGoal){goalQueue.push(a)}if((new Date()).getTime()>lastGoalSent+millisToNextGoal&&goalQueue.length!=0){a=goalQueue.shift();piwikTracker.trackGoal(a);sentGoals[a]=1;lastGoalSent=(new Date()).getTime()}if(goalQueue.length!=0){window.setTimeout(function(){sendGoal(Goals.NoGoal)},millisToNextGoal)}}}var Goals={NoGoal:-1,NicknameValid:2,PasswordValid:3,AgeValid:4,GenderValid:5,EmailValid:11,ShowCapture:6,Registered:7,Stay10:8,Stay30:9,Stay60:10,StartedRegistration:12,StartedNick:13};(window.onload=function(){var e="ktrpx";var a=readCookie(e);if(a.length!=0){var c="";var b=document.referrer;if(b!=null&&b.indexOf("google")){var d=b.split("&q=");if(d.length>1){c=d[1].split("&")[0];if(c.length!=0){c="&q="+c}}}touchUrl("http://logging.knuddels.de/track.gif?track="+a+c+"&loc="+document.location.href+"&ref="+b);runPiwik()}});function touchUrl(c){var a=document.getElementsByTagName("body")[0];var b=document.createElement("img");b.setAttribute("height","1");b.setAttribute("width","1");b.setAttribute("style","border-style: none; position: absolute; top: 1px; left: 1px;");b.setAttribute("alt","");b.setAttribute("src",c);b.onload=function(){a.removeChild(b)};a.appendChild(b)};
