﻿


/*
function showFeed(data, body_general, target_id, feed_id, topic, topic_id, commentid, forumid,domain,apikey)
{

    FB.init(apikey, "/translink/fbconnect/xd_receiver.htm" );
    
    FB.ensureInit(
        function(){
    
        var template_data = {"images":[{ "src":"http:\/\/"+domain+"\/translink\/images\/logo-translink-over.gif", "href":"http:\/\/" + domain + "\/forum\/" }], "topic":topic,"topicid":topic_id,"message":body_general};
        var user_message_prompt = "Share this:";
        var user_message = {value: data};
        var continuation = function()
        {
        }    
        FB.Connect.showFeedDialog(feed_id, template_data,null,body_general,null,FB.RequireConnect.promptConnect,null,user_message_prompt, user_message);
   });
   
   
}
  */

//stream publish method
function streamPublish(name, description, hrefTitle, hrefLink, userPrompt, picURL){
    FB.ui(
    {
        method: 'stream.publish',
        message: '',        
        attachment: {
            name: name,
            caption: '',
            description: (description),
            href: hrefLink,
            media: [{'type': 'image', 'src': picURL, 'href': hrefLink }]
        },
       /* action_links: [
            { text: hrefTitle, href: hrefLink }
        ],*/
        user_prompt_message: userPrompt
    },
    function(response) {

    });

}


   //, body_general, target_id, continuation, user_message_prompt, user_message);


//postreplyclick('<%= "MyTopic"%>','<%= DataRow["TopicID"] %>','<%= DataRow["Message"] %>', <%= DataRow["MessageID"] %>', '<%= DataRow["ForumID"] %>' )
function postreplyclick(topic, topicid, comment,commentid, forumid,templateid,domain,apikey,postLink)
{
    hrefLink = "http:\/\/" + domain + postLink;
    var hrefTitle = '';
    var userPrompt = "Share this:";
    var picURL = "http:\/\/"+domain+"\/translink\/images\/logo-translink-over.gif";

    //showFeed(comment,'',/*friends list*/563683308, /*fb templatebundleid */templateid, topic, topicid, commentid,forumid,escape(domain),apikey);
    streamPublish(topic, comment, hrefTitle, hrefLink, userPrompt, picURL);
    return false;
}


