<!--
function blick(eleId){
	if(document.getElementById(eleId).style.display == 'none'){
		document.getElementById(eleId).style.display = 'block';
	}else{
		document.getElementById(eleId).style.display = 'none';
	}
}

function show(eleId){
		document.getElementById(eleId).style.display = 'block';
}

function hide(eleId){
		document.getElementById(eleId).style.display = 'none';
}

function show_cal(eleId, maxc){
	for(x = 1; x <= maxc; ++x){
		document.getElementById('cal_'+x).style.display = 'none';
	}

	if(document.getElementById(eleId).style.display == 'none'){
		document.getElementById(eleId).style.display = 'block';
	}else{
		document.getElementById(eleId).style.display = 'none';
	}
}

function enter_handler(){
	if(this.event.keyCode == 13){
		document.getElementById('formular').action = document.getElementById('formular').action+'?no_redir=TRUE';
	}
}

function dtimer(){
	window.setTimeout(delay_submit, 500);
}

function delay_submit(){
	document.getElementById('kolik').form.submit();
}

function check_flip(eleId){
	if(document.getElementById(eleId).checked != 1){
		document.getElementById(eleId).checked = 1;
	}else{
		document.getElementById(eleId).checked = 0;
	}
}

function check(eleId){
	document.getElementById(eleId).checked = 1;
}

function pic_window(picfile, picwidth, picheight){
	window.open('pic_window.php?pic='+picfile, 'picwindow', 'width='+picwidth+',height='+picheight+'');
}

var setValTime = false;
var stopTimeout = false;

function set_value_time (eleId, thisId, addi, timeval, sec){
	if(setValTime != false){
		clearTimeout(clTimeOut);
	}

	if(document.getElementById(eleId).value == ''){
		document.getElementById(eleId).value = addi + document.getElementById(thisId).value;
	}

	var toeval = "var "+timeval+" = set_value_time ('"+eleId+"', '"+thisId+"', '"+addi+"', '"+timeval+"', "+sec+")";

	if(stopTimeout == false){
		window.setTimeout(toeval, sec);
	}
}

//HODINY
timeOutRunns = false;

function updateClock(eleId) {
	if(timeOutRunns != false){
		clearTimeout(clTimeOut);
	}

	var clock = new Date();
   	var hours = clock.getHours() + '';
   	var minutes = clock.getMinutes() + '';
   	var seconds = clock.getSeconds() + '';

   	if(seconds.length == 1){
   		seconds = '0' + seconds;
   	}

   	if(minutes.length == 1){
   		minutes = '0' + minutes;
   	}

   	if(hours.length == 1){
   		hours = '0' + hours;
   	}

   	var timeStr = hours + ':' + minutes + ':' + seconds;
	document.getElementById(eleId).innerHTML = '';
   	document.getElementById(eleId).innerHTML = timeStr;

   	clTimeOut = setTimeout("updateClock('clocktext')", 1000);
   	timeOutRunns = true;
}

function open_dialog(tgtfile){
	var filenam = tgtfile.split('.');
	window.open(tgtfile, 'win_'+filenam[0], 'width=620,height=500,top=300,left=300,scrollbars=yes,status=yes');
	window.name = 'refWindow';
}

function find_frame(eleId, tEleId, findFile, id, lan){
	var ceval = "window.top."+eleId+".location.href = '"+findFile+"?pid="+id+"&target="+tEleId+"&LANG="+lan+"'";
	//alert(ceval);
	eval(ceval);
}

function menudot_on(eleId){
	document.getElementById(eleId).className = 'menudotr hand'
}

function menudot_off(eleId){
	document.getElementById(eleId).className = 'menudot hand'
}

function delete_pic(pid){
	sstring = window.location.href;
	sstring = sstring.split('?');
	sstring = sstring[0];
	document.getElementById('blankform').action = sstring+'?del_img='+pid;
	document.getElementById('blankform').submit();
}

//check form
function change_options(fromId, toId, opt_array, cond) {
	try {
		var fromBox = document.getElementById(fromId);
		var selected = fromBox.options[fromBox.options.selectedIndex];
		var toBox = document.getElementById(toId);
		var len = toBox.options.length;

		for(i = len - 1; i > -1; i--) {
			if (toBox.options[i].value != 0) {
				toBox.options[i] = null;
			}
		}
		var x = toBox.options.length;

		for(i = 0; i < eval(opt_array).length; i++) {
			if (eval(opt_array)[i][cond] == selected.value) {
				toBox[x] = new Option(eval(opt_array)[i]['name']+' '+eval(opt_array)[i]['surname']+' - '+eval(opt_array)[i]['position'], eval(opt_array)[i]['id']);
				x++;
			}
		}

		toBox.options.selectedIndex = 0;
	}
	catch(oException) {

	}
}

