google.load("visualization","1",{packages:["corechart"]});(function(){var a=jQuery;var b=false;var c=function(g,j,k,e){var g=g,j=j,d=k,m=0,h=0,l=Date.parse(e)-Date.parse(new Date());function f(n){if(b){return true}if(typeof(n.error)!="undefined"&&n.error!=""){b=true;a("#content4stats").html('
'+(n.error)+"
Please check your project settings.
");return true}return false}addCommas=function(o){o+="";x=o.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var n=/(\d+)(\d{3})/;while(n.test(x1)){x1=x1.replace(n,"$1,$2")}return x1+x2};getBrowserIconClass=function(n){if(typeof(n)=="undefined"||(typeof(n)!="object"&&typeof(n)!="string")){return""}return"browser-logo browser-"+n.toLowerCase().replace(/\s[0-9\.]+$/,"").replace(/\s/g,"-")};getOsIconClass=function(o){if(typeof(o)=="undefined"||(typeof(o)!="object"&&typeof(o)!="string")){return""}if(o.search(/^windows/i)!=-1){var n="windows"}else{if(o.search(/^macintosh/i)!=-1||o.search(/^mac os/i)!=-1){var n="macintosh"
}else{if(o.search(/^ios/i)!=-1){var n="ios"}else{if(o.search(/^linux/i)!=-1){var n="linux"}else{if(o.search(/^android/i)!=-1){var n="android"}else{var n=""}}}}}return"os-logo os-"+n.toLowerCase().replace(/\s[0-9\.]+$/,"").replace(/\s/g,"-")};parseUri=function(n){var o=document.createElement("a");o.href="http://"+n;return o};showFSDayPerfGraph=function(){var o=new Date();o.setTime(Date.parse(new Date())+l);var n=o.getDate();var q=o.getMonth()+1;var p=o.getFullYear();a.getJSON("https://www.4stats.de/api/numbers?pid="+g+"&apikey="+j+"&mon="+q+"-"+p+"&day="+n+"&jsoncallback=?",function(t){if(f(t.results)){return}chart_data=new Array(["Hour","Page Impressions","Visits"]);for(i=0;i"+p+"";a("#fs_dashboard_stats").append(o)})})};showFSDashboard=function(){a.getJSON("https://www.4stats.de/api/dashboard?pid="+g+"&apikey="+j+"&jsoncallback=?",function(q){if(f(q.results)){return}var r=["Visitors","Returning Visitors","New Visitors","Page Impressions","Ø Pages/Visit","Ø Time on Site (Min.)"];var p={Today:"today",Yesterday:"yesterday","This month":"thismonth","Last month":"lastmonth","This year":"thisyear",Total:"total"};var o={};a.each(p,function(s,t){o[s]=[q.results["visits_"+t],q.results["ret_visits_"+t],q.results["visits_"+t]-q.results["ret_visits_"+t],q.results["hits_"+t],q.results["hits_per_visit_"+t],q.results["avg_time_"+t]]
});a("#fs_overview_stats thead tr").append(" | ");a.each(r,function(s,t){a("#fs_overview_stats thead tr").append(""+t+" | ")});a.each(o,function(u,t){var s='| '+u+" | ";a.each(t,function(v,w){if(!isNaN(w)){w=addCommas(w)}s+=''+w+" | "});s+="
";a("#fs_overview_stats tbody").append(s)});if(q.results.visits_ythq.results.visits_today){var n="bad"}else{var n="noc"}}a("#fs_overview_stats tbody tr").first().children("td").eq(1).prepend(''+q.results.visits_yth_percent+"%");if(q.results.hits_ythq.results.hits_today){var n="bad"}else{var n="noc"}}a("#fs_overview_stats tbody tr").first().children("td").eq(4).prepend(''+q.results.hits_yth_percent+"%");a("#fs_overview_stats thead tr").first().children("th").first().html(""+q.results.user_online+" Online")
})};showFSGraphs=function(){showFSDayPerfGraph();var p=new Date();p.setTime(Date.parse(new Date())+l);p.setMonth(p.getMonth()-1);var n=p.getDate();var q=p.getMonth()+1;var u=p.getFullYear();var p=new Date();p.setTime(Date.parse(new Date())+l);var o=p.getDate();var t=p.getMonth()+1;var s=p.getFullYear();a.getJSON("https://www.4stats.de/api/numbers?pid="+g+"&apikey="+j+"&from="+u+"-"+q+"-"+n+"&to="+s+"-"+t+"-"+o+"&jsoncallback=?",function(y){if(f(y.results)){return}chart_data=new Array(["Hour","Page Impressions","Visits"]);for(i=0;i| '+o+" | "+p+" |
";for(i=0;i'+stat.count+" | "+stat.name+" | ";if(i>=9){break}}html+="
";a("#fs-box-row").append(html).fadeIn(300)})};showFSVisitorLog=function(){a.getJSON("https://www.4stats.de/api/visitor_log?pid="+g+"&apikey="+j+"&jsoncallback=?",function(p){if(f(p.results)){return}for(i=0;i"+stat.time+"
"+stat.hits+" Page"+((stat.hits>1)?"s":"")+"";n+=""+stat.ip+"("+stat.host+") ";n+=' '+stat.os+' '+stat.browser+" ";n+="Screen: "+stat.screen+" - GEO: "+stat.geo+" | ";
n+="";if(stat.referrer!=""){var o=parseUri(stat.referrer);n+=''+o.hostname+""}n+=" "+stat.entry+" ";if(stat.kw!=""){n+="Keyword: "+stat.kw+" | "}n+="";a("#fs-visitor-log tbody").append(n).fadeIn(300);if(i>=25){break}}})};return{statsPage:function(){showFSGraphs();showFSDashboard();showFSBoxStats("sites","Site","Views");window.setTimeout("showFSBoxStats('keywords', 'Keywords', 'Visits')",500);window.setTimeout("showFSBoxStats('referrer', 'Referrer', 'Visits')",1000);window.setTimeout("showFSBoxStats('browser', 'Browser', 'Visits')",1500);window.setTimeout("showFSBoxStats('os', 'OS', 'Visits')",2000);window.setTimeout("showFSBoxStats('screen', 'Screen', 'Visits')",2500);showFSVisitorLog()},dashBoard:function(){showFSWPDashboard()},}};window.fourStats=c})();