//Tracker Class

// Modification of this code is not allowed and will permanently disable your account!
// SiteName:  Johnson Inc.

function Tracker(featureID) {
    this._featureID = featureID;
}

//Note You can set the global value here instead of every page.
Tracker.prototype._servlet = "http://localhost/WebTracker/WebTrackerServlet?";
Tracker.prototype._siteid = "GMW";
Tracker.prototype._featureID = "";
Tracker.prototype._channel = "";
Tracker.prototype._gmwsaddress = "";
Tracker.prototype._username = "";
Tracker.prototype._typekey = "";
Tracker.prototype._rep = ""; 
Tracker.prototype._ref = "";

//*****************Set Function************************

Tracker.prototype.setChannel = function(channel) {
    this._channel = channel;
}
Tracker.prototype.setGMWSAddress = function(gmwsaddress) {
    this._gmwsaddress = gmwsaddress;
}
Tracker.prototype.setUsername = function(strvalue) {
    this._username = strvalue;
}
Tracker.prototype.setTypekey = function(strvalue) {
    this._typekey = strvalue;
}
Tracker.prototype.setGroupRep = function(strvalue) {
    this._rep = strvalue;
}
Tracker.prototype.setSinRef = function(strvalue) {
    this._ref = strvalue;
}
//*****************End Set Function************************

//*****************Get Function************************
Tracker.prototype.getChannel = function() {
    return this._channel;
}
Tracker.prototype.getGMWSAddress = function() {
    return this._gmwsaddress;
}
Tracker.prototype.getUsername = function() {
    return this._username;
}
Tracker.prototype.getTypekey = function() {
    return this._typekey;
}
Tracker.prototype.getGroupRep = function() {
    return this._rep;
}
Tracker.prototype.getSinRef = function() {
    return this._ref;
}
Tracker.prototype.getServlet = function() {
    return this._servlet;
}
//*****************End get Function************************


Tracker.prototype.track = function(target)
{
	//get some property from js
	var my_referrer = window.document.referrer;
	var my_Browser = navigator.userAgent;
	var my_screen = "unknown"
	
	if(typeof(screen)=="object")
	{
		my_screen = screen.width+"x"+screen.height;	
	}
	
	if(target=="PRD_PRODUCTION")
		this._servlet = "http://www.johnson.ca/WebTracker/WebTrackerServlet?";
	else if(target=="QUA_QUALITY")
		this._servlet = "http://qua-www.johnson.ca/WebTracker/WebTrackerServlet?";
	else if(target=="ITG_INTEGRATION")
		this._servlet = "http://itg-www.johnson.ca/WebTracker/WebTrackerServlet?";
	
	this._servlet = this._servlet + "p1=" + this._siteid;
	this._servlet = this._servlet + "&p2=" + this._featureID;
	this._servlet = this._servlet + "&p3=" + this._channel;
	this._servlet = this._servlet + "&p4=" + this._gmwsaddress;
	this._servlet = this._servlet + "&p5=" + this._username;
	this._servlet = this._servlet + "&p6=" + this._typekey;
	this._servlet = this._servlet + "&p7=" + this._rep;
	this._servlet = this._servlet + "&p8=" + this._ref;
	this._servlet = this._servlet + "&p9=" + my_Browser;
	this._servlet = this._servlet + "&p10=" + my_screen;
	this._servlet = this._servlet + "&p11=" + my_referrer;
	
	document.write('<IMG ID="WTL_104433" BORDER="0" WIDTH="0" HEIGHT="0" SRC="'+ this._servlet +'">');
	
}
