function checkBox(e, id) {
	if(e.src.search("active") > -1) {
		e.src = "/" + path + "images/control/checkbox.gif";
		document.getElementById(id).value = 0;
	} else {
		e.src = "/" + path + "images/control/checkbox_active.gif";
		document.getElementById(id).value = 1;
	}
}

function focusError(e, color) {
	e.focus();
	if(color == "red") { startColor = "FF0000"; }
	if(color == "green") { startColor = "00FF00"; }
	if(color == "blue") { startColor = "0000FF"; }
	var finalColor = "";//e.style.backgroundColor;
	if(finalColor == "") { finalColor = "FFFFFF"; }
	bgChanger(e, startColor, finalColor, 25)
}

function numberOnly(text) {
	if(text != "") {
		return text.match(new RegExp("^[0-9 ]+$"));
	} else {
		return true;
	}
}

function alphaOnly(text) {
	if(text != "") {
		return text.match(new RegExp("^[a-zA-ZěščřžýáíúůéäëïöüĚŠČŘŽÝÁÍÉÚŮÄËÏÖÜ ]+$"));
	} else {
		return true;
	}
}

function increaseValue(e, target) {
	if(e.src.search("disabled") > -1) {
		return false;
	} else {
		var c = document.getElementById(target + "_down");
		if(c.src.search("disabled") > -1) {
			c.src = "/" + path + "images/control/counter_down.gif";
		}
		document.getElementById(target).value++;
	}
}

function decreaseValue(e, target) {
	if(e.src.search("disabled") > -1) {
		return false;
	} else {
		var n = document.getElementById(target).value;
		if(n == 1) {
			e.src = "/" + path + "images/control/counter_down_disabled.gif";
		}
		document.getElementById(target).value = n - 1;
	}
}