// JavaScript Document

// Note: In some pages (possibly all) the definition of popUp() that appears here
// overrides the definition that appears in inc/js_general.js!
// JR 2006-04-05
function popUp(wid,high,labell,link) {

	labell = window.open(link,labell,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+wid+",height="+high);
	
	if (labell.closed)
	{
		labell = window.open(link,labell,"toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+wid+",height="+high);
	}
	
	else {
		// window.resizeTo() appears to rezise the window to exactly the dimensions specified,
		// whereas window.open() appears to size the *content area* of the window to (approximately) the dimensions specified.
		// Since a lot of TKI has pop-up window dimensions specified on the basis of the window.open() behaviour
		// this would be difficult to change.
		// So instead, am adding an arbitrary amount to the height parameter of window.resizeTo(),
		// which seems to work in most browsers. :-)
		// Note: This was done so that pop-up windows for the 'Performing Arts Facilities' key collection on TKI
		// <http://www.tki.org.nz/r/arts/facilities/> would display correctly with different sized content,
		// when the pop-up window is left open between content changes.
		// JR 2006-04-05
		labell.resizeTo(wid,high+40);
		labell.focus();
	}
}


// legacy support..
function popWin(wid,high,labell,link) {
	
	labell = window.open(link,labell,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+wid+",height=350");
	
	labell.opener = window;
	
	if (labell.closed)
	{
		labell = window.open(link,labell,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+wid+",height="+high);
	}
	
	else {
		labell.focus();
	}

}
