$(document).ready(function()
{
    var _el = $('#contain div.links ul');

    $('#contain div.links').mouseover(function()
    {
        if (_el.hasClass('hidden')) {
            _el.removeClass('hidden');
        }
    }).mouseout(function()
    {
        if (!_el.hasClass('hidden')) {
            _el.addClass('hidden');
        }
    });

    $('#actualities marquee').marquee('pointer').mouseover(function()
    {
        $(this).trigger('stop');
    }).mouseout(function()
    {
        $(this).trigger('start');
    });

    $('#workflow-container div.column').mouseover(function()
    {
        $(this).addClass('hover');
    }).mouseout(function()
    {
        $(this).removeClass('hover');
    });

    $('#workflow-container div.column h4 a').mouseover(function()
    {
        $(this).parent().parent().next().addClass('display-arrow');
    }).mouseout(function()
    {
        $(this).parent().parent().next().removeClass('display-arrow');
    });

    $('#role-container a.box').mouseover(function()
    {
        $(this).addClass('hover');
    }).mouseout(function()
    {
        $(this).removeClass('hover');
    });
});

// ANIMACE SIPEK

var count = 3;

var indexPhoto = 1;

// celkovy pocet fotek
var photosCount = 1;

// rychlost animace fotky
var speedAnimate = 300;

// animace fotek
var photo_animate;


var counter = 0;

$(document).ready(function() {
    photo_animate = setTimeout(function() { runAnimate(); }, speedAnimate);
});

function changePhoto()
{
    indexPhoto = indexPhoto + 1;

    if (indexPhoto > photosCount) {
        indexPhoto = 1;
    }
}

function runAnimate()
{
    $("#poll span.arrow").fadeOut(speedAnimate/2);
    changePhoto();
    $("#poll span.arrow").fadeIn(speedAnimate/2);
    photo_animate = setTimeout(function() {
        counter++;

        if (count > counter) {
            runAnimate();
        } else {
            counter = 0;
            setTimeout(function() { runAnimate(); }, 5000);
        }
    }, speedAnimate);
}

// END - ANIMACE SIPEK
