	var repWindow;
	var addWindow;
	var undef;
	function DatePicker_ClearOpenWindows()
	{
		if (typeof addWindow != typeof undef) 
		{
			if(!addWindow.closed)
					addWindow.close()
		}
		if (typeof repWindow != typeof undef) 
		{
			if(!repWindow.closed)
					repWindow.close()
		}
	}
	function DatePicker_popWindow(f)
	{
		DatePicker_ClearOpenWindows()
		iTop=f.getClientRects()[0].bottom + window.screenTop
		iLeft=(f.getClientRects()[0].right + f.getClientRects()[0].left) / 2 + window.screenLeft - 110
		addWindow = window.open('controls/date_picker.htm?formName='+document.forms[0].name+'&dateField=' + f.name,"DatePicker",'width=221,height=157,top='+iTop+',left='+iLeft+',resizable=0,status=0,menubar=0,scrollbars=0,fullscreen=0');
		addWindow.focus() 
	}
	function DatePicker_popWindowSubItem(f)
	{
		DatePicker_ClearOpenWindows()
		iTop=f.getClientRects()[0].bottom + window.screenTop
		iLeft=(f.getClientRects()[0].right + f.getClientRects()[0].left) / 2 + window.screenLeft - 110
		addWindow = window.open('../controls/date_picker.htm?formName='+document.forms[0].name+'&dateField=' + f.name,"DatePicker",'width=221,height=157,top='+iTop+',left='+iLeft+',resizable=0,status=0,menubar=0,scrollbars=0,fullscreen=0');
		addWindow.focus() 
	}
	function DatePicker_Delete(f)
	{
		f.value=""; 
	}
	function ControlSetFocus()
	{
		var ob = window.event.srcElement;
		ob.focus();
	}
	function ControlLostFocus()
	{
		window.focus();
	}
	function GetDate(strDate)
	{
		if (strDate.length != 10)
			return "";
		var dd, mm, yyyy;
		var sep;
		sep = ".";
		var index1, index2;
		index1 = strDate.indexOf(sep);
		index2 = strDate.indexOf(sep, index1 + 1);
		dd = strDate.substring(0, index1);
		mm = strDate.substring(index1 + 1, index2);
		yyyy = strDate.substr(index2 + 1);
		return new Date(yyyy, mm - 1, dd);
	}
	
