
		function SearchKeyPress(searchtext,e)
			{
		    var key;
			if(window.event)
				{
				key = window.event.keyCode;     //IE
				}
			else
				{
				key = e.which;     //firefox
				}
    		if(key == 13)
    			{
				search(searchtext);
				return false;
				}
			else
				{
				return true;
				}
			}


	function search(stext)
		{
		//alert("text="+stext);
		//attempt to get the search text from the current document
		//var searchtext = document.getElementById("txtsearch").value
		//pass the search text to _search.htm

		//if the fra_contents frame doesn't exist then display the search results on the current page
		if (document.getElementById("fra_contents") != null)
			{
			window.open("_search.htm?searchTxt="+stext, "fra_contents");			
			}
		else
			{
			location.href = "_search.htm?searchTxt="+stext+"&type=noframes";
			}
		
		}
	



	function DisplayIndex()
		{
		ShowIndex();
		}


	function ShowIndex()
		{
		//alert("displayindex");
		if (document.getElementById("fra_contents") != null)
			{
			window.open("_keywordindex.htm", "fra_contents");
			}
		else
			{
			location.href = "_keywordindex_noframes.htm";
			}
		}


	function ShowContents()
		{
		if (document.getElementById("fra_contents") != null)
			{
			window.open("contents.htm", "fra_contents");
			}
		else
			{
			location.href = "default.htm";
			}

		}


	
	function addtofav()
		{
		//if there is a basefrm frame then get the URL from there, otherwise get the url for this page.
		if (document.getElementById("basefrm") == null)
			{
			//Get URL from basefrm frame
			var sFavURL=String(location.href);
			var sPageName = sFavURL.substr(sFavURL.lastIndexOf("/")+1)
			}
		else
			{
			//get URL from this page
			var sPageURL=String(window.basefrm.location);
			var sPageName = sPageURL.substr(sPageURL.lastIndexOf("/")+1)
			var sFavURL =  "http://" + location.hostname + location.pathname + "?" + sPageName
			}

		//remove any %20 codes (space codes)
		sPageName = sPageName.replace(/%20/g, " ");
		var sTitle="Help Console - " + sPageName;
		//window.external.AddFavorite(sFavURL,sTitle);
			
		if (window.sidebar) 
			{ 
			//window.sidebar.addPanel(sURL, sTitle,"");
			window.sidebar.addPanel(sTitle,sFavURL,"");
			alert("Firefox users: This link will open in your Sidebar\nrather than the main page!\nTo prevent this please right click the link and choose\n'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is unavoidable with Firefox");
			}
		else if( window.opera && window.print ) 
			{ 
			alert("Opera users: By Default this link will open in your Sidebar\nrather than the main page!\nTo prevent this please uncheck the box marked\n'Show in Panel' that appears on the Add Bookmark window\n\nSorry about this, but it is currently unavoidable with Opera");
			var mbm = document.createElement('a');
			mbm.setAttribute('rel','sidebar');
			mbm.setAttribute('href',sFavURL);
			mbm.setAttribute('title',sTitle);
			mbm.click();
			}
		else if( document.all ) 
			{ 
			window.external.AddFavorite( sFavURL, sTitle); 
			} 

		}
	


	function printpage()
		{
		//if the basefrm frame exists then print the contents
		if (document.getElementById("basefrm") != null)
			{
			printframe();
			}
		else
			{
			//If this is IE then print the cell containing the page HTML. If this is another browser then print the entire page.
			if (navigator.userAgent.toLowerCase().indexOf("ie") == -1)
				{
				//Current browser is not IE
				window.print();
				}
			else
				{
				//Current browser is IE
				print_noframes();
				}
			}
		}


	function printframe()
		{
		//print the basefrm frame
		window.frames['basefrm'].focus(); 
		window.frames['basefrm'].print();
		}


	function print_noframes()
		{
		var printIframe = document.createElement("IFRAME");
		document.body.appendChild(printIframe);
		var printDocument = printIframe.contentWindow.document;
		printDocument.designMode = "on";
		printDocument.open();
		var currentLocation = document.location.href;
		currentLocation = currentLocation.substring(0, currentLocation.lastIndexOf("/") + 1);
		var htmlcontent = document.getElementById("td_noframes_main")
		printDocument.write("<html><head></head><body>" + htmlcontent.innerHTML + "</body></html>");
		printDocument.close();

		try
			{
			if (document.all)
				{
				var oLink = printDocument.createElement("link");
				oLink.setAttribute("href", currentLocation + "pagestyles.css", 0);
				oLink.setAttribute("type", "text/css");
				oLink.setAttribute("rel", "stylesheet", 0);
				printDocument.getElementsByTagName("head")[0].appendChild(oLink);
				printDocument.execCommand("Print");
				}
			else
				{
				printDocument.body.innerHTML = "<link rel='stylesheet' type='text/css' href='" + currentLocation + "pagestyles.css'></link>" + printDocument.body.innerHTML;
				printIframe.contentWindow.print();
				}
			}
		catch(ex)
			{
			}
		document.body.removeChild(printIframe);
		}






	function loadpage()
		{
		//if a page was passed in the url,load it now
		if (top.location.href.lastIndexOf("?") > 0)
			{
			var sPage=top.location.href.substring(top.location.href.lastIndexOf("?")+1,top.location.href.length);
			var myframe=document.getElementById("basefrm");
			//if the 'basefrm' frame is not found then assume that this is a "no-frames" help console
			if (myframe == null)
				{
				location.href=sPage;
				}
			else
				{
				document.getElementById("basefrm").src=sPage;
				}
			}
		}
