function NewWindow( URL, strConfig ) {
	var newWindow = window.open( URL, "_blank", strConfig );
	newWindow.focus();
}

function OpenAgent( agentName, parameters ) {
	var URL = thisDb + "/" + agentName + "?OpenAgent";
	if( parameters.match( "&UN" ) == "&UN" )  URL += "&UN=" + uName
	if( parameters != "" )  URL += "&AP=" + parameters
	
	var newPage = window.open( URL, "_top", "" );	
	newPage.focus();
}

// Menu command functions
function Go(){return}
function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

function netscapeKeyPress(e) {
	if( e.which == 13 ) {
		goSearch();
		return false;
	}
	return true;
}

function microsoftKeyPress() {
	if( navigator.appName !== 'Netscape') {
		if( window.event.keyCode == 13 ) {
			goSearch();
			return false;
		}
	}
	return true;
}

function goSearch() {
	var searchForm = document.forms[0];
	var searchFor = searchForm.keywords.value;
	var searchView = 'WebContent';

// Ensure search text has been provided	
	if( searchFor == "" || searchFor == "enter search text" ) { 
		alert("Please provide some search text before attempting to search.");
		return false;
	}	
	
	// Submit the search	
	var searchURL = thisDb + '/' + searchView + '/?SearchView&Query="' + searchFor + '"&SearchMax=5000'
	//alert( searchURL );
	window.location = searchURL;
	return true;
}

function printit() {  
	if (window.print) {
		window.print() ;  
	} else {
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);  //Use a 1 vs. a 2 for a prompting dialog box
		WebBrowser1.outerHTML = "";  
	}
}

function sendMessage( toWho )  {
	var strConfig = "width=600,height=500, status=no,toolbar=no,menubar=no,scrollbars=no,scrolling=no";
	
	if( toWho == "toFriend" ) {
		var theURL = location.href;
		var theTitle = document.title;
		window.open( thisDb + "/WebTell?OpenForm&Title=" + theTitle + "&Go=" + theURL, "", strConfig);	
	} else {
		window.open( thisDb + "/WebTell?OpenForm", "", strConfig);	
	}
}