function FBc()
	{
	FB_RequireFeatures(['Api'], function()
		{
		FB.Facebook.init(FACEBOOK_API_KEY, site_absolute_path + 'ext/')
		FB.Connect.get_status().waitUntilReady(function(status)
			{
			switch(status)
				{
				case FB.ConnectState.connected:break
				case FB.ConnectState.appNotAuthorized:break
				case FB.ConnectState.userNotLoggedIn:
					FB.Connect.requireSession(function()
						{
						FB.Connect.showPermissionDialog('offline_access',function(perm)
							{
							if (perm) { simple_ajax('_ajax/?facebook','FBd') }
							})
						})
				break
				}
			})
		})
	}

function FBd(rsp)
	{
	if (rsp == '1')
		{
		if (scrpt == _Gp_welcome)
			{
			document.getElementById('FB_wlcm').removeAttribute('onclick')
			document.getElementById('FB_wlcm').removeAttribute('onmouseover')
			document.getElementById('FB_wlcm').setAttribute('onmouseover',"balloon.showTooltip(event,'You are connected with <b>facebook</b>')")
			document.getElementById('FB_wlcm_tick').style.backgroundImage= 'url(_img/_flg/tick1.png)'
			document.getElementById('FBx').src= '_img/_btn/fbSyncX.png'
			}
		}
	}