	var winObj = new Array();
	var winRef = new Array();
	var winCount = 0;
		
	// open or set focus to a window
	function PopupOpen(sURL, sName, sID, sWidth, sHeight, sToolbar, sScrollbar) {
		var i
		if(sToolbar!='yes') sToolbar = 'no'
		// if(sScrollbar!='no') sScrollbar = 'no'
		var sProperties = 'scrollbars=' + sScrollbar + ',status=no,location=no,menubar=no,toolbar=' + sToolbar + ',resizable=no,width=' + sWidth + ',height=' + sHeight;
		var win=null;
		// search for an existing window of that name
		if (winCount>0) {
			for (i=0;i<winCount;i++) {
				if (winRef[i]==sName) {
					win=winObj[i];
					break;
				};
			};
		};
		if (sURL.search(/\?/) == -1)
			sURL += '?WindowMode=CONSOLE&Console=1'
		else
			sURL += '&WindowMode=CONSOLE&Console=1';
				
		// if found, show it or recreate it, otherwise add it to the list of popups and show it
		if (win) {
			if (!win.closed) {
				win.focus()
				win.location=sURL;
			}
			else {
				win=window.open(sURL, sName, sProperties);
				winObj[i]=win;
				win.focus()
			}
		}
		else {
			win = window.open(sURL, sName, sProperties);
			winObj[winCount]=win;
			winRef[winCount]=sName;
			winCount++;
			win.focus()
		};
		//return win;
	};
		
	// close the window sName, if any
	function PopupClose(sName) {
		var win=null;
		// search for an existing window of that name
		if (winCount>0) {
			for (i=0;i<winCount;i++) {
				if (winRef[i]==sName || sName=='') {
					win=winObj[i];
					win.close();
					if (sName!='') break;
				};
			};
		};
	};

	function newImage(arg)
	{
		if(document.images)
		{
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	function changeImages()
	{
		if(document.images && (preloadFlag == true))
		{
			for (var i = 0; i < changeImages.arguments.length; i+=2)
			{
				document[changeImages.arguments[i]].src = changeImages.arguments[i + 1];
			}
		}
	}
	
	var preloadFlag = false;
	function preloadImages()
	{
		/*if(document.images)
		{
			arrow_over = newImage("<% = g_sRedir %>media/images/arrow_hl.gif");
			preloadFlag = true;
		}*/
	}
	
	function menuItem(cell, blnShow)
	{
		if (blnShow == true)
		{
			cell.bgColor = '#DFEAF1';
		}
		else
		{
			cell.bgColor = '#FFFFFF';
		}
	}
	
	// Place the focus to the first form field...
	function placeFocus()
	{
		if (document.forms.length > 0)
		{
			var field = document.forms[0];
			for (i = 0; i < field.length; i++)
			{
				if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s"))
				{
					document.forms[0].elements[i].focus();
					break;
				}
			}
		}
	}
	