function onConnected(user_id)
{
	alert("connected");
}

function onNotConnected()
{
	alert("Not connected");
} 

function facebook_logout()
{
	alert("Logging out");
	FB.Connect.LogoutAndRedirect("/user/UserUnidentified_logout.action?removerememberedsession=true");/*portalid=${userSession.portal.id}&amp;*/
	alert("Loggedout");
}

function checkFacebookStatus()
{
	window.location="/facebook/index_checkFacebookStatus.action?redirect=/user/UserUnidentified_signupForm.action";
/*	alert("Checking FB status");
	
    if (window.XMLHttpRequest) { // Non-IE browsers
	alert("2");
      req = new XMLHttpRequest();
	alert("2.5");
      req.onreadystatechange = processStateChange;
	alert("3");

      try {
      	req.open("GET", "/facebook/index_checkFacebookStatus.action", true); //was get
	alert("4");
      } catch (e) {
        alert("Problem Communicating with Server\n"+e);
      }
      req.send(null);
	alert("5");
    } else if (window.ActiveXObject) { // IE
	alert("3");
      
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req) {
        req.onreadystatechange = processStateChange;
        req.open("GET", "/facebook/index_checkFacebookStatus.action", true);
        req.send();
      }
    }

	alert("facebook status checked");
	window.location.reload();
}

  function processStateChange() {
  
  	  if (req.readyState == 4) { // Complete
      if (req.status == 200) { // OK response
        
        alert("Ajax response:"+req.responseText);
      } else {
        alert("Problem with server response:\n " + req.status+"/"+req.statusText);
      }
    }
*/
}
