<!--

/*
 * drobne funkce aplikace...
 * ---------------------------------------------------------
 *
 */

vSuppOK = (
	((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) >= 3 )) ||
	((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 4 ))
);

var defStatus = '';

var statTimer = null;				//...timer - smazani status row
var statTimerRunning = false;			//...timer jede
var statNoTimer = false;			//...timer potlacen, nevyvolava se (Start)

//...odpoved
	function doChallengeResponse() {
		if (document.login.hit.value == 0) {
			document.login.hit.value = 1;

			str = document.login.password.value + ":" + document.login.challenge.value;
			document.login.response.value = MD5(str);
			document.login.password.value = "";
			document.login.screenwidth.value = screen.width;
			document.login.submit();
		}
	}

	function confirmationYes() {
		if (document.confirmation.hit.value == 0) {
			document.confirmation.hit.value = 1;

			document.confirmation.confirmed.value = 1;
			document.confirmation.submit();
		}
	}

	function confirmationNo() {
		if (document.confirmation.hit.value == 0) {
			document.confirmation.hit.value = 1;

			document.confirmation.confirmed.value = 0;
			document.confirmation.submit();
		}
	}

	function confirmaction(txt) {
		if (document.confirmation.hit.value == 0) {
			document.confirmation.hit.value = 1;

			document.confirmation.action.value = txt;
			document.confirmation.submit();
		}
	}

//...stav a logovani
	function setStat(txt) {		//...prepina prostor pro mouseover
		var stbar = document.getElementById('headMOver');
		stbar.innerHTML = txt;
		if (!statNoTimer) {
			if (statTimerRunning) {
				window.clearTimeout(statTimer);
			}
			if (txt != defStatus) {
				statTimer = window.setTimeout('setStat(defStatus, 1)', 999);
				statTimerRunning = true;
			} else statTimerRunning = false;
		}
	}

//...drobnosti
	function noteFocus(item) {
		try {
			var ret = document.getElementById(item.name + 'Note');
			if (ret) {
				ret.style.color = "#999";
			}
		} catch (e) {
			return;
		}
	}

	function noteBlur(item) {
		try {
			var ret = document.getElementById(item.name + 'Note');
			if (ret) {
				ret.style.color = "white";
			}
		} catch (e) {
			return;
		}
	}

	function moFocus(item) {
		try {
			var ret = document.getElementById(item + 'Mover');
			if (ret) {
				ret.style.color = "#A08572";
			}
		} catch (e) {
			return;
		}
	}

	function moBlur(item) {
		try {
			var ret = document.getElementById(item + 'Mover');
			if (ret) {
				ret.style.color = "white";
			}
		} catch (e) {
			return;
		}
	}

	function SwapAutNames() {
		var val = document.forms['autsetting'].elements['fname'].value;
		document.forms['autsetting'].elements['fname'].value = document.forms['autsetting'].elements['lname'].value;
		document.forms['autsetting'].elements['lname'].value = val;
	}

	function changeClass(combo, artkey, atype, paraid) {
		try {
			var sclass = combo.options[combo.selectedIndex].value;
			var url = "/editor.php?artkey=" + artkey + "&type=" + atype + "&paraid=" + paraid + "&paraclass=" + sclass  + "&action=chtype";
			location.href = url;
		} catch (e) {
			return;
		}
	}

	function layComboChng(formname, valname, val, valtxt) {
		try {
			document.forms[formname].elements[valname].value = val;
			var ret = document.getElementById(formname + '_' + valname);
			if (ret) {
				ret.innerHTML = valtxt;
			}
		} catch (e) {
			return;
		}
	}

	function addRoleSubmit() {
		document.allactions.expiration.value = document.expform.expire.value;
		sendAllActAction('addrole');
	}

	function addTopenSubmit() {
		document.allactions.topen.value = document.topenfrm.topen.value;
		sendAllActAction('setraters');
	}

	function photoTagsCopy(addtags) {
		document.allactions.keyw.value = document.keyform.keyw.value;
		sendAllActAction(addtags ? 'addtags' : 'droptags');
	}

//...fce specificke pro revisions

	function callUploadAttachment(mode) {
		try {
			if (document.reviewform.hit.value == 0) {
				document.reviewform.hit.value = 1;
				document.reviewform.showupload.value = mode;
				document.reviewform.submit();
			}
		} finally {;
		};
	}

//-->


