// awstats_misc_tracker.js
//-------------------------------------------------------------------
-// You can add this file onto some of your web pages (main home page
-// can be enough) by adding the following HTML code:
-// <script language=javascript src="/js/awstats_misc_tracker.js"></script>
+// You can add this file onto some of your web pages (main home page can\r
+// be enough) by adding the following HTML code to your page body:\r
+// <script language=javascript src="/js/awstats_misc_tracker.js"></script>\r
+//\r
+// * This must be added after the <body> tag, not placed within the\r
+// <head> tags, or the resulting tracking <img> tag will not be handled\r
+// correctly by all browsers. Internet explorer will also not report\r
+// screen height and width attributes until it begins to render the\r
+// body.\r
+//\r
+
// This allows AWStats to be enhanced with some miscellanous features:
// - Screen size detection (TRKscreen)
// - Screen color depth detection (TRKcdi)
var TRKns = (navigator.appName.indexOf("Netscape") != -1);
var TRKwin = ((TRKagt.indexOf("win")!=-1) || (TRKagt.indexOf("32bit")!=-1));
var TRKmac = (TRKagt.indexOf("mac")!=-1);
+
+ // Detect the window internal width and height\r
+ if (document.documentElement && document.documentElement.clientWidth)\r
+ TRKwinsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight;\r
+ else if (document.body)\r
+ TRKwinsize = document.body.clientWidth + 'x' + document.body.clientHeight;\r
+ else\r
+ TRKwinsize = window.innerWidth + 'x' + window.innerHeight;\r
if (TRKie && TRKwin) {
var TRKshk = awstats_detectIE("SWCtl.SWCtl.1")
var TRKwma = awstats_detectNS("application/x-mplayer2")
var TRKpdf = awstats_detectNS("application/pdf");
}
- document.write('<img src="'+awstatsmisctrackerurl+'?screen='+TRKscreen+'&cdi='+TRKcdi+'&java='+TRKjava+'&shk='+TRKshk+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid+'" height=0 width=0 border=0>')
+ document.write('<img src="'+awstatsmisctrackerurl+'?screen='+TRKscreen+'&win='+TRKwinsize+'&cdi='+TRKcdi+'&java='+TRKjava+'&shk='+TRKshk+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid+'" height=0 width=0 border=0>')
}