$(document).ready(function() {

 //Make the content div as high as the nav div, if it isn't already
 doResize = function() {
  var intNavHeight = $('div#nav').height();
  var intContentInnerHeight = $('div#contentinner').height();
  var intContentHeaderHeight = $('div#contentheader').height();

  if (intNavHeight > (intContentInnerHeight + intContentHeaderHeight)) {
   $('div#contentinner').css('height', (intNavHeight - intContentHeaderHeight) + 'px');
  }//if
 }//function

 if ($('div#flash')) {
  doResize();
 } else {
  $('div#contentinner').load( doResize() );
 }//if

 //Get the current product's ID
 if (document.getElementById('CurrentProductID')) {
  var intProductID = $('input#CurrentProductID').attr('value');
  var elemImg = $('div#subnavbottom img#Product' + intProductID);

  //Scroll to the current product
  //$('div#subnavbottom').scrollTo( elemImg, 2500, {axis:'x', margin:true} );

  //Set the class for the selected product
  elemImg.addClass('selected');
 }//if

 $('img#nextbutton').hover( function() {
  $(this).attr('src', 'images/next_hover.gif');
 }, function() {
  $(this).attr('src', 'images/next.gif');
 });

 $('img#previousbutton').hover( function() {
  $(this).attr('src', 'images/previous_hover.gif');
 }, function() {
  $(this).attr('src', 'images/previous.gif');
 });

});