// 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 = 'http://www.helloicu.com/sys/index.php?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';

     });

   });

}
function fbLogincheck2() {

    FB.Connect.requireSession(function() {

    FB.Connect.showPermissionDialog('email,status_update,read_stream,publish_stream', function()

    {

    

     });

   });

}



// 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) {

  FB.ensureInit(function () {

    FB.Connect.streamPublish('', attachment, action_link);

  });

}



//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 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>";

	

}

