try
{
    var defOpacity  =   1;
    var darkOpacity =   0.6;

    /* greyed out button functionality */
    var checkPanelNo = function()
    {
        $(".collectionNavigation .navi a").each(function(i) {
            if($(this).hasClass("active"))
            {
                if($(this).is(":first-child"))
                {
                    $("button.prevPage").css("opacity",darkOpacity);
                    $("button.nextPage").css("opacity",defOpacity);
                }
                else if($(this).is(":last-child"))
                {
                    $("button.nextPage").css("opacity",darkOpacity);
                    $("button.prevPage").css("opacity",defOpacity);
                }
                else
                {
                    $(".collectionNavigation button").css("opacity",defOpacity);
                }
            }
        });
    }

    var setCollection = function(panelId,pageId)
    {
        panelId = panelId - 1;
        if(panelId < 0) panelId = 0;
       

        /*
         * add a unique class to each navi button
         * and calculate the width oh the .navi class
         * (to center the div)
         **/
        $(".collectionNavigation .navi a").each(function(i) {
          $(this).addClass("panel"+i);
          var width = (i*10)+10;
          $(".collectionNavigation .navi").css("width",width+"px");
        });

        /* initial click, displays the panel on the left side */
        $(".collectionNavigation .navi .panel"+panelId).trigger('click');
        checkPanelNo();

        $(".left li a").each(function(i) {
            if($(this).attr("rel") == pageId) {
                $(this).children().addClass("on");
                // $(this).parent().children("a").attr("href","#");
            }
        });
    }

    // change the 320px x 560px product picture on the left side
    var changeProductPicture = function(id)
    {
      var imgID = $(id).parent().attr("class");
      $("#outer .steer_shop_product_show .box-1 .steer_shop_product_page_image_container").each(function(){
        $(this).css("display", "none");
      })
      $("#outer .steer_shop_product_show .box-1 a#"+imgID).parent().css("display", "block");
    }
} catch(e) { }