// check wheather there logged into fb and have permissions get errors otherwise if logged in got to connect and register them page else display login form for facebook
/*function fbLogin() {
    FB.Connect.requireSession(function() {
    FB.Connect.showPermissionDialog('email,status_update,read_stream,publish_stream', function()
    {
     document.location = smf_scripturl + '?action=facebook;sa=connect;step';
     });
   });
}

// check wheather there logged into fb and have permissions get errors otherwise if logged in got to facebook page else display login form for facebook
function fbLogincheck() {
    FB.Connect.requireSession(function() {
    FB.Connect.showPermissionDialog('email,status_update,read_stream,publish_stream', function()
    {
     document.location = smf_scripturl + '?action=facebook';
     });
   });
}

// check wheather there logged into fb and have permissions get errors otherwise if logged in got to sync page else display login form for facebook
function fbLoginsync() {
    FB.Connect.requireSession(function() {
    FB.Connect.showPermissionDialog('email,status_update,read_stream,publish_stream', function()
    {
     document.location = smf_scripturl + '?action=facebook;sa=sync';
     });
   });
}

// actuly post to facebook 
function callPublish(msg, attachment, action_link) {
    streamPublish('', attachment, action_link);
}
*/


// actuly post to facebook 
function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){
    FB.ui(
    {
        method: 'stream.publish',
        message: '',
        attachment: {
            name: name,
            caption: '',
            description: (description),
            href: hrefLink
        },
        action_links: [
            { text: hrefTitle, href: hrefLink }
        ],
        user_prompt_message: userPrompt
    },
    function(response) {

    });
}
function publishStream(){
    streamPublish("" + forum_name +"", "" + site_slogan + "", 'placeholder', "" + smf_scripturl + "", "placeholder");
}

//gets the fabook comment box has tobe done via js to get valid xhtml fb tags are not valid xhtml using js gets aroumd it 
function Get_comments(){
	
	document.getElementById("comments").innerHTML = "<fb:comments xid=" + mod_settings_fb_com_xid + " numposts=" + mod_settings_fb_com_show + "></fb:comments>";
	
}

//gets the fabook recomendations box has tobe done via js to get valid xhtml fb tags are not valid xhtml using js gets aroumd it 
function Get_rec(){
	
	document.getElementById("rec").innerHTML = "<fb:recommendations site=" + smf_scripturl + "></fb:recommendations>";
	
}

//gets the fabook freindpile has tobe done via js to get valid xhtml fb tags are not valid xhtml using js gets aroumd it 
function Get_freindpile(){
	
	document.getElementById("freindpile").innerHTML = "<fb:friendpile></fb:friendpile>";
	
}

//gets the live stream has tobe done via js to get valid xhtml fb tags are not valid xhtml using js gets aroumd it 
function Get_stream(){
	
	document.getElementById("stream").innerHTML = "<fb:live-stream event_app_id=" + mod_settings_fb_app_pageid + " xid=" + mod_settings_fb_li_xid + "></fb:live-stream>";
	
}

//gets the fabook fan box has tobe done via js to get valid xhtml fb tags are not valid xhtml using js gets aroumd it 
function Get_fanbox(){		

    document.getElementById("fans").innerHTML = "<fb:fan profile_id=" + mod_settings_fb_app_pageid + " stream=" + mod_settings_fb_app_stream + " connections=" + mod_settings_fb_app_connection + " width=" + mod_settings_fb_app_width + "></fb:fan>";	
	
}

//gets the facebook share button
function Get_share(){
	
	document.getElementById("share").innerHTML = "<span id='facebook'><a name='fb_share' type='button' share_url=" + smf_scripturl + "?topic=" + mod_settings_fb_share + "></a></span>";
	
}

function Get_like(){
	
	document.getElementById("like").innerHTML = " <fb:like href=" + smf_scripturl + "?topic=" + mod_settings_fb_share + " layout='standard' show_faces='false' width='350' action='like' colorscheme='light' /></fb:like>";
	
}