/* This function calls an image for the stats of website */
function statSession(resourceName,siteId,sessionId){

	//alert("r="+resourceName+" - site="+siteId+" - session="+sessionId);

	/**
	 * The host the MD2P statistics aggregator is running on.
	 */
	var md2phost = "iphone.saabusa.com";
	/**
	 * The port the MD2P statistics aggregator is listening to.
	 */
	var md2pport = 80;
	/**
	 * The URI to call the MDP2 statistics aggregator.
	 */
	var md2puri = "/MD2PAS/stats";

	// Encode the resource name and call the MD2P Image
	rBase=btoa(resourceName);
	
	document.write('<img src="http://'+md2phost+':'+md2pport+md2puri+'?action=collect&s='+siteId+'&md2psid='+sessionId+'&r='+rBase+'" width="0" height="0" style="display:none;" />');	
}


/* This function calls an image for the stats of website */
function statDynamic(resourceName,siteId,sessionId){

	//alert("r="+resourceName+" - site="+siteId+" - session="+sessionId);
	
	var md2phost = "iphone.saabusa.com";
	var md2pport = 80;
	var md2puri = "/MD2PAS/stats";
	rBase=btoa(resourceName);
	var codeStats = '<img src="http://'+md2phost+':'+md2pport+md2puri+'?action=collect&s='+siteId+'&md2psid='+sessionId+'&r='+rBase+'" width="0" height="0" style="display:none;" />';
	document.getElementById("stats").innerHTML = codeStats;
}