var jqN = jQuery;

/*
var railAdBg='http://www.nbc.com/assets/images/v08/hp/nbc_bg/xmasBG.gif';
var railAdBgColor='ff0000';
var railAdBgRepeat='repeat-x';
var railAdBgClickthru='http://www.nissanusa.com';
*/

jqN(document).ready(function() {

if((typeof(railAdBg)!='undefined')&&(railAdBg))
{
// site specific custom background code.
jqN('body').css({'background-image':'url('+railAdBg+')'});
jqN('body').css({'background-attachment':'fixed'});
jqN('body').css({'background-position':'top center'});
}
if((typeof(railAdBgColor)!='undefined')&&(railAdBgColor))
{
// site specific custom background color code.
jqN('body').css({'background-color':'#'+railAdBgColor});
}
if((typeof(railAdBgRepeat)!='undefined')&&(railAdBgRepeat))
{
// site specific custom background repeat code.
jqN('body').css({'background-repeat':railAdBgRepeat});
}
if((typeof(railAdBgClickthru)!='undefined')&&(railAdBgClickthru))
{
// site specific custom background click event code.
 jqN('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;
  //railAdBgClickthru = unescape(railAdBgClickthru);
  //if (targ.id == jqN('body').attr('id')) {
  if (targ.tagName.toLowerCase() == jqN('body')[0].tagName.toLowerCase()) {
   window.open(railAdBgClickthru);
  }
 });
 //jqN('#'+jqN('body').attr('id')).bind('mouseenter',function () {
 jqN('body').bind('mouseenter',function () {
   jqN(this).css('cursor','pointer');
 });
 //jqN('#'+jqN('body').attr('id')).bind('mouseleave',function () {
 jqN('body').bind('mouseleave',function () {
    jqN(this).css('cursor','default');
  });


}

});

