//pre admimenu ddaccordion.init({ headerclass: "headerbar", //Shared CSS class name of headers group contentclass: "submenu", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover" mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: true, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["menu_close", "menu_open"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } }) ddaccordion.init({ //2nd level headers initialization headerclass: "subexpandable", //Shared CSS class name of sub headers group that are expandable contentclass: "subcategoryitems", //Shared CSS class name of sub contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["opensubheader", "closedsubheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } }) // deaktivovanie F1 pre Chrome function disableFunctionKeys(e) { var functionKeys = new Array(112, 113); // F1 if (functionKeys.indexOf(e.keyCode) > -1 || functionKeys.indexOf(e.which) > -1) { e.preventDefault(); } }; //deaktivovanie F1 pre IE if ("onhelp" in window) window.onhelp = function () { //showMyHelpInsteadOfTheUsualDefaultHelpWindow(true); return false; } // Others else { document.onkeydown = function(evt) { cancelKeypress = (evt.keyCode == 112); if (cancelKeypress) { // F1 was pressed //showMyHelpInsteadOfTheUsualDefaultHelpWindow(true); return false; } } // Additional step required for Opera document.onkeypress = function(evt) { if (cancelKeypress) return false; } } function convertNumToTime(number) { // Check sign of given number var sign = (number >= 0) ? 1 : -1; // Set positive value of number of sign negative number = number * sign; // Separate the int from the decimal part var hour = Math.floor(number); var decpart = number - hour; var min = 1 / 60; // Round to nearest minute decpart = min * Math.round(decpart / min); var minute = Math.floor(decpart * 60) + ''; // Add padding if need if (minute.length < 2) { minute = '0' + minute; } // Add Sign in final result sign = sign == 1 ? '' : '-'; // Concate hours and minutes time = sign + hour + ':' + minute; return time; } function parseDate(str) { var mdy = str.split('.'); return new Date(mdy[2], mdy[1], mdy[0]-1); } function daydiff(first, second) { return Math.floor((second-first)/(1000*60*60*24*365.25)); } function zeroPad(num, numZeros) { var n = Math.abs(num); var zeros = Math.max(0, numZeros - Math.floor(n).toString().length ); var zeroString = Math.pow(10,zeros).toString().substr(1); if( num < 0 ) { zeroString = '-' + zeroString; } return zeroString+n; } function datafromrodcislo(rodcislo) { /* setdatnar=''; if (rodcislo.length<11) { return "0||"; } dd=parseInt(rodcislo.substr(4,2)); mm=parseInt(rodcislo.substr(2,2)); yy=parseInt(rodcislo.substr(0,2)); if (parseInt(rodcislo.substr(8,1))=='1' || parseInt(rodcislo.substr(8,1))=='3' || parseInt(rodcislo.substr(8,1))=='5' || parseInt(rodcislo.substr(8,1))=='7' || parseInt(rodcislo.substr(8,1))=='9') { poh=1; } else { poh=0; } const d = new Date(); let year = parseInt(d.getFullYear().toString().substr(2,2)); if (yy < year) { setdatnar=zeroPad(dd,2)+"."+zeroPad(mm,2)+"."+d.getFullYear().toString().substr(0,2)+yy; } else { setdatnar=zeroPad(dd,2)+"."+zeroPad(mm,2)+"."+(parseInt(d.getFullYear().toString().substr(0,2))-1)+yy; } return poh+"|"+setdatnar+"|"+daydiff(parseDate(setdatnar),parseDate("30.01.2025")); // pohlavie (0-zena,1-muz) | datum narodenia DD.MM.YYYY | pocet rokov */ setdatnar=''; if (rodcislo.length<9) { return "0||"; } dd=parseInt(rodcislo.substr(4,2)); mm=parseInt(rodcislo.substr(2,2)); yy=parseInt(rodcislo.substr(0,2)); if (mm>50) { poh=1; // zmenene mm=mm-50; } else { poh=0; // zmenene } if (((rodcislo.indexOf("/")!='-1' && rodcislo.length==10) || (rodcislo.indexOf("/")=='-1' && rodcislo.length==9)) || yy>53) { setdatnar=zeroPad(dd,2)+"."+zeroPad(mm,2)+".19"+rodcislo.substr(0,2); } else { setdatnar=zeroPad(dd,2)+"."+zeroPad(mm,2)+".20"+rodcislo.substr(0,2); } return poh+"|"+setdatnar+"|"+daydiff(parseDate(setdatnar),parseDate("30.01.2025")); // pohlavie (0-zena,1-muz) | datum narodenia DD.MM.YYYY | pocet rokov } function centerintro_adminheight() { // hlavna farebna plocha v admine + loginobrazovka uvodu na stred var biely_blok = ($(window).height() - $(".vrch").height() - $(".spodok").height()); var centro = (((biely_blok)/2) - $("#center-block").height()/2 - 15); if (0>centro) { centro=0; } $('#center-block').css("top",centro); } var def_thheight,def_tdheight,def_width; function height_fixsizetable() { // fixna vyska def_thheight=0; def_tdheight=0; $(".fix_size tr th").each(function() { if ($(this).height()>def_thheight) { def_thheight=$(this).height(); } }); $(".fix_size tr td").each(function() { if ($(this).height()>def_tdheight) { def_tdheight=$(this).height(); } }); def_width=0; $(".fix_size tr th").each(function() { if ($(this).width()>def_width) { def_width=$(this).width(); } }); $(".fix_size tr td").each(function() { if ($(this).width()>def_width) { def_width=$(this).width(); } }); $(".fix_size tr th, .fix_size tr td").css("width","100%"); $(".fix_size tr th").css("height",def_thheight); $(".fix_size tr td").css("height",def_tdheight); } function width_fixsizetable() { // max sirka def_thheight=0; def_tdheight=0; $(".fix_size tr th").each(function() { if ($(this).height()>def_thheight) { def_thheight=$(this).height(); } }); $(".fix_size tr td").each(function() { if ($(this).height()>def_tdheight) { def_tdheight=$(this).height(); } }); def_width=0; $(".fix_size tr th").each(function() { if ($(this).width()>def_width) { def_width=$(this).width(); } }); $(".fix_size tr td").each(function() { if ($(this).width()>def_width) { def_width=$(this).width(); } }); $(".fix_size tr th").css("height",def_thheight); $(".fix_size tr td").css("height",def_tdheight); // $(".fix_size tr th").css("height","1"); // $(".fix_size tr td").css("height","1"); $(".fix_size tr th, .fix_size tr td").css("width",def_width); } function patchtables() { if ($(window).width()<801) { $(".fix_size").css('display','inline-block'); width_fixsizetable(); } else { $(".fix_size").css('display','inline-block'); height_fixsizetable(); } if (typeof resethidden == 'function') { // funkcia na predvolene hide po nacitani mainscreen v jednotlivych moduloch, ak existuje resethidden(); } } $(window).on("load", function(){ //pre chosen $("select").each(function(){ // kvoli cervenemu background musime mat class='required' spolus parametrom required pri selectoch if($(this).prop('required')){ $(this).addClass("required"); } }); $("select").not(".nochosen").not(".chosen8").not(".chosen14").not(".chosen20").not(".chosen50").not(".chosen30").addClass("chosen-select"); $('.chosen-select').on("change",function() { centerintro_adminheight(); }); /* var config = { '.chosen-select' : {width:"100%",search_contains: true,inherit_select_classes: true}, '.chosen8' : {width:"100%",search_contains: true,inherit_select_classes: true,max_selected_options:8}, '.chosen14' : {width:"100%",search_contains: true,inherit_select_classes: true,max_selected_options:14}, '.chosen20' : {width:"100%",search_contains: true,inherit_select_classes: true,max_selected_options:20}, '.chosen30' : {width:"100%",search_contains: true,inherit_select_classes: true,max_selected_options:30}, '.chosen50' : {width:"100%",search_contains: true,inherit_select_classes: true,max_selected_options:50}, '.chosen-select-deselect' : {allow_single_deselect:true}, '.chosen-select-no-single' : {disable_search_threshold:10}, '.chosen-select-width' : {width:"100%"} } */ var config = { '.chosen-select' : {dropdownAutoWidth : true, width: "100%"}, '.chosen8' : {dropdownAutoWidth : true, width: "100%",maximumSelectionLength:8}, '.chosen14' : {dropdownAutoWidth : true, width: "100%",maximumSelectionLength:14}, '.chosen20' : {dropdownAutoWidth : true, width: "100%",maximumSelectionLength:20}, '.chosen30' : {dropdownAutoWidth : true, width: "100%",maximumSelectionLength:30}, '.chosen50' : {dropdownAutoWidth : true, width: "100%",maximumSelectionLength:50} } for (var selector in config) { $(selector).select2(config[selector]); //$(selector).chosen(config[selector]); $(selector).each(function() { //$(this).find('option[value=""]').remove(); if($(this).prop('required')){ var selectedOptions = $(this).select2('val'); // Získaj počet vybraných položiek if (selectedOptions !='' && selectedOptions !=null) { $(this).next('.select2-container').find('.select2-selection').css('background-color', 'white'); } else { $(this).next('.select2-container').find('.select2-selection').css('background-color', '#fdd'); } } }); $(selector).on('change, change.select2', function() { if($(this).prop('required')){ var selectedOptions = $(this).select2('val'); // Získaj počet vybraných položiek if (selectedOptions !='' && selectedOptions !=null) { $(this).next('.select2-container').find('.select2-selection').css('background-color', 'white'); } else { $(this).next('.select2-container').find('.select2-selection').css('background-color', '#fdd'); } } }); } //$('.chosen-drop').css({"minWidth": "100%", "width": "auto", "white-space": "nowrap"}); // kalendar v tyzdni/dni skok na cas od 8:00 setTimeout("$('.scolltimeevent').scrollTop(330)", 1000); // zobrazenie obsahu po kompletnom nacitani $("#loading").hide(); $("#mainscreen").show(); autosize(document.querySelectorAll('textarea')); //uprava tabuliek centerintro_adminheight(); patchtables(); if (document.body.scrollHeight > document.body.clientHeight) { $(".scrollbutton2").show(); } isloaded=1; }); reloadedcal=0; isloaded=0; if (document.getElementById('mainscreen')) { document.getElementById('mainscreen').insertAdjacentHTML('beforebegin',"
Načítavam obsah
"); } $(window).on("resize", function() { centerintro_adminheight(); if (typeof loadcal == 'function') { loadcal(); } patchtables(); $(document).scroll(); }); $(".ok, .err").hide(); $(function() { //autosize(document.querySelectorAll('textarea')); $(".inline").colorbox({inline:true, width:"50%"}); $(document).on("keypress", ":input:not(textarea):not(.loginfield)", function(event) { return event.keyCode != 13; }); $('.loginfield').on("keyup", function(e) { if (e.keyCode == 13) { $("#loginbox").click(); } }); $(document).on("keyup", function(e) { if (e.keyCode == 27) { $("#ok-final").hide(); } if (e.keyCode == 36 && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { //$("#go_home")[0].click(); lebo davalo home aj ked sa kliklo s home nechtiac nejake pismeno ci znak } }); $('form :input').attr('autocomplete', 'off'); // reset autofill na post pri navrate sipkou cez prehliadac $(document).on('keydown', disableFunctionKeys); $(document).on('scroll',function(e) { if ($(document).scrollLeft()==0 && $(document).scrollTop()==0) { $(".scrollbutton").hide(); if (document.body.scrollHeight > document.body.clientHeight) { $(".scrollbutton2").show(); } else { $(".scrollbutton2").hide(); } } else { $(".scrollbutton").show(); $(".scrollbutton2").hide(); } }); $(".scrollbutton").on('click', function() { $("html, body").animate({scrollTop:0}, { duration: 333, queue: false }); $("html, body").animate({scrollLeft:0}, { duration: 333, queue: false }); $(".scrollbutton").hide(); }); $(".scrollbutton2").on('click', function() { var n = $(document).height(); $("html, body").animate({scrollTop:n}, { duration: 333, queue: false }); $("html, body").animate({scrollLeft:0}, { duration: 333, queue: false }); $(".scrollbutton").show(); $(".scrollbutton2").hide(); }); $('input[type="checkbox"]').each(function() { // kvoli stylom na checkbox ktory nema label, taks a musi dogenerovat var checkbox = $(this); var checkboxId = checkbox.attr('id'); if (!checkboxId) { checkboxId = checkbox.attr('name'); checkbox.attr('id', checkboxId); } var label = $('label[for="' + checkboxId + '"]'); if (label.length === 0) { label = $('