function openDbRelativeURL( url, target ){
	//Check we have a target window;
	target = (target == null ) ? window : target;
	//Work out the path of the database;
	path = location.pathname.split('.nsf')[0] + '.nsf/';
	target.location.href = path + url;
}


function doSearch (strSearchView){
	var s = document.forms[0].Query;
	var regExp1 = /\bfield\b/;
	var regExp2 = /[(,),<,>,\[,\]]/;
	var str = s.value;
	if ( str == "" ){ 
		alert("Query is empty !");
		s.focus();
	} else {
//		if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing 
			if ( regExp1.test( str ) || regExp2.test( str ) ){
				var alrt = "You cannot use:"; 
				alrt += "\n\nThe word: 'field'\nSymbols: [, ], (, ), < or >";
				alrt += "\n\nin the query!";
				s.focus();
				return alert( alrt );
			}
		openDbRelativeURL(strSearchView + "?SearchView&Query=" + escape( str ) + "&SearchFuzzy=true");
	}
}

function returnFalse(strSearchView){
	//if you want to do the search, use this line
	doSearch(strSearchView);
	//if you want to alert the user, use this line
	//alert('Please use the \'Go!!\' button to do a search');
	return false;
}

function KeyHit(k)
{
	var key=new Array();
	key[k]="x";
	eventChooser = event.keyCode;
	which = String.fromCharCode(eventChooser).toLowerCase();
	
	for (var i in key){
		if (eventChooser==i)
			return true;
	}
	
	return false;
}