// JavaScript Document

// DIV TOGGLE
$(function() {
    $('#container').tabs({
        fxFade: true,
        fxSpeed: 'slow'
    });
});

$(document).ready(function() {
    	// Use this example, or...
    	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
      //$('a.lightbox').lightBox();
      Shadowbox.init({
    loading: "Načítám",
    
});

    });

if(home == true){
    // CROSSSLIDER
    $(document).ready(function() {
        var $test3 = $('#slider'),
        STOP = 1, RUN = 2, PAUSE = 3;

        $test3.crossSlide({
            fade: 3
        }, [
        {
            src:  src1,
            alt:  'Okna.cz',
            description:  '<p><strong>ZIMNÍ SLEVY</strong></p><p>Zahájeny akční zimní slevy na vybrané produkty!</p>',
            from: '100% 0% 0.7x',
            to:   '80% 0% 1.2x',
            time: 5
        }, {
            src:  src2,
            alt:  'Okna.cz',
            description:  '<p><strong>LUXOR NORDIC 7</strong></p><p class="small">7-mi komorový profil</p><p>Český výrobek</p><p class="small">Vyberte si z 30 druhů dekorů a barev bez poplatku!</p>',
            from: '100% 0% 0.7x',
            to:   '100% 0% 1.2x',
            time: 3
        }, {
            src:  src3,
            alt:  'Okna.cz',
            description:  '<p><strong>NEJVÝHODNĚJŠÍ NABÍDKY</strong></p><p>Garance nejvýhodnější nabídky</p><p class="small">ve vašem regionu!</p>',
            from: '100% 0% 0.9x',
            to:   '100% 0% 1.4x',
            time: 3
        }, {
            src:  src4,
            alt:  'Okna.cz',
            description:  '<p class="odsazeni"><strong>…jinde nehledejte!</strong></p>',
            from: '100% 0% 0.8x',
            to:   '100% 0% 1.4x',
            time: 3
        }
        ], function(idx, img, idxOut, imgOut) {
            $caption = $('div.caption');
            if (idxOut == undefined) {
                //$caption.text(img.alt).animate({opacity: .7})
                $caption.html($("div#slider-description-"+idx).html()).animate({opacity: .7})
            } else {
                $caption.animate({
                    opacity: 0
                })
            }
        });
    });
}

// CENIK DIV TOGGLE
$(document).ready(function() {
    var prev = $('.link1');
    $('[class*=toggle-item]').hide();
    $('.toggle-item-link1').show();
    prev.addClass('orange');
    $('[class^=link]').click(function() {
        var $this = $(this);
        var x = $this.attr("className");
        /*$('.toggle-item-' + x).toggle(300);*/
        $('[class*=toggle-item]').hide();
        $(prev).removeClass('orange');
        $this.addClass('orange');
        $('.toggle-item-' + x).show(300);
        prev = $this;
        return false;
    });
});

