var win;
win = null;
function closePopWin() 
	{
	if(win != null) 
		{
		if(!win.closed) 
			{
			win.close();
			win = null;
			} 
		else 
			{
			win = null;
			}
		}
	}

//openPopup() moved from functions_window.js 2-1-05 for "Send to a Colleage" popup functionality.
function openPopup( pageToLoad, winName, width, height, center, scroll, winXpos, winYpos, resize) {
	xposition = 0;
	xposition = winXpos;
	yposition = 0;
	yposition = winYpos;
	resizable = 0;
	resizable = resize;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)) {
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	}
	args = "width=" + width + ","     + "height=" + height + "," 
	+ "location=0," + "menubar=0,"  + "resizable=" + resizable + "," + "scrollbars=" + scroll + ","
	+ "status=0,"   + "titlebar=0," + "toolbar=0," +                   "hotkeys=0,"
	+ "screenx=" + xposition + ","  //NN Only
	+ "screeny=" + yposition + ","  //NN Only
	+ "left=" + xposition + ","     //IE Only
	+ "top=" + yposition;           //IE Only
	var win = window.open( pageToLoad,winName,args );
}

function NewWindow(mypage, myname, w, h, scroll) 
	{
	closePopWin();
	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize';
	if( mypage.indexOf("bmLocale") < 0 ) 
		{
		if( mypage.indexOf("?") < 0 ) 
			{
			mypage = mypage + "?";
			}
		else 
			{
			mypage = mypage + "&";
			}
		mypage = mypage + "bmLocale=en_US";
		}
	
	win = window.open(mypage, myname, winprops);
}


function imgRolloverOn()
	{
	this.imgSave = document.images[this.imgName].src;
	document.images[this.imgName].src = this.imgOn.src;
	}

function imgRolloverOff()
	{
	document.images[this.imgName].src = this.imgSave;
	}

function Rollover(imgName, on)
	{
	this.imgName = imgName;
	this.imgOn = new Image();
	this.imgOn.src = on;
	this.on = imgRolloverOn;
	this.off = imgRolloverOff;
	}
	
function toDoOn()
{
	document.getElementById("todoDiv2").style.visibility = "hidden";
	document.getElementById("todoDiv").style.visibility = "visible";
}
function toDoOff()
{	
	document.getElementById("todoDiv2").style.visibility = "visible";
	document.getElementById("todoDiv").style.visibility = "hidden";
}


function InsertObjectToDocument(toDocument, insertObject)
{
    toDocument.write(insertObject); 
}