/// <reference path="fancybox.js" />
/// <reference path="jquery-1.5.1.min.js" />
$(document).ready(function () {

    //if ($('#regFrom').length=='1') {
    //  $("#regFrom").validate();
    //}

    // open in new window
    $('a.out, div.ourParnter a, #footer a, a.download, body#partneri td a, a.mapArr').click(function () {
        window.open($(this).attr('href'), "");
        return false;
    });

    $("div.fotogalerie a").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'speedIn': 600,
        'speedOut': 200,
        'overlayShow': false
    });

    $('a.nextContent').click(function () {
        var currentElement = $(this)[0];
        jQuery.each($('a.nextContent'), function (index, elem) {
            var loopElement = $(elem);
            if (loopElement[0] !== currentElement) {
                $(elem).removeClass("openDiv").next('div').slideUp();
            }
        });

        $(this).toggleClass('openDiv');
        $(this).next('div').slideToggle();
        return false;
    });

    $("select").change(function () {
        var str = "";
        $("select option:selected").each(function () {
            if ($(this).val() == "Pro účastníky z řad komerčních společností") {
                str = "2280";
            }
            else if ($(this).val() == 'Pro účastníky z řad státní správy') {
                str = "1200";
            }
            else if ($(this).val() == 'Pro partnery konference nad rámec „výhod partnerství“') {
                str = "1200";
            }
            else {
                str = " ";
            }
        });
        $(".txt_castka").val(str);
    })
        .change();
        
});
