// LK-Design TAGS System - Version 3.0
//
// This script is used to capture all of the interesting bits of traffic
// data used for traffic analysis that we do not get in the log files.
// The data is passed to the Perl script stats2.pl which handles breaking
// up the data and formatting it to append to the data file
//
// Copyright (C) February 2009 LK-Design


// The following variables are used to switch OFF specific data that
// we do NOT want to capture.  When switched OFF they will still appear
// as fields in the stats data file but will be empty fields which will
// save space in the data file
var BgColor="No";
var Title="Yes";
var Url="Yes";
// DO NOT modify ANYTHING below here!!!


// Build the string "SS" with all of the stats data in it
// var SS="PageName="+PageName;
var SS="PageName="+window.document.URL;


// New part, get some of the cookies!
Sess = readCookie("PHPSESSID");
SS+="&Sess="+Sess;
Uname = readCookie("F-MyS-Username");
SS+="&Uname="+Uname;

var Cat="N/A";

SS+="&Cat="+Cat;
if(Title!="No")
	{    SS+="&Title="+document.title;    }
if(Title=="No")
	{    SS+="&Title=N/A";    }
if(Url!="No")
	{    SS+="&Url="+window.document.URL;    }
if(Url=="No")
	{    SS+="&Url=N/A";    }
SS+="&Ref="+window.document.referrer;
SS+="&Cookies="+(navigator.cookieEnabled?"Yes":"No");
SS+="&Lang="+(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);
SS+="&Platform="+navigator.platform;
if(BgColor!="No")
	{    SS+="&BgColor="+document.bgColor;    }
if(BgColor=="No")
	{    SS+="&BgColor=N/A";    }
SS+="&Java=Yes";

// new code added to get actual browser Window size
if (document.layers) {
   document.cookie=1;
   SS+="&ColD="+screen.pixelDepth;
   SS+="&Res="+screen.width+"x"+screen.height;
   SS+=" ("+innerWidth+"x"+innerHeight+")";
   }
else {
   SS+="&ColD="+screen.colorDepth;
   SS+="&Res="+screen.width+"x"+screen.height+"("+document.body.clientWidth+"x"+document.body.clientHeight+")";
   }

// if(typeof(screen)=="object")
// 	{
//		SS+="&Res="+screen.width+"x"+screen.height;
// 		SS+="&Res="+screen.width+"x"+screen.height+" ("+&ww+"x"+&wh+")";
//		SS+="&ColD="+screen.colorDepth;
//	}

document.write('<IMG BORDER="0" WIDTH="1" HEIGHT="1" SRC="http://www.forresters4hair.com/cgi-bin/tags.pl?'+SS+'">');


function readCookie(name)

{

  var cookieValue = "";

  var search = name + "=";

  if(document.cookie.length > 0)

  { 

    offset = document.cookie.indexOf(search);

    if (offset != -1)

    { 

      offset += search.length;

      end = document.cookie.indexOf(";", offset);

      if (end == -1) end = document.cookie.length;

      cookieValue = unescape(document.cookie.substring(offset, end))

    }

  }

  return cookieValue;

}

