function dbSearch( strTestament, strBook){ /*If the arguments are empty it means to search the whole db. The arguments are only meant to narrow the search.*/ strSearchString = document.forms[0].searchValue.value; if (strSearchString == ''){ alert('Ingenting å søke etter.'); return(false); } strView = "webSearchView"; strDb = document.forms[0].dbPath.value; strArgs = strSearchString; searchURL = '/' + strDb + '/' + strView + '?SearchView&Query='; if (strTestament != ''){ strArgs += (strArgs != '') ? '+AND+':''; strArgs += 'FIELD+Testament+contains+' + strTestament; } if (strBook != ''){ strArgs += (strArgs != '') ? '+AND+':''; strArgs += 'FIELD+Book+contains+"' + strBook + '"'; } searchURL += strArgs; window.location.href = searchURL; return false; } function returnFalse( strTestament, strBook ){ dbSearch( strTestament, strBook ); return false; }