
$(document).ready(function(){

  pageSubsection = $('#pageSub').html();

  /***********
  ** Product *
  ***********/

  if(pageSubsection == 'product'){

    $('section.altImages img').click(function(){
      newWidth = 250;
      imageId = $(this).customdata('id');
      imageSrc = '../images/image.html?id=' + imageId + '&width=' + newWidth;
      imageTitle = $(this).attr('alt');
      imageOriginalHeight = $(this).customdata('height');
      imageOriginalWidth = $(this).customdata('width');
      newHeight = Math.ceil(imageOriginalHeight / imageOriginalWidth * newWidth);


      $('.mainImage img').attr({
        src: imageSrc,
        alt: imageTitle,
        height: newHeight,
        width: newWidth
      })
    });


  } // endif(pageSubsection == 'product')


  /****************
  ** Product List *
  ****************/

  else if(pageSubsection == 'productList'){


    $('.product .productTitle').hover(function(){
      $(this).parents('.product').addClass('active');
    }, function(){
      $(this).parents('.product').removeClass('active');
    });

/*    $("#categoryScroll").mbScrollable({
        controls: '#categoryControls',
        elementMargin: 2,
        elementsInPage: 5,
        height: 'auto',
        shadow: '#999 2px 2px 2px',
        slideTimer: 300,
        width: 535
    });
    $('.SECont').each(function(){
      $(this).css('height', '150px');
    });*/

  } // endelse if(pageSubsection == 'productList')

});
