﻿$(document).ready(function () {
    var bannerTimer = null;
    function show() {
        var menu = $(this);
        menu.children(".subnav").show();
    }

    function hide() {
        var menu = $(this);
        menu.children(".subnav").hide();
    }
    $(".menu-column").hover(show, hide);

    function toggleLenyilo() {
        var cikk = $(this).children("span");
        cikk.toggle('normal');
    }

    $(".lenyilo-container").hide();
    $("h3.lenyilo-trigger").click(function () {
        if ($(this).next().css('display') != 'none') {
            if ($(this).hasClass('selected')) {
                $(this).removeClass('selected');
            }
        }
        $(this).next().slideToggle("normal");

    });

    if ($(".mainBanner > div").length > 0) {
        $(".mainBanner").cycle({
            fx: 'fade',
            timeout: 3500
        });
    }
    if ($(".plansBanner > div").length > 0) {
        $(".plansBanner").cycle({
            fx: 'fade',
            timeout: 8000
        });
    }
    $("h3.lenyilo-trigger").mouseover(function () {
        if ($(this).next().css('display') == "none") {
            if (!$(this).hasClass('selected')) {
                $(this).addClass('selected');
            }
        }
    });
    $("h3.lenyilo-trigger").mouseout(function () {
        if ($(this).next().css('display') == "none") {
            if ($(this).hasClass('selected')) {
                $(this).removeClass('selected');
            }
        }
    });
});
