/* najit vsecky a class=now a umrtvit obrazky pred a za nima */
function hide_bars(){
	var anchors = document.getElementsByTagName('a');
	for(var i =0; i < anchors.length; i++){
		var a = anchors[i];
		var trida = a.getAttribute('class');
		if(trida == 'now'){
			var p = a.parentNode;
			var children = [];
			/* vyhazet nesmysly */
			for(j =0; j < p.childNodes.length; j++){
				if(p.childNodes[j].tagName){
					children.push(p.childNodes[j]);
				}
			}
			/* schovat ty za */
			for(var j= children.length-1; j > 0; j--){
				if(a == children[j-1] && 
					children[j].getAttribute('alt') == 'delimiter'){
					children[j].style.display='none';
				}
					
			}
			/* schovat ty pred */
			for(var j= children.length-1; j > 0; j--){
				if(a == children[j] && 
					children[j-1].getAttribute('alt') == 'delimiter'){
					children[j-1].style.display='none';
				}
			}
		} 
	}
	return null;
}

function char_counter(cnt) {
  if(cnt==0) {
     return 'Napsáno 0 znaků, zbývá: 1530 znaků, zpráva bude poslána v 1 zprávě';
  } else {
       write = cnt;
       left = 1530 - cnt;
       if(write <= 160) {
        msg_count = 'v 1 zprávě';
    } else {
       msg_count = Math.ceil(write / 153);
       if(msg_count < 5) {
         msg_count = "ve "+msg_count+" SMS";
       } else {
         msg_count = "v "+msg_count+" SMS";
       }
    }      
    if(left == 1) {
        write += ' znaků';
        left += ' znak';
    } else if(left > 1 && left < 5) {
        write += ' znaků';
        left += ' znaky';
    } else {
        if(write == 1) {
            write += ' znak';
        } else if(write > 1 && write < 5) {
           write += ' znaky';
        } else {
           write += ' znaků';
        }
    left += ' znaků';
    }
  return "Napsáno "+write+", zbývá: "+left+", zpráva bude poslána "+msg_count;
  }
}

/* Czech initialisation for the jQuery UI date picker plugin. */
/* Written by Tomas Muller (tomas@tomas-muller.net). */
jQuery(function($){
	$.datepicker.regional['cs'] = {
		closeText: 'Zavřít',
		prevText: '&#x3c;Dříve',
		nextText: 'Později&#x3e;',
		currentText: 'Nyní',
		monthNames: ['leden','únor','březen','duben','květen','červen',
        'červenec','srpen','září','říjen','listopad','prosinec'],
		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
		'čvc','srp','zář','říj','lis','pro'],
		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
		weekHeader: 'Týd',
		dateFormat: 'dd.mm.yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['cs']);
});


