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("Fyrirspurnin er tom!");
		s.focus();
	} else {
		if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing 
			if ( regExp1.test( str ) || regExp2.test( str ) ){
				var alrt = "Athugašu aš žś mįtt ekki nota:"; 
				alrt += "\n\nFrįtekna oršiš 'field'\nttįknin [, ], (, ), < eša >";
				alrt += "\n\nķ fyrirspurninni!";
				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;
}
