function update_user_box()  {
  if (typeof(FB) !== "undefined") {
 	   jQuery('.pFacebook').attr('checked', true);
		jQuery('div#user').html(
		"<p>"
		+"<fb:profile-pic uid='loggedinuser' facebook-logo='false' width='32' height='32'></fb:profile-pic> "
		+"Welcome, <fb:name uid='loggedinuser' useyou='false'></fb:name>."
		+"You are signed in to your Facebook account."
		+"<br /><br /><fb:user-status uid='" + FB.Connect.get_loggedInUser()  + "' linked='true'></fb:user-status>"
		+"</p>"
		);
		FB.XFBML.Host.parseDomTree();
  }
}
jQuery(document).ready(function() { 
	  if (typeof(FB) !== "undefined") {
		FB_RequireFeatures(["XFBML"], function() {
		  FB.init("9d6afc2fb6d8ba116de2b5c6ece2f1cc", "/fbconnect/xd_receiver.php");
			 FB.Facebook.get_sessionState().waitUntilReady(function() {
				if(FB.Connect != null) {
				 FB.Connect.ifUserConnected(update_user_box);
				}
			 });
		 });
	   FB.init("9d6afc2fb6d8ba116de2b5c6ece2f1cc", "/fbconnect/xd_receiver.php");
		if(FB.Connect != null) {
			FB.Connect.ifUserConnected(update_user_box);
		} 
	  }


	var options = { 
        beforeSubmit:  facebookCheck,  // pre-submit callback 
  type: 'post',
        dataType: 'xml'
    }; 
 
    // bind form using 'ajaxForm' 
    jQuery('.cForm').ajaxForm(options); 
}); 



