				
	$(document).ready(function(){
		
		//	Only do this if we know who the user is
		
		if (PHP_ClientUniqueID.length > 0) {
			if (typeof SkipUserMessage  == "undefined") {
				
				var	ServeLocation	=	20;
				if (typeof SiteMessageLocation != "undefined") {
					ServeLocation	=	SiteMessageLocation;
				}
				
				if ((typeof PHP_SiteLightBoxServeLocation != "undefined") && (parseInt(PHP_SiteLightBoxServeLocation) > 0))  {
					ServeLocation	=	PHP_SiteLightBoxServeLocation;
				}

				ReadJSONUserMessage(PHP_Staging,
									PHP_ClientUniqueID,
									ServeLocation,
									0,
										function (MessageArray)
										{
											var	Image_Icon_Path	=	"";
											var	AwardName		=	"";
											var	AwardArray		=	MessageArray['AwardInfo'];
											var	LightBoxID		=	MessageArray['LightBoxID'];
											var LightBoxClassName = MessageArray['LightBoxClassName'];
											
											if (MessageArray['IncludeMessageArray'] != undefined) {
												var	IncludeMessageArray	=	MessageArray['IncludeMessageArray'];
												if (IncludeMessageArray['IncludeMessage'] != undefined) {
													var	IncludeMessage	=	IncludeMessageArray['IncludeMessage'];
													$('.share_award_message').html(IncludeMessage);
												}
											}
											
											if (AwardArray['Image_Icon_Path'] != undefined) {
												Image_Icon_Path	=	AwardArray['Image_Path'];
												AwardName		=	AwardArray['AwardName'];
											}
											$('.img_award_image').attr("src", Image_Icon_Path);
											$('.img_award_image').attr("alt", AwardName);
											$('.show_site_message_class').html(MessageArray['Message']);
											$('.won_award_id').html(MessageArray['Message']);
											$.facebox.close(); 
                                                                                        
                                            //LightBoxID = 'award_alert_lightbox';
                                                                                        
											if (LightBoxID.length == 0) {
													$.facebox({div: '#site_message_facebox' },'lightbox');
											}
											else {
												$.facebox({div: '#' + LightBoxID },'lightbox');
											}
											
											if(LightBoxClassName != ''){
												$('#facebox').addClass(LightBoxClassName);
												
												//position
												$('#facebox').removeAttr('style');
												$('#facebox').css('display', 'block');
												$('#facebox').css('right', '0');
												$('#facebox').css('bottom', '0');
												$('#facebox').css('margin', '0');
												
												$('img.close_image').attr('src', 'http://www.feelgoodgames.co.uk/images/notification/close.gif');
											}
											
										},
									0);
			}
		}
	});



