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 TestEmail(email)
{
	var ret = true;
	try {
		var zavinac = email.indexOf("@");
		var tecka = email.lastIndexOf(".");
		if (email != "") {
			if (zavinac < 1 || tecka > (email.length - 3) || tecka < 0 || ((zavinac + 2) > tecka)) ret = false;
		} else {
			ret = false;
		}
	} catch(e) {
		ret = false;
	}
	return ret;
}

function showPopupHint(id, e) {
	if (!e) e = window.event;
	var tag = null;
	if (e.target) tag = e.target;
	else if (e.srcElement) tag = e.srcElement;
	if (id == null || id == "") id = "divHint";
	var hint = GetTag(id);
	if (tag != null && hint != null) {
		hint.style.left = tag.offsetLeft + "px";
		hint.style.top = tag.offsetTop + tag.offsetHeight + 10 + "px";
		hint.style.display = "block";
	}
}

function closePopupHint(id) {
	if (id == null || id == "") id = "divHint";
	var hint = GetTag(id);
	if (hint != null) hint.style.display = "none";
}

function Obarvi(AName, AOver) {
	if (AOver) GetTag(AName).style.color = 'red';
	else GetTag(AName).style.color = '#808080';
}

