﻿function fitPdItem() {
    $(".pd-item").each(function() {
        $(this).css("height", $(this).parent().height());
    });
}

function mycarousel_initCallback(carousel) {
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function prodFunc() {
    this.vertical = false;
    jQuery('.first-and-second-carousel').jcarousel({
        animation: 3000,
        auto: 5,
        scroll: 1,
        wrap: 'last',
        vertical: true,
        visible: 3,
        rtl:true,
        initCallback: mycarousel_initCallback
    });
    jQuery('.first-and-second-carousel2').jcarousel({
    animation: 500,
        scroll: 1
    });
    fitPdItem();
}
$(document).ready(function() {
prodFunc();
//    this.vertical = false;

//    //fitPdItem();
//    // Initialise the first and second carousel by class selector.
//    // Note that they use both the same configuration options (none in this case).
//    jQuery('.first-and-second-carousel').jcarousel({
//        animation: 2000
//    });

//    // If you want to use a caoursel with different configuration options,
//    // you have to initialise it seperately. We do it by an id selector here.
//    //            jQuery('#third-carousel').jcarousel({
//    //                vertical: true
//    //            });

//    fitPdItem();
});
function show_tab(t, element) {
    alert('t');
    alert(t);
    alert('element');
    alert(element);
    var curr_tab = document.getElementById("tab" + t),
            tobj = document.getElementById("tabs"),
            tobj_lis = tobj.getElementsByTagName("li");

    for (var i = 1; i <= 5; i++) {
        var tab = document.getElementById("tab" + i);
        if (tab) tab.className = (i === t) ? "show-tab" : "hide-tab";
    }
    $(tobj_lis).removeClass("current");
    if (window.console) console.log(this);
    $(element).parents("li").addClass("current");
}

function onReviewClick() {
    //$(document).ready(function() {
        var tabs = $(".synTabbed").find(".synTabs").children().filter("*"); //.addClass("synTab");       
        if (tabs.length > 0) {
            var selectedTab = tabs[2];
            $(selectedTab).click();
        }
    //});
}
