var FlightPath_Session_ID_Key = 'FlightPath_Session_ID=';
var FlightPath_Session_ID = '';
//If Flightpath session ID cookie not found - create one and set it...
if (document.cookie.indexOf(FlightPath_Session_ID_Key)==-1) 
       {
              var FP_SessionIDChars = "1234567890abcdefghiklmnopqrstuvwxyz";
              var FP_SessionID_Len = 20;
              var FP_SessionID_Build = ''
              var password = '';
              for (var i=0; i<FP_SessionID_Len; i++)
                     {
                           var FP_SessionID_Rnd = Math.floor(Math.random() * FP_SessionIDChars.length);
                           FP_SessionID_Build += FP_SessionIDChars.substring(FP_SessionID_Rnd,FP_SessionID_Rnd+1);    
                     }
              document.cookie = FlightPath_Session_ID_Key + FP_SessionID_Build;
       }

var FlightPath_Session_ID_StartPos = document.cookie.indexOf(FlightPath_Session_ID_Key);
//If Flightpath session ID cookie found get its value...
if (FlightPath_Session_ID_StartPos > -1)
       {
              FlightPath_Session_ID_StartPos += FlightPath_Session_ID_Key.length
              var Flightpath_Session_ID_EndPos = document.cookie.indexOf(";", FlightPath_Session_ID_StartPos);
      if (Flightpath_Session_ID_EndPos == -1) Flightpath_Session_ID_EndPos = document.cookie.length;
      FlightPath_Session_ID = unescape(document.cookie.substring(FlightPath_Session_ID_StartPos, Flightpath_Session_ID_EndPos))
       }
var BuildString = '<img width="1" height="1" src="http://www.flightpath-software.co.uk/FlightpathWS.asmx/Log';
BuildString += '?FPver=2&FPwsid=13&FPurl=' + encodeURIComponent(document.URL) + '&FPrefurl=' + encodeURIComponent(document.referrer);
BuildString += '&FPscrx=' + screen.width + '&FPscry=' + screen.height + '&FPjson=1&FPimg=0&FPSessID=' + FlightPath_Session_ID + '" />';
document.write(BuildString);
