/*
<fusedoc fuse="popUpWindow.js">
	<responsibilities>
		I launch the A tag's href in a new browser window with the specified attributes.
	</responsibilities>
	<properties>
		<history type="create" date="20041109" author="Julian Halliwell"/>
		<history type="update" date="20070330" author="Julian">
			- Separated out w and h from other attributes
			- If no w/h specified, dimension is relatively smaller than opener (ie merged with popUpWindowRelativeSized)
		</history>
	</properties>
	<io>
		<in>
			<string name="aTag"/>
			<string name="windowName"/>
			<number name="w" optional="true"/>
			<number name="h" optional="true"/>
			<string name="extraAttributes" optional="true"/>
		</in>
	</io>
</fusedoc>
*/

function popUpWindow(aTag,windowName,w,h,extraAttributes){
	var verticalMargin		=	(window.screen.availWidth/10);
	var horizontalMargin		=	(window.screen.availHeight/6);
	if(!w||w==0)
		var w	=	(window.screen.availWidth - verticalMargin);
	if(!h||h==0)
		var h	=	(window.screen.availHeight - horizontalMargin);
	var attributes		=		"width=" + w;
	attributes 				+=	",height=" + h;
	if(extraAttributes)
		attributes			+= "," + extraAttributes;
	attributes				+= ",resizable,scrollbars,status";
	var win	=	window.open(aTag.href,windowName,attributes);
	win.focus();
	return false;
}