//Özkan Kutlu
//Version: 1.0.1
//Datum: 30.05.2011
jQuery(function($) {
    var $paneTarget = $('#pane-target');

    $('.jquery_goto_previous').click(function() {
        var $itemCounts = $('.ItemCounts').val();
        var $currentItem = $('.CurrentItem').val();
        var $goto_li;

        if (parseInt($itemCounts) > 0) {
            if ($currentItem > 0) {
                $goto_li = parseInt($currentItem) - 1;

                $('.CurrentItem').val($goto_li);
                $paneTarget.stop().scrollTo("li:eq(" + $goto_li + ")", 800);
            }
        }
    });

    $('.jquery_goto_next').click(function() {
        var $itemCounts = $('.ItemCounts').val();
        var $currentItem = $('.CurrentItem').val();
        var $goto_li;

        if (parseInt($currentItem) < parseInt($itemCounts)) {
            $goto_li = parseInt($currentItem) + 1;

            $('.CurrentItem').val($goto_li);
            $paneTarget.stop().scrollTo("li:eq(" + $goto_li + ")", 800);
        }

    });

    $('.getBox').click(function() {
        $('.itemInfobox').hide();
        $('.box_' + this.title).show();
        $('.selectedItem').show();
    });

});


jQuery(function($) {
    var $paneTarget = $('#pane-target');

    $('.getCurrentBox').ready(function() {
        var $itemCounts = $('.ItemCounts').val();
        var $currentItem = $('.CurrentItem').val();
        $paneTarget.stop().scrollTo("li:eq(" + $currentItem + ")", 800);

        $(".imgProductPreview").attr("src", $('.CurrentImagePfad').val());
    });

});

