	/*
	***************************************
	
		Window Manipulation Library
		windows.js
	
		Created by: Evan Lavidor
		Updated: 	06 February 2006
	
	***************************************
	*/
	
	var popUpWin = 0;
	
	// *******************
	// open a popup window
	// *******************
	function popUpWindow(URLStr, left, top, width, height, centered) {
	
		// if window is already open, close it
		if(popUpWin) {
			if(!popUpWin.closed) popUpWin.close();
		}

		// if we're supposed to center the window, then ignore the left and top values and reset them accordingly
		if (centered) {
			left = (screen.width/2) - (width/2);
			top = (screen.height/2) - (height/2);
		}

		// open the window
		popUpWin = window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
		
		//focus
		popUpWin.focus();
	}


	// **************************
	// open link in parent window
	// **************************
	function openInParent(URLStr, closeThisWindow) {
		var parentWin = this.opener;

		try
		{
			// send to new location and focus on the parent
			parentWin.location = URLStr;
			parentWin.focus();
		}
		catch( e )
		{
			window.open(URLStr, 'popUpWin', 'toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=810,height=600,left=0,top=0');
		}

		// if we're supposed to close, then close the popup window
		if (closeThisWindow) {
			this.close();
		}	
	}
	
	
	// **************
	// close a window
	// **************
	function closeWin(theWindow) {
		// if we've passed in a window to close, then close it
		if (theWindow) {
			window.close(theWindow);
		}
		// otherwise, close the active window
		else {
			window.close(this);	
		}
	}