//Local Variable with Flash Content id. default = flashcontent
var as_swf_name = "flash_content";
var template_bundle_id = "64610624952";

//Initialize Facebook
function fbInit(pAsSwfName,pApi_key,pReceiver){
	as_swf_name = pAsSwfName;
	FB.init(pApi_key,pReceiver);
}

function publishStory(flockcode){
	var postData = {
	  "post-url":"http://www.favourfarm.co.uk/",
	  "flock-code":flockcode,
	  "images":[{"src":"http://www.favourfarm.co.uk/images/fb-ff-feed.jpg", "href":"http://www.favourfarm.co.uk/"}]
	};
	FB.Connect.showFeedDialog(template_bundle_id, postData, null, null, null);
}

//Method to dispatch an Event to Flash
function flashCallBack ( func ) {
	if( arguments.length > 1 ){
		document[as_swf_name][func]( Array.prototype.slice.call(arguments).slice(1)[0]);
	}else{
		document[as_swf_name][func]();
	}
}