if (document.all)
{
	var domRef = ".all";
}
else
{
	var domRef = ".getElementById";
}

function swapImg(sImg, sSrc)
{
	document.images[sImg].src = sSrc;
}

function hideObj(sObj)
{
	eval("document" + domRef + "('" + sObj + "').style.display = 'none'");
}

function showObj(sObj)
{
	eval("document" + domRef + "('" + sObj + "').style.display = ''");
}

function changeBackground(sObj, sColor)
{
	eval("document" + domRef + "('" + sObj + "').style.backgroundColor = '" + sColor + "'");
}

function positionObj(sObj, iTop, iLeft)
{
	eval("document" + domRef + "('" + sObj + "').style.top = iTop");
	eval("document" + domRef + "('" + sObj + "').style.left = iLeft");
}

function popupWin(sUrl, sName, iWidth, iHeight, bTool, bLocation, bStatus, bScroll, bResize)
{
	window.open(sUrl, sName, "width=" + iWidth + ", height=" + iHeight + ", toolbar=" + bTool + ", location=" + bLocation + ", directories=0, status=" + bStatus + ", menuBar=0, scrollBars=" + bScroll + ", resizable=" + bResize);
}

function helpWin(sUrl)
{
	popupWin(sUrl, "help", 500, 400, 0, 0, 0, 1, 1)
}

function confirmDelete(sURL)
{
	if (confirm('Warning! Deleted records can not be recovered. Do you wish to proceed.'))
	{
		location.href = sURL;
	}
}

function chkText(s) 
{
	var re = new RegExp("[a-zA-Z0-9]");
	if (s.match(re))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function chkURL(s)
{
	var re = new RegExp("(?:https?|ftp|mms|rtsp)://[^\\s,<>\\?]+?\\.[^\\s,<>\\?]+");
	if (s.match(re))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function chkEmail(s)
{
	var re = new RegExp("[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)\.[A-Za-z]");
	if (s.match(re))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function chkDate(s)
{
	var re = new RegExp("[0-9]{2}[/][0-9]{2}[/][0-9]{4}");
	if (s.match(re))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function chkInt(i)
{
	if (i/i == 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}