// ======================================================================================
//  Filename:  openImageWindow.js
// ======================================================================================

/* Opens a new window on the users desktop.

   Arguments:
   pageToLoad - The URL of a page to load in the browser window.
                This can be a relative URL or fully qualified.
   winName - 	Name of the new window.  NO SPACES!
   width -   	The horizontal size of the new window.
   height - 	The vertical size of the new window.
   center -     toggle centering on 4.0 browsers.
                        1=centered window 0=no centering
   scrollbar -  toggle scrollbar on or off
				'yes' = scrollbar displayed
				'no'  = scrollbar hidden                    
   
   resizable -  toggle determining if new window can be resized
				'yes' and 'no'       
				
   toolbar -    toggle determining if toolbar should be displayed (OPTIONAL - default is 
                NO tool bar)
                0 - toolbar is NOT displayed
                1 - toolbar is displayed			             

   Values in the "args" section below can all be toggled in the
   same fashion as the center toggle.  Just modify the appropriate
   value in the args section to be either 0 or 1.

   A call to this function might look like this:
   <a href="javascript:openAWindow('ice.html','ice',375,250,1,'yes','no',0)">Ice</a>

   Created by Glenn Davis of Project Cool, Inc. for general use.  If
   you use this routine please leave all comments in place so that
   others may benefit as well.
*/

function openImageWindow( pageToLoad, winName, width, height, center, bscrollbar, bresizable, ntoolbar) {

if (arguments.length < 8) {
	ntoolbar = 0;
	nmenubar = 0;
	naddressbar = 0;
}	
else {
	nmenubar = ntoolbar;
	naddressbar = ntoolbar;
}	
						 
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
	xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
	}
args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=" + nmenubar + ","
    + "status=0," 
    + "titlebar=0,"
    + "scrollbars=" + bscrollbar + ","
    + "resizable=" + bresizable + ","
    + "toolbar=" + ntoolbar + ","
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

//document.write ('These are the parms: ' + args);
window.open( pageToLoad,winName,args );
}


