// PopUp
// creates a new popup window
function PopUp(URL,Name,w,h,a,t) {

	// collect attributes
	var winN = Name;		// set the value of the window's name (no spaces allowed)
	var winW = w;			// set window's width to passed width (if any)
	var winH = h;			// set window's height to passed height (if any)
	var aVal = a;			// set the value of the window's attributes (if any)
	var tVal = t;			// set the value of the window's toolbar
   
	// set attributes if undefined
	if (!winN) winN = Math.round(Math.random() * 1000000000);	// set window name to a random number if undefined
	if (!winW) winW = 400;										// set window width if undefined
	if (!winH) winH = 400;										// set window height if undefined
	if (!aVal) aVal = "yes";									// set window default attribute value
	if (!tVal) tVal = "yes";									// set window default toolbar value
   
	// open popup window
	var newWin= window.open(URL,winN,'width=' + winW + ',height=' + winH + ',resizable=' + aVal + ',scrollbars=' + aVal + ',toolbar=' + tVal);
	
	// set focus on the new window
	newWin.focus();
}


// view maint item in a separate window
function ViewMaint(page,id) {
	// collect attributes
	var page = page;
	var id = id;

	// open popup window
	var newWin = window.open('../' + page + '.cgi?' + page + '_id=' + id + '&Action=Display&MV=Y');
	newWin.focus();				// set focus on the new window
}