function check_rights_col(eleId, rows)	{
	var col_checked = true;
	var boxes = new Array();
	var x = 0;

	for(i = 0; i < rows; i++) {
		if (document.getElementById(eleId+'_'+i)) {
			boxes[x] = document.getElementById(eleId+'_'+i);
			if (!boxes[x].checked) {
				col_checked = false;
			}
			x++;
		}
	}

	for(i = 0; i < boxes.length; i++) {
		if (col_checked) {
			boxes[i].checked = false;
		}
		else {
			boxes[i].checked = true;
		}
	}
}

function check_confirm(formname, question, param, fillin_msg){
	chv = check_req_values(formname, fillin_msg, 1);
	mform = document.forms[formname]

	if(chv == true){
		if(confirm(question)){
			mform.action = mform.action+param;
		}
		return true;
	}else{
		alert(fillin_msg);
		return(false);
	}
}

function check_req_values(formname, fillin_msg, noalert) {
	var to_return = true;
	var alerted = false;
	var focused = false;

	if (window.to_check_array) {
		for(i = 0; i < to_check_array.length; i++) {
			element = 'document.forms[\''+formname+'\'].'+to_check_array[i];

			if (eval(element)) {
				var ww_el = false;

				//if wysiwyg element
				if (document.getElementById('_'+to_check_array[i]+'_editor')) {
					ww_el = document.getElementById('_'+to_check_array[i]+'_editor');
				}
				eval_str = element+'.value';

				if (eval(eval_str) === '') {
					if (!alerted) {
						if(!noalert)alert(fillin_msg);
						alerted = true;
						to_return = false;
					}
					if (!focused) {
						//if wysiwyg element
						if (ww_el) {
							// if textarea mode
							if (ww_el.tagName.toLowerCase() == 'textarea') {
								ww_el.focus();
							}
							else {
								ww_el.contentWindow.document.body.focus();
							}
							focused = true;
						}
						else {
							try {
								eval(element+'.focus()');
								focused = true;
							}
							catch(oException) {
								//alert(element+'.focus() - '+oException.msg);
							}
						}
					}

					//if wysiwyg element
					if (ww_el) {
						// if textarea mode
						if (ww_el.tagName.toLowerCase() == 'textarea') {
							ww_el.style.background = '#F88153';
						}
						else {
							ww_el.contentWindow.document.body.style.background = '#F88153';
						}
					}
					else {
						try {
							eval(element+'.style.background = \'#F88153\'');
						}
						catch(oException) {
							//alert(element+'.style.background - '+oException.msg);
						}
					}
				}
				else {
					//if wysiwyg element
					if (ww_el) {
						// if textarea mode
						if (ww_el.tagName.toLowerCase() == 'textarea') {
							ww_el.style.background = '#FFFFFF';
						}
						else {
							ww_el.contentWindow.document.body.style.background = '#FFFFFF';
						}
					}
					else {
						try {
							eval(element+'.style.background = \'#FFFFFF\'');
						}
						catch(oException) {
							//alert(element+'.style.background - '+oException.msg);
						}
					}
				}
			}
		}
	}
	return to_return;
}

//image editor
function dialogReturn(path, width, height, bpath, bwidth, bheight, palign, flow, showAnchor) {
	if(palign == 'left'){
		if(flow == 0){
			htmlCode = '<div align="left"';
		}else{
			htmlCode = '<div style="float:left;"';
		}
	}
	if(palign == 'right'){
		if(flow == 0){
			htmlCode = '<div align="right"';
		}else{
			htmlCode = '<div style="float:right;"';
		}
	}
	htmlCode = htmlCode+'>'

	if (showAnchor == 1) {
		htmlCode = htmlCode+'<a href="javascript:pic_window3(\''+bpath+'\', '+bwidth+', '+bheight+');">';
	}
	htmlCode = htmlCode+'<img src="'+path+'" width="'+width+'" height="'+height+'" alt="" class="pic">';
	if (showAnchor == 1) {
		htmlCode = htmlCode+'</a>';
	}

	htmlCode = htmlCode+'</div>'

	window.returnValue = htmlCode;
	window.close();
}

//-->
