/**
* Tyni MC nastaví editor tiny pro všechyn textareas s třídou tyni
*/

tinyMCE.init({
    language: "cs",
    mode : "textareas",
    theme : "advanced",
    plugins : "insertdatetime",
    entity_encoding : "raw",   //zakáže převod diakritických znaků na entity
    editor_selector : "tyni", //vybere požadovaný class
    theme_advanced_toolbar_location : "top",
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,hr,formatselect,forecolor,backcolor,|,insertdate,|,bullist,numlist,link,unlink,|,search,replace,|,code",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true
});

function toggleEditor(id) {
    if (!tinyMCE.get(id))
        tinyMCE.execCommand('mceAddControl', false, id);
    else
        tinyMCE.execCommand('mceRemoveControl', false, id);
}

//---Datepicker pro formuláře nette----------------------------------------------------------------------
$("input.datepicker").live('hover', function(){
        $(this).datepicker({
        duration: 'fast',
        showButtonPanel: true,
        changeMonth: true,
        changeYear: true
    });
    });

//---Gridito---------------------------------------------------------------------------------------------

$(function () {
    $("div.gridito").gridito();
});

//---Mizení flash zpráviček jQuereyUi-------------------------------------------------------------------
$(function() {
    // run the currently selected effect
    function runEffect() {
      $('#zpravy').show('slow',function(){
        $(this).slideUp(600)
    })
    };
    $( "#zpravy" ).live('mouseover',function() {
        runEffect();

        return false;
    });
});

//---Ajax v odkazech -----------------------------------------------------------------------------------
$(function(){
    $('a.ajax').live('click',function(){
        $.get(this.href);
        return false;
    })
});

//--- AJAXové odeslání formulářů -----------------------------------------------------------------------

$("form.ajax").live("submit", function () {
    $(this).ajaxSubmit();
    return false;
});

$("form.ajax :submit").live("click", function () {
    $(this).ajaxSubmit();
    return false;
});

        
//---jQuery Tabs ---------------------------------------------------------------------------------------
$(function() {
    $( "#tabs" ).tabs();
});





