function GetTag(AName)
{
	var temp = document.getElementsByName(AName);
	var tempID = document.getElementById(AName);
	if (tempID != null) return tempID;
	else if (temp != null && temp.length > 0) return temp[0];
	else return null;
}

function CheckNumber(e)
{
	if (!e) e = window.event;
	if (e.charCode != null) return (e.charCode == 0 || /\d{1,1}/.test(String.fromCharCode(e.charCode)));
	else return /\d{1,1}/.test(String.fromCharCode(e.keyCode));
}

function CheckASCII(e) {
	if (!e) e = window.event;
	if (e.charCode != null) return (e.charCode == 0 || e.charCode == 43 || /\w|\-{1,1}/.test(String.fromCharCode(e.charCode)));
	else return /\w|\-{1,1}/.test(String.fromCharCode(e.keyCode));
}

function CheckPhone(e)
{
	if (!e) e = window.event;
	if (e.charCode != null) return (e.charCode == 0 || e.charCode == 43 || /\d{1,1}/.test(String.fromCharCode(e.charCode)));
	else return /\d{1,1}/.test(String.fromCharCode(e.keyCode));
}

function ZobrazitPolozky(AObj) {
	if (AObj.checked) GetTag("divPolozky").style.display = "block";
	else GetTag("divPolozky").style.display = "none"; 
}

function Zobrazit(AObj, AId) {
	if (AObj.checked) GetTag(AId).style.display = "block";
	else GetTag(AId).style.display = "none"; 
}

function Okno(AUrl, AWidth, AHeight) {
	if (AUrl != null && AUrl != "") {
		AWidth = AWidth != null && !isNaN(parseInt(AWidth)) ? AWidth : 400;
		AHeight = AHeight != null && !isNaN(parseInt(AHeight)) ? AHeight : 300;
		window.open(AUrl, 'REALEXIT', "width=" + AWidth + ", height=" + AHeight + ", toolbar=no, menubar=no, scrollbars=yes, status=no, resizable=yes").focus();
	}
}
