/*
	function showFeedForm(img_src,img_link,callback){
		//alert('img_src='+img_src+', img_link='+img_link);
		var user_message_prompt = "What do you have to say about your turban?";
		var user_message = {value: "write your review here"};
		//var template_data = {"images":[{"src":JS_URL_ROOT+"/components/com_hotornot/upload/1/5_thumb.jpg","href":JS_URL_ROOT+"/index.php?option=com_hotornot&task=show&id=10&Itemid=106"}],"turbanlink":JS_URL_ROOT+"/index.php?option=com_hotornot&task=show&id=10&Itemid=106"};
		var template_data = {"images":[{"src":img_src,"href":img_link}],"turbanlink":img_link};
		var body_general = '';
		
	    FB.ensureInit(function() {
	        FB.Connect.requireSession(function() {
	            if (template_data) {
	        		FB.Connect.showFeedDialog(99259598509, template_data, null , "", null, FB.RequireConnect.require, callback, user_message_prompt, user_message);
	        		//FB.Connect.showFeedDialog(99259598509, template_data, user , body_general, null, FB.RequireConnect.require, callback, user_message_prompt, user_message);
	            }
	        });
	    });
	}
	
	function showFeedFormCallback(){
		alert('showFeedFormCallback');
	}
*/


function showFeedFormGeneral(img_src,img_link,callback){
	//alert('img_src='+img_src+', img_link='+img_link);	

	var streamObject = {
			method: 'stream.publish',
			message: 'Check out my Turban!',
			attachment: {
				name: 'Rate My Turban',
				caption: 'Bringing you turbans of the world.',
				description: (
					'Explore the world of turban wearers with Rate my turban.'
				),
				href: img_link,
				media: [
					{
						type: 'image', 
						src: img_src, 
						href: img_link
					}
				]
			},
			action_links: [
				{ text: 'Rate Turbans Now', href: JS_URL_ROOT }
			],
			user_message_prompt: 'Tell your friends about this turban'
		};
	
	try{
		FB.ui(streamObject, callback);
	}catch(err){
		callback(null);
	}
	
	/*
	function callback(response) {
		if (response && response.post_id) {
			//alert('Post was published.');
		} else {
			//alert('Post was not published.');
		}
		
	}*/
	

}
