var _SiteID = "XMAG";
//var _LoginUserName = GetUsernameCookie("cookiesusername");
var _LoginUserName = "";
var _CurrentURL = escape(location.href);
var _ReferURL = escape(document.referrer);
var _ScreenSize = screen.width + 'x' + screen.height;
//var _UserAction = GetActionCookie("action");
var _UserAction = "";


function GetAction()
{
	var obj = window.event.srcElement;
	if(obj.name)
	{
		var action = obj.name;
		if(action.indexOf("submit_") > -1)
		{
			var cookieName = "action";
			var cookieValue = "";
			if(obj.name.lastIndexOf("_") == action.indexOf("_"))
			{
			cookieValue = cookieName + "=" + obj.name.substring(7) ;
			}
			else
			{
			cookieValue = cookieName + "=" + obj.action.substring(7,obj.name.lastIndexOf("_")) ;	
			}
			document.cookie = cookieValue;
		}
	}
}

document.onclick = GetAction;



function GetActionCookie(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))
    }
  }
  document.cookie = name + "=" + "" ;
  return cookieValue;
}

function GetUsernameCookie(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;
}

var _countURL = "http://www.lajogroup.com/Analysis/counter.aspx?u="+_LoginUserName+"&c="+_CurrentURL+"&r="+_ReferURL+"&s="+_ScreenSize+"&ua="+_UserAction+"&sid="+_SiteID;

//var _countURL = "http://localhost:86/Counter/counter.aspx?u="+_LoginUserName+"&c="+_CurrentURL+"&r="+_ReferURL+"&s="+_ScreenSize+"&ua="+_UserAction+"&sid="+_SiteID;

document.write('<img src="'+_countURL+'" width="=" height="0" alt="" border=0>');

