
/*
These are sample functions that use pop-up windows to give a definition for a term.

They can be called using <A HREF="javascript:void('')" onClick=OpenDefinitionWindow()> 
or <A HREF="#" onClick="OpenDefinitionWindow()">

Created by Paul T. Marsh, WISHA webmaster /wisha 
*/

var WindowOpen=0
//These two variables are incremented as the user responds to a question

function closeDefinitionWindow()
	{	
	
	if (WindowOpen>0)
		{
		DefinitionWindow.close()
		WindowOpen=0
		}

	//This checks if DefinitionWindow is already open, and if it's already open
	//the conditional will close the open window and reset the value back to "0"
	
	return true
	}


function OpenDefinitionWindow(DefinitionID)
	{
	closeDefinitionWindow()
	var PageToLoad="/Safety/Topics/ReduceHazards/ergobank/codemodules/definitionterm.asp?GlossaryID="
	PageToLoad = PageToLoad + DefinitionID
	//alert(PageToLoad) //for troubleshooting
	DefinitionWindow=window.open(PageToLoad,'DefinitionWin','toolbar=no,scrollbars=yes,width=400,height=350')

	WindowOpen++
	//this increments "WindowOpen" so that if a user forgets to close the window, 
	//if they click on another definition
	//it'll close "DefinitionWindow" and reopen it with the proper response.
	}
