 
if(!aw)
{
	var aw = new Object();
	aw.utils =new Object();
	aw.utils.browser=new Object();
}

aw.utils.browser.SocialMediaSharer = new function()
{
	var getSiteUrl = function()
	{
		var l_hashIndex = location.href.indexOf("#");
		var l_url = l_hashIndex >=0 ? location.href.substring(0,l_hashIndex) : location.href;	//location.href.subStr(0,l_hashIndex);
		
		//return "http://www.commbank.com.au/visualisation";
		return "http://tinyurl.com/bankstats";
		
		return l_url;
	}
	
	var ShareWithFacebook = this.ShareWithFacebook = function()
	{
		var u=location.href;
		var t=document.title;
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(getSiteUrl())+'&t='+encodeURIComponent(t),'Facebook');
		
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareFacebook");
		
		return false;
	}
	
	var ShareWithTwiiter = this.ShareWithTwiiter = function()
	{
		window.open('http://twitter.com/home?status=' + escape(getSiteUrl()),'Twitter'); 
		//alert(">> TWITTER ");
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareTwitter");
		
		return false;
	}
	
	
	var ShareResultWithTwiiter = this.ShareResultWithTwiiter = function(a_result)
	{
		if(a_result)
		{
			a_result = a_result +"\n\n" + "Find out more - " + getSiteUrl();
			
			window.open('http://twitter.com/home?status=' + escape(a_result),'Twitter');
		}else
		{
			ShareWithTwiiter();
		}
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareResultTwitter");
		
		//alert(">> TWITTER ");
		return false;
	}
	
	
	var ShareWithMyspace = this.ShareWithMyspace = function()
	{
		window.open('http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=' + encodeURIComponent(getSiteUrl()) + '&t=' + encodeURIComponent(document.title),'MySpace');
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareMyspace");
		return false;
	}
	
	var ShareWithDelicious = this.ShareWithDelicious = function()
	{
		window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(getSiteUrl())+'&amp;title='+encodeURIComponent(document.title), 'Delicious'); 
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareDelicious");
		return false;
	}
	
	var ShareWithDigg = this.ShareWithDigg = function()
	{
		window.open('http://digg.com/submit?url='+encodeURIComponent(getSiteUrl())+'&amp;title='+encodeURIComponent(document.title), 'Digg'); 
		if(pageTracker)pageTracker._trackPageview("cbaVisualisations/shareDigg");
		return false;
	}
	
}
