
/*
 * "s_account" is a global variable available from Omniture code and contains the "Report Suite ID"
 */

function omniture_OnClick(fullLoggedInUserID, documentTitle, documentType, fundID)
{
	if(typeof(s_account) != "undefined")
	{
		var s = s_gi(s_account);
		
		s.prop11 = fullLoggedInUserID;
		s.prop12 = documentTitle;
		s.prop13 = documentType;
		s.prop14 = fundID;
		s.events = "event2";

		s.linkTrackVars = "prop11,prop12,prop13,prop14,events";
		s.linkTrackEvents = "event2";
		
		s.tl(this, "d", documentTitle);
	}
}


/*
 * "clickType" = "d", "o", etc.
 * "props" = {prop1: "hello", prop12: 123, prop13: "test"} <-- use JSON syntax!
 * "events" = "event1,event2" <-- use CSV syntax!
 *
 * This function expects AT LEAST one "prop" AND one "event"
 */
 
function omniture_OnClickLogProps(clickName, clickType, jsonProps, csvEvents)
{
	if(typeof(s_account) != "undefined")
	{
		var s = s_gi(s_account);
		
		var csvProps = "";
		
		for(var p in jsonProps)
		{
			s[p] = jsonProps[p];
			
			csvProps += (p + ",");
		}
		
		s.events = csvEvents;
		
		s.linkTrackVars = csvProps + "events";
		s.linkTrackEvents = csvEvents;
		
		s.tl(this, clickType, clickName);
	}
}


/* Not yet implemented in Nova

function omniture_ExternalLinkOnClick(linkName)
{
	if(typeof(s_account) != "undefined")
	{
		var s = s_gi(s_account);
		
		s.prop10 = linkName;
		s.eVar12 = linkName;

		s.linkTrackVars = "prop10,eVar12,events";
		s.linkTrackEvents = "event4,event16";
		
		s.tl(this, "o", linkName);
	}
}
*/

