function check_user( dest_href, strNewWindowHref, ForceLogIn ){
	var	new_win;   // window object
	
	// create a window with no controls
	// Added ForceLogIn when user is Logged in as PUBUSER and uses CAD link Jim Dawson issue #20071
	if(ForceLogIn == 'true')
		new_win = window.open("/eptroot/public/include/check_user.asp?ForceLogIn=true&dest_href=" + escape(dest_href), "", "directories=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,height=135,width=390");
	else
		new_win = window.open("/eptroot/public/include/check_user.asp?dest_href=" + escape(dest_href), "", "directories=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no,height=135,width=390");
	
	return;
}
//*****************************************************************************
// Hack to get dev working again
//*****************************************************************************
   function submitform() {
      document.f.submit();
   }
   
   //function to allow the enter button submit the form
   function checkEnter(event){ 	
		var code = 0;
	
		if ((navigator.appName == 'Netscape'))
			code = event.which;
		else
			code = event.keyCode;
		if (code==13)
			document.f.submit();
	}

//*****************************************************************************

function openEPTHome( login ){
	var new_win;	// window object
	var nw_frames;	// frame object


	// if the user is logged in, load the main page without the login capability
	if (login == true){
		var str;
		var i;

		new_win = window.open('/eptroot/eptedge/default.htm');
		nw_frames = new_win.frames;

		for (i = 0, str = ""; i < nw_frames.length; i++){
			str = str + " frame " + i + " is '" + nw_frames(i).name + "' at location '" + nw_frames(i).location + "'\n";
		}

		for (i = 0; i < 1000000; i++)
			{ i = i + 1 - 1; }

		//new_win.alert(str + "\n" + i);
		//new_win.alert("hello marty");

		nw_frames(1).location = "/eptroot/eptedge/navigation.asp?Expand=Miscellaneous";
	}
	else {
		// open the default EPT Home page in a seperate window
		new_win = window.open('/default.asp');
	}

	return;
}


/* this function makes sure that all parent elements of object 'x' are shown,
 * by recursively calling itself on the parent of 'x'.
 */
function showParent( x )
{	if (x != null && typeof x.parentElement != "undefined")
	{	show(x.parentElement);           // draw this object
		showParent(x.parentElement);     // draw the parent of this object
	}
}


/* this functions makes sure that object 'x' is drawn on the screen */
function show( x )
{	if (x != null && typeof x.style.display != "undefined")
		x.style.display = "inline";      // draw the object
}


/* this function makes sure that object 'x' is NOT drawn on the screen */
function hide( x )
{	if (x != null && typeof x.style.display != "undefined")
		x.style.dipslay = "none";        // don't draw the object
}


/* this function simply toggles the displays status of object 'x'.  if it is
 * currently not displayed, then calling this function will force it to be
 * displayed.  if it is being displayed, then calling this function will force
 * it NOT to be displayed.  notice that we also make sure any parent objects
 * of 'x' are shown (after all, if 'x' is displayed, but the object it is
 * inside is not, then 'x' will not be seen).
 */
function toggleDisplay( x )
{	/* first, make sure that x is a valid object that supports styles */
	if (x != null && typeof x.style.display == "undefined")
	{ return; }

	if (x.style.display == "none")
	{	showParent(x);                   // make sure all parents are visible
		x.style.display = "inline";      // make the menu visible
		x.scrollIntoView(true);          // bring the new menu into view
	}
	else {
		x.style.display = "none";        // make the menu invisible
   }
}


/* here, if the page being loaded has a title, we force that title to be the
 * one in the window's title-bar.  any page that never intends to use its
 * title should NOT have one (otherwise, it will be used).
 */
function setTitle( x )
{	if (x != null && typeof top.document.title != "undefined")
		top.document.title = x;
}


/* this function dynamically loads a file (whose filename is specified by x)
 * into the contents frame (which _should_ be the left-navigation frame)
 */
function loadContents( x )
{	if (x != null && typeof x != "undefined" && typeof top.contents != "undefined")
		top.contents.location.href = x;
}


/* this function dynamically loads a file (whose filename is specified by x)
 * into the main frame (which _should_ be the center frame through which all
 * active content is displayed)
 */
function loadMain( x )
{	if (x != null && typeof x != "undefined" && typeof top.main != "undefined")
		top.main.location.href = x;
}


/* this function dynamically loads a file (whose filename is specified by x)
 * into the banner frame (the one containing the page's header)
 */
function loadBanner( x )
{	if (x != null && typeof x != "undefined")
	{	/* next, we check to see if either 'FrameTop' or 'banner' is the name
		 * of the frame for the header (they are different depending on if you
		 * are logged in or not).  this makes sure that the correct one is
		 * used
		 */
		if (typeof top.FrameTop != "undefined")
			top.FrameTop.location.href = x;
		else if (typeof top.banner != "undefined")
			top.banner.location.href = x;
	}
}


/* this function dynamically loads a file (whose filename is specified by x)
 * into the FrameBottom frame (the one containing the solve button)
 */
function loadFooter( x )
{	if (x != null && typeof x != "undefined" && typeof top.FrameBottom != "undefined")
		top.FrameBottom.location.href = x;
}


/* this function hides the footer frame without reloading anything */
function hideFooter ()
{ top.outerFrameset.rows = "68,*,0"; }


/* this function shows the footer frame without reloading anything */
function showFooter ()
{ top.outerFrameset.rows = "68,*,33"; }


/* this toggles the display status of the footer */
function toggleFooter ()
{  if (top.outerFrameset.rows == "68,*,33")
      hideFooter();
   else
      showFooter();
}
