function PutInFrame(framePage, frameName, pageName)
/* Purpose:    Ensure that the current page is displayed inside a frameset.
   In:              framePage - URL of frameset
                     frameName - Name of the frame of the frameset
                     pageName - Optional. If given, overrides current page's URL.
   Changes    2002 05 19 Created by Magne Myrtveit
*/ {
	if(parent.location.href == window.location.href) {
		parent.location.href =
			framePage + "?" +escape(frameName) + "=" +
			escape(typeof pageName != "undefined" ?
				pageName :
				window.location.href);
	}
} // end PutInFrame
