    /*!
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.11 (15-JUN-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */

/**
 *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
 *
 *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
 *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
 *  width:   width of the effect; in the case of rounded corners this is the radius. 
 *           specify this value using the px suffix such as 10px (yes, it must be pixels).
 */
;(function($) { 

var style = document.createElement('div').style,
    moz = style['MozBorderRadius'] !== undefined,
    webkit = style['WebkitBorderRadius'] !== undefined,
    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
    mode = document.documentMode || 0,
    noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8),

    expr = $.browser.msie && (function() {
        var div = document.createElement('div');
        try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }
        catch(e) { return false; }
        return true;
    })();

$.support = $.support || {};
$.support.borderRadius = moz || webkit || radius; // so you can do:  if (!$.support.borderRadius) $('#myDiv').corner();

function sz(el, p) { 
    return parseInt($.css(el,p))||0; 
};
function hex2(s) {
    var s = parseInt(s).toString(16);
    return ( s.length < 2 ) ? '0'+s : s;
};
function gpc(node) {
    while(node) {
        var v = $.css(node,'backgroundColor'), rgb;
        if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
            if (v.indexOf('rgb') >= 0) { 
                rgb = v.match(/\d+/g); 
                return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
            }
            return v;
        }
        if (node.nodeName.toLowerCase() == 'html')
            break;
        node = node.parentNode; // keep walking if transparent
    }
    return '#ffffff';
};

function getWidth(fx, i, width) {
    switch(fx) {
    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));
    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));
    case 'sharp':  return Math.round(width*(1-Math.cos(Math.acos(i/width))));
    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));
    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));
    case 'curl':   return Math.round(width*(Math.atan(i)));
    case 'tear':   return Math.round(width*(Math.cos(i)));
    case 'wicked': return Math.round(width*(Math.tan(i)));
    case 'long':   return Math.round(width*(Math.sqrt(i)));
    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
    case 'dogfold':
    case 'dog':    return (i&1) ? (i+1) : width;
    case 'dog2':   return (i&2) ? (i+1) : width;
    case 'dog3':   return (i&3) ? (i+1) : width;
    case 'fray':   return (i%2)*width;
    case 'notch':  return width; 
    case 'bevelfold':
    case 'bevel':  return i+1;
    }
};

$.fn.corner = function(options) {
    // in 1.3+ we can fix mistakes with the ready state
    if (this.length == 0) {
        if (!$.isReady && this.selector) {
            var s = this.selector, c = this.context;
            $(function() {
                $(s,c).corner(options);
            });
        }
        return this;
    }

    return this.each(function(index){
        var $this = $(this),
            // meta values override options
            o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
            keep = /keep/.test(o),                       // keep borders?
            cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]),  // corner color
            sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]),  // strip color
            width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10, // corner width
            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/,
            fx = ((o.match(re)||['round'])[0]),
            fold = /dogfold|bevelfold/.test(o),
            edges = { T:0, B:1 },
            opts = {
                TL:  /top|tl|left/.test(o),       TR:  /top|tr|right/.test(o),
                BL:  /bottom|bl|left/.test(o),    BR:  /bottom|br|right/.test(o)
            },
            // vars used in func later
            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;
        
        if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
            opts = { TL:1, TR:1, BL:1, BR:1 };
            
        // support native rounding
        if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
            if (opts.TL)
                $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
            if (opts.TR)
                $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
            if (opts.BL)
                $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
            if (opts.BR)
                $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
            return;
        }
            
        strip = document.createElement('div');
        $(strip).css({
            overflow: 'hidden',
            height: '1px',
            minHeight: '1px',
            fontSize: '1px',
            backgroundColor: sc || 'transparent',
            borderStyle: 'solid'
        });
    
        pad = {
            T: parseInt($.css(this,'paddingTop'))||0,     R: parseInt($.css(this,'paddingRight'))||0,
            B: parseInt($.css(this,'paddingBottom'))||0,  L: parseInt($.css(this,'paddingLeft'))||0
        };

        if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
        if (!keep) this.style.border = 'none';
        strip.style.borderColor = cc || gpc(this.parentNode);
        cssHeight = $(this).outerHeight();

        for (j in edges) {
            bot = edges[j];
            // only add stips if needed
            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
                d = document.createElement('div');
                $(d).addClass('jquery-corner');
                ds = d.style;

                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                if (bot && cssHeight != 'auto') {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.bottom = ds.left = ds.padding = ds.margin = '0';
                    if (expr)
                        ds.setExpression('width', 'this.parentNode.offsetWidth');
                    else
                        ds.width = '100%';
                }
                else if (!bot && $.browser.msie) {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
                    
                    // fix ie6 problem when blocked element has a border width
                    if (expr) {
                        bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');
                    }
                    else
                        ds.width = '100%';
                }
                else {
                    ds.position = 'relative';
                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 
                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                
                }

                for (i=0; i < width; i++) {
                    w = Math.max(0,getWidth(fx,i, width));
                    e = strip.cloneNode(false);
                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                }
                
                if (fold && $.support.boxModel) {
                    if (bot && noBottomFold) continue;
                    for (c in opts) {
                        if (!opts[c]) continue;
                        if (bot && (c == 'TL' || c == 'TR')) continue;
                        if (!bot && (c == 'BL' || c == 'BR')) continue;
                        
                        common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
                        $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
                        switch(c) {
                        case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
                        case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
                        case 'BL': $horz.css({ top: 0, left: 0 }); break;
                        case 'BR': $horz.css({ top: 0, right: 0 }); break;
                        }
                        d.appendChild($horz[0]);
                        
                        var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
                        switch(c) {
                        case 'TL': $vert.css({ left: width }); break;
                        case 'TR': $vert.css({ right: width }); break;
                        case 'BL': $vert.css({ left: width }); break;
                        case 'BR': $vert.css({ right: width }); break;
                        }
                        d.appendChild($vert[0]);
                    }
                }
            }
        }
    });
};

