$(document).ready(function(){
  
  //var lowerBGHeight = $('#container').height() - 330;
  //var windowSize = $(window).height() - 330;
  //if(windowSize < lowerBGHeight)
  //$('#lowerBG').css('height', lowerBGHeight + 'px');
  //else    
  //$('#lowerBG').css('height', windowSize + 'px');
  
  
  $("img").each(function() {
    var img = $(this).attr("src");
    if ( typeof(img) == 'undefined' || img == '' || img == '/' || img.substr(0, 1) == '?' || img.substr(0, 2) == '/?' ) $(this).hide();
  });

 $("a.sponsorLink[href^='http://']").addClass("lnkBlank");  
  
    // Opens up links in new window.
    $('.lnkBlank').click(function() {
        window.open($(this).attr('href'), 'newWindow'+ new Date().getTime(), '');
        return false;
    });
 
  
  pixelsilk2.renderSkin({skin: '[' + '[Menu1]' + ']', path: null}, function(html) {
          $('#subNavigation').html(html);
          var sections = $('#subNavigation .subNavItem');
          var topElements = $('#menu .item');
          for (z = 0; z < sections.length; z++) {
                var li = topElements[z];
                var lihtml = li.innerHTML;
               li.innerHTML = lihtml + sections[z].innerHTML;
          }
          $('#menu').navMenu({
                 menuWidth: 275,
                containerElement:  "#container",
                containerWidth:  1200,
                menuElement: ".sub",
                 rightArrow: ''
          });
      });
});
