function homeNavigation(clickedElement)
{
	var s=s_gi(s_account);
	s.linkTrackVars="prop35";
	s.channel="us:appworld:webstore";

	clickedElement = unescape(clickedElement);
	
	clickedElement = clickedElement.replace("_getTopDownloadOutcome_","_Top_Free_");
	clickedElement = clickedElement.replace("_getTopPurchasedOutcome_","_Top_Paid_");
	clickedElement = clickedElement.replace("_getNewestOutcome_","_Newest_Applications_");
	
	clickedElement = clickedElement.replace("getTopDownloadOutcome", "Top Free");
	clickedElement = clickedElement.replace("getTopPurchasedOutcome", "Top Paid");
	clickedElement = clickedElement.replace("getNewestOutcome", "Newest Applications");

	s.prop35=clickedElement;

	if (clickedElement.match("arrow"))
	{
		void(s.tl(true,'o',clickedElement));
	}
	else
	{
		void(s.tl(this,'o',clickedElement));
	}
	sleep(100);
}

function shareLinkClicked(medium)
{
	var s=s_gi(s_account);
	s.linkTrackVars="prop36,events";
	s.channel="us:appworld:webstore";
	s.linkTrackEvents="event37";
	s.events="event37";
	
	s.prop36 = medium + " - " + s.pageName;
	void(s.tl(this,'o',s.prop36));
	sleep(100);
}


//  this function is used when the button is clicked to send a download link to someone from the email page
function recordAppDownload(contentname)
{
	var s=s_gi(s_account);
	s.linkTrackVars="prop27";
	s.channel="us:appworld:webstore";

	s.prop27=unescape(contentname);
	
	void(s.tl(this,'o',s.prop27));
	sleep(100);
}

// this function is called when a button is clicked to get to the email/download page
// @param contentname - the name of the application being 'downloaded' or that the link is associated with
// @param location - what page the link was on
// @param linkName - the link clicked on (the button's name, app title, app icon, app vendor link, etc)
function recordAppWorldNavigation(contentname, location, linkName)
{
	var s=s_gi(s_account);
	s.linkTrackVars="prop35";
	s.channel="us:appworld:webstore";
	
	s.prop35=unescape(contentname) + ":" + unescape(linkName) + ":" + unescape(location);
	
	void(s.tl(this,'o',s.prop35));
	sleep(100);
}

function recordCategoryNavigation(linkName, linkLocation)
{
	var s=s_gi(s_account);
	s.linkTrackVars="prop35";
	s.channel="us:appworld:webstore";
	s.prop35=unescape(linkName) + ' - ' + unescape(linkLocation);
	
	void(s.tl(this,'o',s.prop35));
	sleep(100);
}

function sleep(millisecs){
	millisecs = millisecs;
    var sleeping = true;
    var now = new Date();
    var alarm;
    var startingMSeconds = now.getTime();

    while(sleeping){
       alarm = new Date();
       alarmMSeconds = alarm.getTime();
       if(alarmMSeconds - startingMSeconds > millisecs){ sleeping = false; }
    }      
}