




function signout()
{
    try
    { 
        FB.Connect.logout(function() {window.location = 'http://' + window.location.hostname + '/Authentication/LogOut.aspx'} ); 
    }
    catch(err)
    { 
        window.location= 'http://' + window.location.hostname + '/Authentication/LogOut.aspx'; 
    }
}



function CommentLogin()
{
    var url = "";
    var url2 = "";
    var url3 = "";
    var sPath = window.location.pathname;
    url += String.format("http://{0}/Authentication/Login.aspx?returnUrl=", window.location.hostname );
    
    url2 += String.format("http://{0}/User/Discussion.aspx?action=add&q={1}&text={2}&returnUrl=", 
        window.location.hostname, 
        $.URLEncode( $('.txtSearch').val() ),
        $.URLEncode( $('.discussionAdd').val() )
        );
        
    url3 += String.format("http://{0}/{1}", window.location.hostname, sPath.substring(sPath.lastIndexOf('/') + 1));
    url3 += "?q=" + $.URLEncode( $('.txtSearch').val() );
    
    url2 += $.URLEncode( url3 );
    url += $.URLEncode( url2 );
    window.location.href = url;
}











