			// This version of the tracking code is a simplified version. The point is to eliminate that we need to assign classes to Toll links. Only assign to non-toll links.
			// Also, no longer append data before a cmpid string. If it is empty, leave it empty. An outbound link just passes the cmpid code. Done.
			
			
   			 $(document).ready(function() {
   			 
   			 		  		 
			   
			   // 1) parse the url to get the name pairs
			   
					    var GETDATA = new Array();
		
						var sGet = window.location.search;
						
						if (sGet) // if has a value...
						{
						    // Drop the leading "?"
						    sGet = sGet.substr(1);
						    
						    // Generate a string array of the name value pairs.
						    // Each array element will have the form "foo=bar"
						    var sNVPairs = sGet.split("&");
						    
						    // Now, for each name-value pair, we need to extract
						    // the name and value.
						    for (var i = 0; i < sNVPairs.length; i++)
						    {
						        // So, sNVPairs[i] contains the current element...
						        // Split it at the equals sign.
						        var sNV = sNVPairs[i].split("=");
						        
						        // Assign the pair to the GETDATA array.
						        var sName = sNV[0];
						        var sValue = sNV[1];
						        GETDATA[sName] = sValue;
						        
						    }
						}
			   
			   
			   // 2) Put the values we are looking for into variables
			   
			   			found_cmpid=GETDATA["cmpid"]; // locate the existing cmpid string and put it here.
			   			found_target=GETDATA["target_id"]; // locate the existing target_id string and put it here.
			   			
			   			var empty; // an empty (undefined) variable
			   			var new_outbound_cmpid_string; // a variable to hold the new OUTBOUND campaign string
			   			var event_string_to_add = "";  // Take the event name and turn it into the right format for the cmpid
			   
			   // 3) Perform logic on setting up new strings
			  
						  if (found_cmpid == empty){ // if there is no existing campaign id coming in
								found_cmpid=""; // don't let it be undefined
						  }
						  else // there was an existing cmpid
						  {
								new_outbound_cmpid_string=found_cmpid;
					      }

						 if (found_target == empty){ // if there is no existing target id coming in
								found_target=""; // don't let it be undefined
						  }

				// 4) We now have captured and processed our url and have our variables set. 
				//    4a) We need to find all internal links and append the found target and found campaign strings
				//    4b) We need to find all external links and append the found target and our new external outbound campaign string
			   
			   
			
			$('a').each(function()
				{
					var url = this.href;
					
					if ($(this).is('.nottoll')) {
					//#elm has the class
					} 
					else 
					{
					//#elm doesn't have the class
						if (url.indexOf("?")!=-1) {
							//alert ("found a ?, use a &");
							$(this).attr('href', ($(this).attr('href'))+'&target_id='+found_target+'&cmpid='+found_cmpid );
						}
						else $(this).attr('href', ($(this).attr('href'))+'?target_id='+found_target+'&cmpid='+found_cmpid );
					}
					
				});
			
    			
    						   

   			   });
