$(document).ready(function (){

    // cycle fungujici jen pri hover
    $('nav.home a span.cycle').cycle({timeout: 0});
    var obj;
    $('nav.home a').hover(function(){
	       obj = $(this).find('span.cycle');
           obj.cycle({timeout: 300, speed: 1,startingSlide: 1});
       }, function() {
           obj.cycle({timeout: 0,startingSlide: 0});
           obj.children().css('display', 'block');
       }
    );
    
    
    // cycle paticky
    $('footer .footer-cycle ').cycle({
        timeout: 30000,
        speed: 1500,
        random: 1
    });
    
    
    // zobrazeni puvodniho vzhledu obr s vyuzitim cycleru
    $('section.wanch .predpo').cycle({timeout: 0, speed: 500});
    $('section.wanch .predpo-switcher').hover(function(){
            $(this).next().cycle(1);
        }, function() {
            $(this).next().cycle(0);
        }
    );
    
    
    // upravy pro iphone
    var agent=navigator.userAgent.toLowerCase();
    var is_iphone = (agent.indexOf('iphone')!=-1);
    if (is_iphone) {
        $('section.wanch img.predpo-switcher').css('marginLeft', '-190px');
    }

});


