jQuery(document).ready(function () {

    jQuery("#pr").slides({
        preload: true,
        play: 5000,
        pause: 2500,
        hoverPause: true,
        generateNextPrev: true
    });



    jQuery("#menuInner2 > menu > li:last-child ").addClass("last");
    jQuery(".RadDataPager input[onclick]").addClass("inactive");

    jQuery("span.link.nahoru a").click(function () {
        jQuery("html,body").animate({ scrollTop: 0 }, 'slow');
        return false;
    });

    var value = jQuery('#pnlPath a:last-child').text(); 
    jQuery('#pnlPath a:last-child').wrap("<span/>").wrap("<span/>");

    jQuery(".parentIsSubpage").parents("body").find(".mainPage").toggleClass("mainPage").toggleClass("subPage");

    // zvyrazneni externich linku  
    jQuery('#contentPanel a').filter(function () {
        return this.hostname && this.hostname !== location.hostname;
    }).addClass('external');

    jQuery("#kdeNasNajdete li .expander").click(function () {
        jQuery(this).toggleClass("open").next(".info").slideToggle();

    });
    // rozbalovaci nabidka socialnich siti
    jQuery('.joinus').animate({ width: "151px" }).find('div.arrow').toggle(function () {
        var countofIcons = jQuery(this).parent().find(".joinus-icons a").size();
        var icoWidth = 36;
        var width = icoWidth * countofIcons + 43;

        jQuery(this).addClass("opened").parent().addClass("open").animate({ width: width });
        return false;

    }, function () {

        jQuery(this).removeClass("opened").parent().animate({ width: "151px" }, "slow", function () { jQuery(this).removeClass("open"); });
        return false;
    });

    // ikonky produktu v paticce  
    jQuery('.xevos-products > div').hover(function () {
        jQuery(this).addClass("hovered");
    }, function () {
        jQuery(this).removeClass("hovered");
    });

    // PR v headru
    jQuery('#pr .menu a').click(function () {

        var poradi = jQuery(this).index();
        var poradi = poradi + 1;

        jQuery(this).addClass("active").siblings().removeClass("active");


        jQuery(this).parent().parent().find(".slideshow .item:nth-child(" + poradi + ")").fadeTo(500, 1).siblings().hide();

        return false;
    }, function () {

        return false;

    });




});
