var newwin;

var w = 200, h = 200;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = 200, popH = 200;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;

function launchwin(winurl,winname,winfeatures,parentname)
{

if (!document.images) 	//Quick sniff for IE3. If the browser is IE3, don't check to see if the
						//window is already open. Just pretend it's always closed.
	{
		newwin = null;
	}


	if (newwin == null || newwin.closed)
		//-check for the existence of the window.
		//-we check in two ways: 1) is the newwin object null? It should be if we've closed the window
		// because we set newwin to null in a function called by the onunload handler.
		// And 2) is the newwin.closed property true? We check this second state because Netscape 4.5
		// doesn't call the onunload handler when you use the exit button on the window itself. So we
		// check the closed property for the benefit of Nav 4.5. Why not just check that? Because IE4
		// chokes on it if you do.  It's probably a good idea to check both anyway because "closed"
		// wouldn't be set before the first time the user launches the window. IE4 doesn't choke if we
		// check the status of newwin first.
						
		{
			//we've determined that no window is open, so launch one now
	
			newwin = window.open(winurl,winname,winfeatures);

			if (newwin.opener == null) // set the opener property manually for Nav 2.0.
			{
				newwin.opener = window;
			}
			newwin.opener.name = parentname; // give our parent window a name so we can target it from newwin

		}

	else


		{

				alert("You already have a copy of the order form open, please click OK to continue.");
				newwin.focus(); 

		}

}

function confirmDelete(id,section) {
	
	if (confirm('Are you sure you want to delete this entry?')) {
	
		window.location = ('?section=' + section +'&type=delete&id=' + id);
	
	} else {
	
		return false;
	
	}
}

function confirmClose() {
	
	if (confirm('Please make sure you have submitted your order before closing this page.')) {
	
		window.close;
	
	} else {
	
		return false;
	
	}
}