$(document).ready(function() {	//triggers grayed out screen, adds message for user	//accepts custom width if need be	// preload images for the shadowBox   //$.preloadImages("/i/common/shadowBox/shtl.png","/i/common/shadowBox/shtm.png","/i/common/shadowBox/shtr.png","/i/common/shadowBox/shbl.png","/i/common/shadowBox/shbm.png","/i/common/shadowBox/shbr.png","/i/common/shadowBox/shml.png","/i/common/shadowBox/shmr.png");		var messageTransfer = "";	var messageTransferID = null;	 	showMessage = function(id,customWidth,destURL,gameKeyword){		if ( messageTransferID != null ) { return; }		var iframeLayer = "<iframe id=\"iframeLayer\" style=\"z-index:99;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0;filter: alpha(opacity=0);\" src=\"javascript:''\"></iframe>";				messageTransferID = id;		// get the message HTML that need to show		messageTransfer = $(id).html();		// empty that HTML so we don't end up with two IDs		$(id).empty();				btnClose =  '<a class="dimmerBtnClose clearLink" href="#">Close</a>';		// insert the layers, the dimmer itself and the dimmer message with inserted text		$('<div id="dimmer"></div>').appendTo(document.body);		$('<div id="dimmerMessage"><table class="shadowBox"><tr><td class="shtl"></td><td class="shtm"></td><td class="shtr"></td></tr><tr><td class="shml"></td><td class="shmm">' + btnClose + messageTransfer + '</td><td class="shmr"></td></tr><tr><td class="shbl"></td><td class="shbm"></td><td class="shbr"></td></tr></table></div>').appendTo(document.body);		$('.dimmerBtnClose').click( function() {			hideMessage();			return false;		});		hideFlashObjects();		var ieScrollTop = 0;		if ( typeof document.body.style.maxHeight === "undefined" ) { // if IE 6			ieScrollTop = document.documentElement.scrollTop;			$(iframeLayer).appendTo(document.body); 		} 		 		// Determine and set negative marginLeft to pull it back to center		if (customWidth) {			var messageWidth = customWidth;			$("#dimmerMessage").width(customWidth+"px");		} else {			var messageWidth = $("#dimmerMessage").width();		}		var messageLftMarg = ( messageWidth / 2 ) - messageWidth;		$("#dimmerMessage").css("marginLeft",messageLftMarg);		 		// Determine and set negative marginTop to pull it back to center		var messageHeight = $("#dimmerMessage").height();		var messageTopMarg = ( messageHeight / 2 ) - messageHeight + ieScrollTop;		$("#dimmerMessage").css("marginTop",messageTopMarg);						if ($.browser.opera) { // have to do this wonky show/hide for opera because the flash layer peeks through otherwise			$("#flashItem").css("visibility","hidden");			$("#dimmer, #dimmerMessage").show();			$("#flashItem").css("visibility","visible");		} else {			// fade in, then fade in message, fixes issue with IE			$("#dimmer").fadeIn("fast",function(){				$("#dimmerMessage").fadeIn("fast",function(){					if (destURL) {						$("#dimmerMessage").find(".btnOnlinePlain").attr("href",destURL);					}					// for screenshots					if (gameKeyword) {						$("#screenShotsWrapper .carousel-container li").each(function (i) {							imgURL = "url(/content/screenshots/"+gameKeyword+"_billboard_"+(i+1)+".jpg)";							$(this).css("background",imgURL);						});					}				}); 			}); 		}	}		// hides the dimmer and the message	hideMessage = function(){		if ($.browser.msie) { // if IE			$("#dimmer, #dimmerMessage").remove();			$("#iframeLayer").remove();		} else {			$("#dimmer, #dimmerMessage").fadeOut("fast",function(){				$("#dimmer, #dimmerMessage").remove();			}); 		}		showFlashObjects();		$(messageTransferID).html(messageTransfer);		messageTransferID = null;	}});