function checkDateField(strFieldID)
{
	var strActualName = "_ctl0_" + strFieldID;		// this string is by default attached to the ID of each field in any user control
	if (document.all[strActualName]==null)
	{												// field not found
		if (document.all[strFieldID]==null) return true;	// try with the given string itself as to whether that field exists or not
		if (document.all[strFieldID].disabled) return true;
		if (document.all[strFieldID].value=="") return true;
		if (document.all[strFieldID].style.color=='red')
		{
			document.all[strFieldID].select();
			document.all[strFieldID].focus();
			return false;
		}
	}
	else
	{
		if (document.all[strActualName].disabled) return true;
		if (document.all[strActualName].value=="") return true;
		if (document.all[strActualName].style.color=='red')
		{
			document.all[strActualName].select();
			document.all[strActualName].focus();
			return false;
		}
	}
	return true;
}

function checkHome()
{
	try
	{
		var startPos = location.href.indexOf(".aspx");
		var siteAddress = location.href.indexOf.substring(0,startPos);
		if (window.opener.location.href.indexOf(siteAddress)==-1)
			window.open('main.aspx?Page=welcome');
		else
			window.opener.focus();
	}
	catch(e)
	{
		window.open('main.aspx?Page=welcome');
	}
	window.close();
}

