//These variables are used so that if the user opens the small window
//and it gets buried behind other windows, it is brought to the front
//when they click the open window buttons a second time

var iwin = null

//This opens the centered window. Note the values (arguments) being
//sent to this function. Look below in the body and note that the size
//of the window is sent to the function and placed in the variables H & V

function openwin(H,V,IMAGE) {

	//this determines if the user has already opened the window	

	if (!iwin || iwin.closed) {

		//this determines the browser type

		var name = navigator.appName
		
		//If IE is the browser, must base centering on screen width
		//IE does not recognize the window width and height method.
		//Note this should work flawlessly as long as the user does
		//not have multiple monitors. 
		//Netscape will not be a problem -- it recognizes outerwidth
		//and outerheight
		
		if (name == "Microsoft Internet Explorer") {

			var myH = screen.availWidth
			var myV = screen.availHeight		
		
  		} else {
			var myH = window.outerWidth
			var myV = window.outerHeight
		}

		//The next two lines determine the placement for the window
		//based upon the centering information above and the values
		//sent to this function (H & V)

		var centerH = myH*.5-H*.5
		var centerV = myV*.5-V*.5

		//Once the centering data is calculated, the line below integrates
		//it into a single string for use in the window.open method

		var mystring = "status=no,toolbar=no,location=no,menu=no,height=" + H + ",width=" + V

		//This opens the window.

		iwin = window.open('','IWIN', mystring)

		//This centers it.

		iwin.moveTo(centerH,centerV)
		iwin.document.close()
		iwin.document.write('<p align="center"><img src='+IMAGE+'><br><br>')
		iwin.document.write('<INPUT TYPE="button" VALUE="Close Window" onClick="window.close();"></p>')
		iwin.focus()

	} else {
		iwin.document.close()
		iwin.document.write('<p align="center"><img src='+IMAGE+'><br><br>')
		iwin.document.write('<INPUT TYPE="button" VALUE="Close Window" onClick="window.close();"></p>')
		iwin.focus()
	}
}

function openpage(H,W,PAGE) {

		//this closes the previous page if the user has already opened the window	
        	//if (iwin) {iwin.document.close()}

		var mystring = "scrollbars=yes,status=no,toolbar=no,location=no,menu=no,height=" + H + ",width=" + W

		//This opens the window.
		iwin = window.open(PAGE ,'IWIN', mystring)


		//This brings the window to the front.
                iwin.focus()

}

function openpage3(H,V,PAGE) {

	//this determines if the user has already opened the window	

	if (!iwin || iwin.closed) {

		//this determines the browser type

		var name = navigator.appName
		
		//If IE is the browser, must base centering on screen width
		//IE does not recognize the window width and height method.
		//Note this should work flawlessly as long as the user does
		//not have multiple monitors. 
		//Netscape will not be a problem -- it recognizes outerwidth
		//and outerheight
		
		if (name == "Microsoft Internet Explorer") {

			var myH = screen.availWidth
			var myV = screen.availHeight		
		
  		} else {
			var myH = window.outerWidth
			var myV = window.outerHeight
		}

		//The next two lines determine the placement for the window
		//based upon the centering information above and the values
		//sent to this function (H & V)

		var centerH = myH*.5-H*.5
		var centerV = myV*.5-V*.5

		//Once the centering data is calculated, the line below integrates
		//it into a single string for use in the window.open method

		var mystring = "status=no,toolbar=no,location=no,menu=no,height=" + H + ",width=" + V

		//This opens the window.

		iwin = window.open(PAGE ,'IWIN', mystring)

		//This centers it.

		iwin.moveTo(centerH,centerV)
		iwin.document.close()
		//iwin.document.write('<p align="center"><img src='+IMAGE+'><br><br>')
		//iwin.document.write('<INPUT TYPE="button" VALUE="Close Window" onClick="window.close();"></p>')
		iwin.focus()

	} else {
		iwin.document.close()
		//iwin.document.write('<p align="center"><img src='+IMAGE+'><br><br>')
		//iwin.document.write('<INPUT TYPE="button" VALUE="Close Window" onClick="window.close();"></p>')
		iwin.focus()
	}
}
