	
	function findMissingFields()
	{
		var i;
		var msg = '';
		var focusSet = false;
					
		for (i = 0; i < document.all.length; i++)
		{
			var itm = document.all.item(i);
			
			if(itm.label && !itm.value) 
			{
				msg += '- ' + itm.label + ' is a required field\n';	
				if(!focusSet) 
				{
					itm.focus();	
					focusSet = true;
				}
			}
		}
					
		return msg;
	}
	
	function moveItem(srcSELECT, destSELECT, itmIndx) 
	{
		if(itmIndx > -1 && srcSELECT.length > itmIndx) 
		{
			var oItm = srcSELECT.options[itmIndx];
		
			addItem(destSELECT, oItm.text, oItm.value);
			srcSELECT.remove(itmIndx);
		}
	}
	
	function findUser(oSELECT, item) 
	{
		for(var i = 0; i < oSELECT.length; i++)
			if(oSELECT.options[i].value == item) 
				return i;
	}
	
	function addItem(oSELECT, text, value) 
	{
			var newItm = document.createElement("OPTION");
			newItm.text = text;
			newItm.value = value;
			
			oSELECT.add(newItm);
	}
		
	function selectElement(oSELECT, selVal) 
	{
		for(var i = 0; i < oSELECT.length; i++)
			if(oSELECT.options[i].value == selVal) 
				oSELECT.selectedIndex = i;
	}

	function findMissingFields()
	{
		var i;
		var msg = '';
		var focusSet = false;
					
		for (i = 0; i < document.all.length; i++)
		{
			var itm = document.all.item(i);
			
			if(itm.label && !itm.value) 
			{
				msg += '- ' + itm.label + '\n';	
				if(!focusSet) {itm.focus();	focusSet = true;}
			}
		}
					
		return msg;
	}

	function openDocDetailsWindow(parm) 
	{
		setHelpFile('documentUpdate.asp');
		var oChildWind = launchPopupWindow("/Document/documentUpdate.asp" + parm, null, 430, 442);
		var titleSetFlag = false;
		var counter = 5000;
		
		while(!titleSetFlag && counter > 0) 
		{
			try 
			{
				oChildWind.setParent(window.self);
				titleSetFlag = true;
				counter = 0;
			}
			catch(e) 
			{
				--counter;
			}
		}
	}