$.fn.uncorner = function() { 
    if (radius || moz || webkit)
        this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
    $('div.jquery-corner', this).remove();
    return this;
};

// expose options
$.fn.corner.defaults = {
    useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
    metaAttr:  'data-corner' // name of meta attribute to use for options
};
    
})(jQuery);


   
//$(document).ready(function(){ $.post(\'/admin/index.php?page='.$_GET['page'].'\', { ukon: \'addPoznamka\', id: \''.$vypis['id'].'\' }, function(data){ vlozdo(\'#notes\',data); } );  }); return false;

function hideNotes(){ $(document).ready(function(){$("#notes").fadeOut(300); $("#addNote").fadeOut(300); }); }
function hideAddNote(){ $(document).ready(function(){$("#addNote").fadeOut(300); }); }
function showAddNote(){ $(document).ready(function(){$("#addNote").fadeIn(300); });  }
function showNotes(){ $(document).ready(function(){$("#notes").fadeIn(300); }); }
function vlozdo(kam,data){ $(document).ready(function(){$(kam).html(data); }); }


 
/*********jQuery************/
$(document).ready(function(){
    $("#colorPicker").keyup(function(event)
    {
        event.preventDefault();
        alert(event.keyCode);
        $("#colorPicker").css("background-color","#"+$("#colorPicker")[0].value);
    });
    
    $("#showRightsButton").click(function(){$("#showRights").toggle();});

    $(".hromadnaAkce1").click(function() 
    { 
        $(this).find().attr("checked","true");
        
         });
    
    
    $("#hromadnaAkceOznacVse1").click(function()
    {
        var cb = $(".hromadnaAkce1"); 
        if ($(this).attr("checked")) { cb.parents('tr').css("background-color", "#f4d7a6"); cb.attr("checked","true") }
        else { cb.parents('tr').css("background-color", ""); cb.attr("checked",""); }
    });

    $("#loaddStrom").hide();
    $("#loaddStrom").slideDown(600);

    $("#add1").show();
    $("#add2").hide();
    $("#add3").hide();
    $("#add4").hide();
    $("#add5").hide();
    $("#add6").hide();
    $("#add7").hide();
    $("#add8").hide();
                                                                                                                                                                                                                    
    /*********komentare************/                                                                                                                 
    $("#editaceKomentare").hide();    
    $("#zrusitKomentovani").click(function(){
        $("#editaceKomentare").hide(500);
        $("#addKomentar").attr("value","");
        $("#predmetKomentare").attr("value","");
    });

    $("#pridatKomentarKeKomentari").click(function(){
        $("#editaceKomentare").prepend("Komentovar příspěvek od: " + $("#pridatKomentarKeKomentari").attr("jmeno"));
        $("#editaceKomentare").show(1000);
        $("#addKomentar").attr("value",$("#pridatKomentarKeKomentari").attr("idKomentare"));
        $("#predmetKomentare").attr("value","Re:" + $("#pridatKomentarKeKomentari").attr("nazev"));
    });

    /*********komentare/************/
    $("#menuTopIn1").click(function() {
        $("#add1").slideDown(500);$("#add2").hide();$("#add3").hide(); $("#add4").hide(); $("#add5").hide(); $("#add6").hide(); $("#add7").hide();
        $(this).addClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn5").removeClass("curent"); $("#menuTopIn6").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn2").click(function() {
        $("#add1").hide();$("#add2").slideDown(500);$("#add3").hide(); $("#add4").hide(); $("#add5").hide(); $("#add6").hide(); $("#add7").hide();  
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn5").removeClass("curent"); $("#menuTopIn6").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn3").click(function() {
        $("#add1").hide();$("#add2").hide();$("#add3").slideDown(500); $("#add4").hide(); $("#add5").hide(); $("#add6").hide(); $("#add7").hide(); 
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn5").removeClass("curent");$("#menuTopIn6").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn4").click(function() {
        $("#add1").hide();$("#add2").hide();$("#add3").hide(); $("#add4").slideDown(500); $("#add5").hide(); $("#add6").hide(); $("#add7").hide();
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn5").removeClass("curent"); $("#menuTopIn6").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn5").click(function() {
        $("#add1").hide();$("#add2").hide();$("#add3").hide(); $("#add4").hide(); $("#add5").slideDown(500); $("#add6").hide(); $("#add7").hide();
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn6").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn6").click(function() {
        $("#add1").hide();$("#add2").hide();$("#add3").hide(); $("#add4").hide(); $("#add5").hide(); $("#add6").slideDown(500); $("#add7").hide();
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn5").removeClass("curent"); $("#menuTopIn7").removeClass("curent");} );
    $("#menuTopIn7").click(function() {
        $("#add1").hide();$("#add2").hide();$("#add3").hide(); $("#add4").hide(); $("#add5").hide(); $("#add6").hide(); $("#add7").slideDown(500); 
        $(this).addClass("curent"); $("#menuTopIn1").removeClass("curent"); $("#menuTopIn2").removeClass("curent"); $("#menuTopIn3").removeClass("curent"); $("#menuTopIn4").removeClass("curent"); $("#menuTopIn5").removeClass("curent"); $("#menuTopIn6").removeClass("curent"); } ); 

     
});

/*********jQuery/************/ 

function checkCheckbox(id) 
{
    if(document.getElementById(id).checked!="checked") document.getElementById(id).checked="checked";
    else document.getElementById(id).checked="";     
}
function addFotoFromURL() 
{
  var ni = document.getElementById('kolonkyurl');
  var numi = document.getElementById('inkrurl');
  var num = (document.getElementById('inkrurl').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'kolonkaurl'+num;
  
  newdiv.setAttribute('id',divIdName);
  newdiv.setAttribute('class','kolony'); 
  newdiv.innerHTML = '<input type="text" size="50" name="fotoFromURL' + num + '" /> <input type="button" class="buttonClose" onclick=\'removeElementURL("'+divIdName+'")\'>';
  ni.appendChild(newdiv);
}
function addOption() 
{                                                                                                
  var ni = document.getElementById('kolonky');
  var numi = document.getElementById('inkr');
  var num = (document.getElementById('inkr').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'kolonka'+num;
  
  newdiv.setAttribute('id',divIdName);
  newdiv.setAttribute('class','kolony'); 
  newdiv.innerHTML = num +'. možnost&nbsp;&nbsp;&nbsp;<input type="text" size="40" name="moznosti[]" /> <input type="button" class="buttonClose" onclick=\'removeElement("'+divIdName+'")\'>';
  ni.appendChild(newdiv);
}
function addElement() 
{
  var ni = document.getElementById('kolonky');
  var numi = document.getElementById('inkr');
  var num = (document.getElementById('inkr').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'kolonka'+num;
  
  newdiv.setAttribute('id',divIdName);
  newdiv.setAttribute('class','kolony'); 
  newdiv.innerHTML = '<input type="file" size="40" name="foto_m' + num + '" /> <input type="button" class="buttonClose" onclick=\'removeElement("'+divIdName+'")\'>';
  ni.appendChild(newdiv);
}
function rozbalAdd(cis) 
{
  var ni = document.getElementById('polozka_'+cis);
  var numi = document.getElementById('inkr'+cis);
  var num = (document.getElementById('inkr'+cis).value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'kolonka'+cis+num;
  newdiv.setAttribute('id',divIdName);
  newdiv.setAttribute('class','kolony');
  newdiv.innerHTML = '<input type="text" size="30" name="add*' + cis + "*" + num + '" /> <input type="button" class="buttonClose" onclick=\'rozbalDel("'+divIdName+'","polozka_'+ cis+'")\'>';
  ni.appendChild(newdiv);
}
function rozbalDel(divNum,nameElement) 
{
  var d = document.getElementById(nameElement);
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}
function rozbalEdit(cis,val) 
{
  
  var ni = document.getElementById('polozka_' + cis);
  var newdiv = document.createElement('div');
  var divIdName = 'kolonka'+cis;
  if (document.getElementById('iff'+cis).value==0 )
  {
      newdiv.setAttribute('id',divIdName);
      newdiv.setAttribute('class','kolony');
      newdiv.innerHTML = '<input type="text" size="30" value="' + val + '" name="edit*' + cis + '" /> <input type="button" class="buttonClose" onclick=\'smazEdit("'+divIdName+'","'+ cis+'")\'>';
      ni.appendChild(newdiv);
      document.getElementById('iff'+cis).value=1;
  }
  else
  {
      var d = document.getElementById('polozka_' + cis);
      var olddiv = document.getElementById(divIdName);
      d.removeChild(olddiv);
      document.getElementById('iff'+cis).value=0;
  }
}
function smazEdit(divNum,cis) 
{
     var d = document.getElementById('polozka_'+cis);
     var olddiv = document.getElementById(divNum);
     d.removeChild(olddiv);
     document.getElementById('iff'+cis).value=0;
}
function addNextTwoInputElement(bufferID,tableID,trID,name1,name2)  
{
  var ni = document.getElementById(tableID);
  var numi = document.getElementById(bufferID);
  var num = (document.getElementById(bufferID).value -1)+ 2;
  numi.value = num;
  var newtr = document.createElement('li');
  var trIdName = trID + num;
  newtr.setAttribute('id',trIdName);
  newtr.innerHTML = ' <input type="text" name="' + name1 + num + '" /> <input type="text" name="' + name2 + num + '" /><span><input type="button" class="buttonClose" onclick=\'removeTwoInputElement("'+trIdName+'","' + tableID + '")\';><img src="/admin/images/move.png" class="move"/></span>';
  ni.appendChild(newtr);
}
function removeTwoInputElement(trNum,tableID) 
{
  var d = document.getElementById(tableID);
  var oldtr = document.getElementById(trNum);
  d.removeChild(oldtr);
}

function addNextSlevaInput() 
{
  var ni = document.getElementById('slevy');
  var numi = document.getElementById('inkSlevy');
  var num = (document.getElementById('inkSlevy').value -1)+ 2;
  numi.value = num;
  var newtr = document.createElement('tr');
  var trIdName = 'slevaInput'+num;
  newtr.setAttribute('id',trIdName);
  newtr.innerHTML = '<td class="id">'+ num +'</td><td class="slevy"><input type="text" name="od' + num + '" /></td><td class="slevy"><input type="text" name="do' + num + '" /></td><td class="slevyy"><input type="text" name="percent' + num + '" /></td><td class="aplik"><input type="checkbox" name="aplikovatNaNeregistrovane' + num + '" value="true" /></td><td class="delete"><input type="button" class="buttonClose" onclick=\'removeSlevaInput("'+trIdName+'")\';></td>';
  ni.appendChild(newtr);
}
function removeSlevaInput(trNum) 
{
  var d = document.getElementById('slevy');
  var oldtr = document.getElementById(trNum);
  d.removeChild(oldtr);
}


function removeElementURL(divNum) 
{
  var d = document.getElementById('kolonkyurl');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}
function removeElement(divNum) 
{
  var d = document.getElementById('kolonky');
  var olddiv = document.getElementById(divNum);
  d.removeChild(olddiv);
}


function addNextDPHInput() 
{
  var ni = document.getElementById('DPHs');
  var numi = document.getElementById('inkDPH');
  var num = (document.getElementById('inkDPH').value -1)+ 2;
  numi.value = num;
  var newtr = document.createElement('tr');
  var trIdName = 'DPHInput'+num;
  newtr.setAttribute('id',trIdName);
  newtr.innerHTML = '<td class="id">-</td><td class="slevy"><input type="text" name="nazev' + num + '" /></td><td class="slevy"><input type="text" name="hodnota' + num + '" /></td><td class="delete"><input type="button" class="buttonClose" onclick=\'removeDPHInput("'+trIdName+'")\';></td>';
  ni.appendChild(newtr);
}
function removeDPHInput(trNum) 
{
  var d = document.getElementById('DPHs');
  var oldtr = document.getElementById(trNum);
  d.removeChild(oldtr);
}

 
function deleteQuestion(question,delUrl,otazka) 
{
    if(otazka != '0') pom = " Operace už se nedá vrátit !";  else pom="";
    var de = confirm(question + pom); 
    if (de) location=delUrl;
}

function stav (text,kam)
{
    document.getElementById(kam).innerHTML=text-1;    
}

function progress_bar (text,kam)
{
    document.getElementById(kam).innerHTML='<div id="loading"><img src="/admin/images/loading.gif" />' + text + '</div>';    
}

function vymaz(kde)
{
	document.getElementById(kde).innerHTML="";
}

function hide(id)
{
    $(document).ready(function() { $(id).hide(); });
}
function uav(co,kam,load,text,typ,pom)
{ 
  if (typ=="whisper")
  {
    document.getElementById(load).innerHTML='<img src="/admin/images/loadingmin.gif" />';
    $(document).ready(function() { $('#'+kam).hide(); $('#'+kam).fadeIn(400); });
  }  
  else document.getElementById(load).innerHTML='<div style="border:1px solid black;font-size:20px;padding:10px 15px 5px 10px;height:30px;background-color:#FFFFFF;"><img style="float:left;margin:-6px 20px 0 0;" src="/admin/images/loading.gif" />' + text + '</div>';
  
  var url=co;
  if (window.ActiveXObject)
  {
    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
  }
  else
  {
    httpRequest = new XMLHttpRequest();
  }
  httpRequest.open("GET", url, true);
  if(kam!="")
    httpRequest.onreadystatechange = function () {processsRequest(kam,load);};
  httpRequest.send(null);
}

function processsRequest(kam,load)
{
  if (httpRequest.readyState == 4)
  {
    if(httpRequest.status == 200)
    {
      var mistoZobrazeni = document.getElementById(kam);
      mistoZobrazeni.innerHTML = httpRequest.responseText;
      document.getElementById(load).innerHTML='';
    }
    else
    {
      alert("Chyba při načítání stránky, opakujte akci..."+ httpRequest.status +":"+ httpRequest.statusText);
      document.getElementById(load).innerHTML='';
    }
  }
}

tinyMCE.init({ mode : "exact",elements : "tmSimple", theme : "simple"});
tinyMCE.init({ mode : "exact",elements : "tmSimple1", theme : "simple"});
tinyMCE.init({ mode : "exact",elements : "tmSimple2", theme : "simple"});
tinyMCE.init({ mode : "exact",elements : "tmSimple3", theme : "simple"});

tinyMCE.init({
        // General options
        mode : "exact",
        elements : "tm1",
        entity_encoding : "raw",
        theme : "advanced",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
        
        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });
tinyMCE.init({
        // General options
        mode : "exact",
        elements : "tm2",
        entity_encoding : "raw",
        theme : "advanced",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
        
        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });
    tinyMCE.init({
        // General options
        mode : "exact",
        elements : "tm3",
        entity_encoding : "raw",
        theme : "advanced",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
        
        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });
tinyMCE.init({
        // General options
        mode : "exact",
        elements : "tm4",
        entity_encoding : "raw",
        theme : "advanced",
        plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
        
        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/content.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        }
    });

