$(document).ready (function () {
	
	// ad tag that will passthru the javascript custom name=value pairs from the ad server 
	if((typeof(railAdBg)!='undefined')&&(railAdBg)) 
	{ // site specific custom background code. 
		jQuery("#mainBg").css("background-image", "none");
		jQuery("#logo img").attr("src", "/common/images/_global2009/logotransparent_new.png");
		jQuery("#globalWrapper").css("background", "#000000 url(/common/images/_global/backgrounds/defaultSilverBg.jpg) repeat scroll center top");
		jQuery('body').css({'background-image':'url('+railAdBg+')', 'background-attachment': 'fixed'} ) ;
	} 
	
	if((typeof(railAdBgColor)!='undefined')&&(railAdBgColor)) 
	{ // site specific custom background color code. 
	
		jQuery('body').css({'background-color':'#'+railAdBgColor}); 
	} 
	
	if((typeof(railAdBgRepeat)!='undefined')&&(railAdBgRepeat))
	{ // site specific custom background repeat code. 
		jQuery('body').css({'background-repeat':'no-repeat'/*railAdBgRepeat*/}); 
	} 
	
	if((typeof(railAdBgClickthru)!='undefined')&&(railAdBgClickthru)) 
	{ // site specific custom background click event code. 
		// site specific custom background click event code.
		jQuery('#mainBg').click(function (e) 
		{
			
			evt = e || window.event;
			if (e.target) targ = e.target;
			else if (e.srcElement) targ = e.srcElement;
			if (targ.nodeType == 3) // Safari bug
				targ = targ.parentNode;
			if (targ.id == jQuery('#mainBg').attr('id')) 
			{
				window.open(railAdBgClickthru);
			}
		}); //end mainBg click
		
		
		jQuery('body').click(function (e) 
		{
			
			evt = e || window.event;
			if (e.target) targ = e.target;
			else if (e.srcElement) targ = e.srcElement;
			if (targ.nodeType == 3) // Safari bug
				targ = targ.parentNode;
			if (targ.id == jQuery('body').attr('id')) 
			{
				window.open(railAdBgClickthru);
			}
		});
		
		
		
		
		
	}
});//end document ready