/* 
	function closeAnyWindow()
	{
		if(closeAnyWindow.arguments.length>0)
		{
			try 
			{
				closeAnyWindow.arguments[0].submit();
			}
			catch(e) 
			{
				window.opener.location.reload(true);
			}
		}
		else
		{
			window.opener.location.reload(true);
		}
		window.close();		
	}
*/
	function closeWindowEx() 
	{
		try 
		{
			window.opener.refreshMe();
		} 
		catch(e) 
		{}
		window.close();		
	}
	
	function closeWindow() 
	{
		try
		{
			window.opener.location.reload(true);
		}
		catch(e)
		{}
		window.close();		
	}

	function submitWindow(oFrm) 
	{
		try 
		{
			oFrm.submit();
		}
		catch(e) 
		{
			window.opener.location.reload(true);
		}
		window.close();		
	}

	function loadTitlePage(imgUrl) 
	{
		try 
		{
			var wPage = findParentFrame('wPageTitle');
		}
		catch(e) 
		{}
	
		if(wPage) 
			wPage.location.href = '/FrameWork/pageTitle.asp?image_url=' + imgUrl;
	}
	
	function loadSubMenu(menuUrl) 
	{
		try 
		{
			window.top.frames('wSubMenu').location.href = menuUrl;
		}
		catch(e1) 
		{
			try 
			{
				window.parent.frames('wSubMenu').location.href = menuUrl;
			}
			catch(e2) 
			{}
		}
	}

	function setHelpFile(fileName) 
	{
		var oParent = window.parent;
		while(1) 
		{
			try 
			{
				oParent.frames('wEasyAccessMenu').setPage(fileName);
				return;
			}
			catch(e) 
			{
				if(oParent == window.top)
				{
					return;
				}
				oParent = oParent.parent;
			}
		}
	}

	function clickHelpFile() 
	{
		var oParent = window.parent;
		
		while(1) 
		{
			try 
			{
				oParent.frames('wEasyAccessMenu').onHelpClick();
				return;
			}
			catch(e) 
			{
				if(oParent == window.top)
				{
					return;
				}
				oParent = oParent.parent;
			}
		}
	}

	function setHelpFilePopup(fileName) 
	{
		try 
		{
			var wMenu = window.opener.top.frames('wEasyAccessMenu');
			if(wMenu) wMenu.setPage(fileName);
		}
		catch(e) {return;}
	}
	
	function findParentFrame(windowName) 
	{
		var oParWind = document.parentWindow;
		var oFrmWind;
		var counter = 10;
		
		while(!oFrmWind && counter > 0) 
		{
			try 
			{
				if(oParWind.parentWindow)
					oParWind = oParWind.parentWindow;
				else if(oParWind.parent)
					oParWind = oParWind.parent;
				else
					throw "no parent object";
			}
			catch(e) 
			{
				alert(e);
			}
			try 
			{
				oFrmWind = oParWind.frames(windowName);
			} 
			catch(e) 
			{}
			--counter;
		}
		
		return (oFrmWind) ? oFrmWind : null;
	}
	
	function launchPopupWindow(url, name, height, width) 
	{
		return window.open(url, name, 'height=' + height + ',width=' + width + ',status=no,alwaysRaised=yes,toolbar=yes,directories=no,menubar=yes,location=no,resizable=yes,left=' + getLeft(width) + ',top=' + getTop(height));
	}
	
	function launchPopupWindowScroll(url, name, height, width) 
	{
		return window.open(url, name, 'height=' + height + ',width=' + width + ',status=no,alwaysRaised=yes,toolbar=yes,directories=no,menubar=yes,location=no,resizable=yes,scrollbars=yes,left=' + getLeft(width) + ',top=' + getTop(height));
	}

	function resizeWindow(wnd, height, width) 
	{
		var top = getTop(height);
		var left = getLeft(width);
		//wnd.top = top;
		//wnd.left = left;
		window.resizeTo(width, height);
		window.moveTo(left, top);
	}
	
	function getTop(height) 
	{return (screen.availHeight - height) / 2;}
			
	function getLeft(width) 
	{return (screen.availWidth - width) / 2;}

	function redirect(url)
	{	top.location.href = url; }
	
	function redirectWithDelay(url, delay)
	{	window.setTimeout("redirect('" + url + "');", delay); }

	function isValidNode(NodeToTest)
	{
	// Test the validity of a node.  The node can only consist
	// of alphanumeric characters and dashes

		var strNode = NodeToTest.toString();
		var i;
		var charCode;

		if (strNode.length == 0) return false;
					
		strNode = strNode.toUpperCase();

		for (i = 0; i < strNode.length; i++) 
		{                        
			charCode = strNode.charCodeAt(i);

			/*
				A = 65
				Z = 90
				0 = 48
				9 = 57
				- = 45
							
				This statements will make sure that the group ID only has 
				alphanumeric characters and/or a dash					
			*/
			if (!(	(charCode>=65 && charCode<=90) || (charCode>=48 && charCode<=57) || (charCode==45)))
				return false;
		}

		return true;
	}
				
	function isValidEmail(emailAddress)
	{
		var apos = emailAddress.indexOf("@");
		var dpos = emailAddress.indexOf(".");
		var epos = emailAddress.indexOf("]");
		var fpos = emailAddress.indexOf("[");
					
		if (apos <= 0 || dpos <= 0 || epos > 0 || fpos > 0)
			return false;
						
		if (dpos + 1 >= emailAddress.length)
			return false;
					
		return true;
	}

	function IsNumeric(val)
	{
		var i;
		var charCode;
		var tempVal = val.toString();

		if (tempVal.length == 0) 
			return false;
					
		for (i = 0; i < tempVal.length; i++) 
		{	charCode = tempVal.charCodeAt(i);
			if(charCode<48 || charCode>57) 
				return false; 
		}

		return true;
	}
	
	function Delay(nCount) 
	{
		//var counter = 5000;
		var counter = nCount
		while(counter > 0) 
		{
				--counter;
		}
	}

