<!--
	function isMail(_email) {
		var emailReg = /^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i

		return emailReg.test(_email);
	}

	function newTrInput(inTarg, inTrName, inId, inName, inValue, inType, inErase, inSelec, inTabId)
	{
		var newTr = document.createElement('tr');
		var newTd = document.createElement('td');

		if (inErase)
		{
			var newA = document.createElement('a');

			var newErHid = document.createElement('input');
			newErHid.setAttribute('id', 'erase' + inTabId);
			newErHid.setAttribute('name', 'erase' + inTabId);
			newErHid.setAttribute('value', 'false');
			newErHid.setAttribute('type', 'hidden');
			document.getElementById(inTarg).appendChild(newErHid);

			newA.setAttribute('onclick', 'document.getElementById(\'erase' + inTabId + '\').setAttribute(\'value\', \'true\'); document.getElementById(\''  + inTarg + '\').removeChild(document.getElementById(\'table' + inTabId + '\'));');
			newA.setAttribute('href', '#');
			var newImg = document.createElement('img');
			newImg.setAttribute('border', '0');
			newImg.setAttribute('src', 'img/delField.png');
			newImg.setAttribute('height', '13px');
			newA.appendChild(newImg);
			
			newTd.appendChild(newA);
		}

		newTr.appendChild(newTd);
		newTd.setAttribute('align', 'right');
		newTd.innerHTML = newTd.innerHTML + inTrName;

		var newTd = document.createElement('td');
		newTr.appendChild(newTd);

		var newInput = document.createElement('input');
		newInput.setAttribute('id', inId);
		newInput.setAttribute('name', inName);
		newInput.setAttribute('type', inType);

		if (inSelec)
			newInput.setAttribute('checked', 'checked');

		newInput.setAttribute('onkeypress', 'if (event && event.which == 13) checkForm();');
		
		if (inValue != '')
			newInput.setAttribute('value', inValue);

		newTd.appendChild(newInput);

		return newTr;
	}

	function putInputBad(inInput)
	{
		inInput.setAttribute('class', 'red');
	}

	function putInputOk(inInput)
	{
		inInput.setAttribute('class', 'normal');
	}

	function openWin(inUrl, inX, inY)
	{
		window.open(inUrl ,'' , 'width=' + inX + ', height=' + inY + ', scrollbars=yes, resizable=yes, scrolling=0, status=yes');
	}

	function captureMouse(inMousePos, inEvent)
	{
		if (document.all)
		{
			inMousePos['x'] = event.x;
			inMousePos['y'] = event.y;
		}
		else
		{
			inMousePos['x'] = inEvent.pageX;
			inMousePos['y'] = inEvent.pageY;
		}
	}

	function showSelTooltip(inDiv, inUrl, inMousePos, inAutHid)
	{
		var htmlCont = loadXMLDoc(inUrl, false).responseText;

		document.getElementById(inDiv).innerHTML = htmlCont;

		document.getElementById(inDiv).style.top = mousePos['y'] + 'px';
		document.getElementById(inDiv).style.left = mousePos['x'] + 'px';

		document.getElementById(inDiv).style.display = 'block';

		if (inAutHid)
		{
			toolTipTim = setTimeout('hiddenToolTip(\'' + inDiv + '\')', 1000);
			document.getElementById(inDiv).setAttribute('onmouseout', 'window.clearTimeout(toolTipTim); toolTipTim = setTimeout(\'hiddenToolTip(\\\'' + inDiv + '\\\')\', 1000);');
		}
		else
			document.getElementById(inDiv).setAttribute('onmouseout', '');
	}

	function hiddenToolTip(inDiv)
	{
		document.getElementById(inDiv).style.display = 'none';
	}

	function checkNewCour(inName, inTerm, inTutor, inMain, inEdit, inId, inError)
	{
		if (inName.value == '')
		{
			alert(inError);
		}
		else
		{
			if (inName != undefined)
			{
				if(inTerm.checked)
					term = 1;
				else
					term = 0;
				loadXMLDoc('index.php?module=newCourForm&main=' + inMain + '&name=' + inName.value + '&term=' + term + '&tutor=' + inTutor.value + '&noHead=noHead&edit=' + inEdit + '&id=' + inId, true);
				hiddenToolTip('selTooltip');
			}
		}
	}

	function setCookie(inNameOfCookie, inValue, inExpSec) 
	{
		var ExpireDate = new Date();
		ExpireDate.setTime(ExpireDate.getTime() + (inExpSec * 24 * 3600 * 1000));

  		document.cookie = inNameOfCookie + "=" + escape(inValue) + ((inExpSec == null) ? "" : "; expires=" + ExpireDate.toGMTString());
	}

	function getCookie(inNameOfCookie)
	{
		if (document.cookie.length > 0) 
		{
			begin = document.cookie.indexOf(inNameOfCookie+"="); 
		    	if (begin != -1)
				begin += inNameOfCookie.length+1; 
			end = document.cookie.indexOf(";", begin);
			if (end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));       
		} 
		return null; 
	}

	function calcImageWidth(inId, inDefaultWidth, inDefaultHeight)
	{
	        if ((((inDefaultWidth * document.getElementById(inId).offsetHeight) / document.getElementById(inId).offsetWidth) / inDefaultWidth) < (((inDefaultHeight * document.getElementById(inId).offsetWidth) / document.getElementById(inId).offsetHeight) / inDefaultHeight))
		{
			document.getElementById(inId).height = ((inDefaultWidth * document.getElementById(inId).offsetHeight) / document.getElementById(inId).offsetWidth);
			document.getElementById(inId).width = inDefaultWidth;
		}
		else
		{
			document.getElementById(inId).width = ((inDefaultHeight * document.getElementById(inId).offsetWidth) / document.getElementById(inId).offsetHeight);
			document.getElementById(inId).height = inDefaultHeight;
		}
	}

-->
