<!--
/* -------------------------------------------------------------------------- */

function openWindow(winName,address,winWidth,winHeight,winOptions,headerBuffer){

	// Checks for any extra window attributes in the input string
	if(headerBuffer != 0)
		
	{

		//Internet Explorer
		var LeftPosition = (screen.width)/2 -(winWidth/2);
		var TopPosition = (screen.height)/2 -(winHeight/2 + headerBuffer); // "headerBuffer" is the area allocated for toolbars etc
		
		//Netscape Navigator
		var ScreenXPosition = (screen.width/2)-(winWidth/2);
		var ScreenYPosition = (screen.height/2)-(winHeight/2 + headerBuffer); // "headerBuffer" is the area allocated for toolbars etc

	}
	
	else

	{ 

		//Internet Explorer
		var LeftPosition = (screen.width)/2 -(winWidth/2);
		var TopPosition = (screen.height)/2 -(winHeight/2 + 10); // "+10" is the height in pixels on the top window plane
		
		//Netscape Navigator
		var ScreenXPosition = (screen.width/2)-(winWidth/2);
		var ScreenYPosition = (screen.height/2)-(winHeight/2 + 10); // "+10" is the height in pixels on the top window plane

	}

	//If the window being requested will fit in the available screen width and screen height
	if (screen.width > winWidth || screen.height > winHeight) 
			
	{

		//Creates a new window instance
		var whandle = window.open(address, winName,'width='+winWidth+',height='+winHeight+',top='+TopPosition+',left='+LeftPosition+',screenX='+ScreenXPosition+',screenY='+ScreenYPosition+','+winOptions+'')

		//Draws the focus of the browser to the new window
		whandle.focus()
	
	}
		
	else 
			
	{
	
		//Creates a new window instance, but window smaller window width sizes to fit available screen resolution
		var whandle = window.open(address, winName,'width='+winWidth+',height='+winHeight+',top='+(TopPosition-50)+',left='+(LeftPosition-50)+',screenX='+(ScreenXPosition-50)+',screenY='+(ScreenYPosition-50)+','+winOptions+'')
		
		//Draws the focus of the browser to the new window
		whandle.focus()

	}
		

	}
	
/* -------------------------------------------------------------------------- */
//-->