$(document).ready(function ($) {

    $('#tabs-info').tabs({ cookie: { expires: 30} });

    $("#selectCountry").hover(
        function () {
            $("#bigCountry").show();
        },
        function () {
            $("#bigCountry").hide();
        }
        );

    $("#bigCountry").hover(
        function () {
            $(this).show();
        },
        function () {
            $(this).hide();
        }
        );
    $("#areaClose").click(
        function () {
            $("#euroCountry").hide();
        }
        );

    $("#bigCountry").click(
        function () {
            $("#euroCountry").show();
        }
        );

    $("#euroCountry").hover(
        function () {


        },
        function () {
            $("#euroCountry").hide();
        }
        );

    $(".areaNon").hover(
        function () {
            $("#euroCountry").show();
        },
        function () {

        }
        );

    $(".userRegistrationButtonText").click(
        function () {
            if (validateUserRegistrationForm("#userRegistrationFormSend"))
                $("#userRegistrationFormSend").submit();
        }
        );

    /*
    $('#tabs-info').tabs({
    selected: 3,
    cookie: { expires: 30}
    });
    */
    $('#goHome').click(function () {

        window.location.href = '/?homeReset=1';
    });

    /*
    $('.infoTab').click(function () {



    var tabId = $(this).attr('id');
    var link = $('.moreLink'+tabId).attr('href')        

    window.location.href = link;
    });
    */

    $('#frmform-addeshop_kratky_popis').livequery("keyup", function (event) {
        event.preventDefault();

        var max = 160;
        var val = $(this).val();        

        if (val.length > max) {
            $(this).val(val.substring(0, max));

        }

    });


    // e-shop checkbox
    $("#frmform-addeshop_affiliate").livequery("change", function (event) {
        event.preventDefault();


        if ($(this).attr('checked')) {

            $('.eshopHide').parent('td').parent('tr').hide();

        } else {

            $('.eshopHide').parent('td').parent('tr').show();
        }

    });


    $().piroBox({
        my_speed: 300, //animation speed
        bg_alpha: 0.5, //background opacity
        radius: 4, //caption rounded corner
        scrollImage: false, // true == image follows the page _|_ false == image remains in the same open position
        // in some cases of very large images or long description could be useful.
        slideShow: 'true', // true == slideshow on, false == slideshow off
        slideSpeed: 3, //slideshow
        pirobox_next: 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
        pirobox_prev: 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
        close_all: '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
    });






});

