<!--
 function recount(obj,vystup) {   var box=obj.val();   var count= box.length;   vystup.html(count);   return false; } function reply(id,uid) {   $('#text').val($('#text').val() + '[reply="'+id+':'+uid+'"]\n');  } $(document).ready(function() {   if($('#new_tema').length) {     recount($('#count_tnazev'),$('#count_nazev'));     recount($('#count_tpopis'),$('#count_popis'));                  $("#count_tnazev").keyup(function() {        recount($(this),$('#count_nazev'));     });     $("#count_tpopis").keyup(function() {        recount($(this),$('#count_popis'));     });   } }); $(document).ready(function() {   if(!$('#new_tema_odeslano').length) {     $('#new_tema').hide();     $('.show_nove_tema').click(function() {       $('#new_tema').show(600);     });   } }); $(document).ready(function() {   $('.pridani_form').css("height", "0");   $('.pridani_form2').css("height", "0");      $('#show_pridani_form').click(function() {     h = $('.pridani_form').height();     h2 = $('.pridani_form2').height();     if(h<30) {       if(h==0) {         $('.pridani_form2').animate({"height": "-=30px"}, "slow", function() {           $('.pridani_form').animate({"height": "+=30px"}, "slow");         });       }     } else {       $('.pridani_form').animate({"height": "-=30px"}, "slow");     }   });      $('#show_pridani_form2').click(function() {     h = $('.pridani_form2').height();     h2 = $('.pridani_form').height();     if(h<30) {       if(h==0) {         $('.pridani_form').animate({"height": "-=30px"}, "slow", function() {           $('.pridani_form2').animate({"height": "+=30px"}, "slow");         });       }     } else {       $('.pridani_form2').animate({"height": "-=30px"}, "slow");     }   }); }); function hidden_show(obj) {   h = obj.height();   if(h<30) {     obj.animate({"height": "+=30px"}, "slow");   } else {     obj.animate({"height": "-=30px"}, "slow");   } }; function doSetCaretPosition (oField, iCaretPos) {         if (document.selection) {                 oField.focus ();                 var oSel = document.selection.createRange();                 oSel.moveStart ('character', -oField.value.length);                 oSel.moveStart ('character', iCaretPos);         oSel.moveEnd ('character', 0);         oSel.select ();     }         else if (oField.selectionStart || oField.selectionStart == '0') {         oField.selectionStart = iCaretPos;         oField.selectionEnd = iCaretPos;         oField.focus ();     } } $(document).ready(function() {   $('.pridani_h_form').css("height", "0");   $('#show_pridani_h_form').click(function() {return hidden_show($('.pridani_h_form')); });   $('.pridani_o_form').css("height", "0");   $('#show_pridani_o_form').click(function() {return hidden_show($('.pridani_o_form')); });      $('.sync').click(function() {     $('.window').css('display', 'block');     $('.progress').css('display', 'block');     $.ajax({       url: './sync.php',       success: function(data){         datas = data.split(':');         $('.promena1').html(datas[0]);         $('.promena2').html(datas[1]);       },       complete: function(data){         $('.window').css('display', 'none');         $('.progress').css('display', 'none');       },       error: function(x,err,a){       }     });     return false;   });      $('div.adm_akce').hide();   $('a.a-nastroje').click(function() {     var objekt = $(this).parent().parent().parent().parent().find('div.adm_akce');     objekt.toggle('slow');   });      $('#bgcolor').ColorPicker({   	onSubmit: function(hsb, hex, rgb, el) {   		$(el).val(hex);   		$(el).ColorPickerHide();   	},   	onBeforeShow: function () {   		$(this).ColorPickerSetColor(this.value);   	}   })   .bind('keyup', function(){   	$(this).ColorPickerSetColor(this.value);   });        if($('.napsat_prispevek').length) {     recount($("#bbcode"),$('#count_text'));     $("#bbcode").keyup(function() {        recount($(this),$('#count_text'));     });   }           if($('#bbcode').length) {     $('#bbcode').markItUp(mySettings);          /*     $('#emoticons a').click(function() {         emoticon = $(this).attr("title");         $.markItUp( { replaceWith:emoticon } );     });     */   }        $('textarea[maxlength]').keyup(function(){       var limit = parseInt($(this).attr('maxlength'));       var text = $(this).val();       var chars = text.length;       if(chars > limit){         var new_text = text.substr(0, limit);         $(this).val(new_text);       }     });           if($('#is_reply').length) {     $("#bbcode").focus();     doSetCaretPosition(document.getElementById("bbcode"),60000);   }      $("a.obr").fancybox();    });   //-->
