window.onload = function() {
	c8.Fb.Init();
	
	/*
	var url = window.location.href;
	if(url.match(/(#petition)/ig)) {
		url = url.replace(/(#petition)/ig, '');
		window.location.href = url;
	}
	*/
}

function c8FbWallPost(mins,secs){
	
	var url = window.location.href;
	url.replace(/(#petition)/ig, '');
	window.location = url + '#petition';

	c8.Fb.Login( function() { 
			var fbPost = {
				Title: 'Save Our Marine Life - Unprotected Waters', 
				Text: '{*actor*} has just survived ' + mins + ' mins ' + secs + ' seconds in Unprotected Waters. How long can you last?',
				UserText: '',
				Description: 'Steer Sandy Seal through the dangers of the unprotected waters game and sign the petition to Save Our Marine Life. Up to 90% of Australia\'s South West marine life is unique - but less than 1% protected. http://www.saveourmarinelife.org.au/sandy/',
				Link: { href: 'http://www.saveourmarinelife.org.au/sandy/?source=fb/feed', text: 'Play the game' },
				Image: { src:'http://www2.popul8.com.au/clients/EMC/Marine/images/img_FB_button.jpg', href: 'http://www.saveourmarinelife.org.au/sandy?source=fb_post' },
				callback: function() {
					
					/*
					var url = window.location.href;
					url = url.replace(/#(.*)$/i, '');
					window.location.href = url;
					*/
					
				}
			     };
			c8.Fb.Stream.Publish( fbPost );
	} );

}
