﻿//*********************************************
// Facebook Connect - Authentication...

var fsFbConnectUrlRedirect = escape("http://www.freedomspeaks.com/facebookconnect.aspx");
var fsFbConnectUrlCancel = escape("http://www.freedomspeaks.com/");

function doFacebookConnect(fsFbConnectKey)
{
    var w = "550"; var h = "425";
    var url = "http://www.facebook.com/login.php";
    url += "?api_key=" + fsFbConnectKey;
    url += "&cancel_url=" + fsFbConnectUrlCancel;
    url += "&display=popup";
    url += "&extern=1";
    url += "&fbconnect=1";
    url += "&next=" + fsFbConnectUrlRedirect;
    url += "&req_perms=publish_stream";
    url += "&return_session=1";
    url += "&v=1.0";
    var params = (IE) 
        ? ("resizable=yes,left=" + ((screen.availWidth / 2) - (w / 2)) + ",top=" + ((screen.availHeight / 2) - (h / 2)) + ",height=" + h + ",width=" + w)
        : ("resizable=yes,screenX=" + ((screen.availWidth / 2) - (w / 2)) + ",screenY=" + ((screen.availHeight / 2) - (h / 2)) + ",height=" + h + ",width=" + w);
    window.open(url, "FacebookConnect", params)
}