// javascript by Marco Balestra <balestra@cesmail.net>
// associato a http://www.fao.org/waicent/search/default.asp

function frmSearch_onSubmit(theForm) {
  theForm.QueryString.value = theForm.QueryString.value.toString().replace(/^ +/,"");
  theForm.QueryString.value = theForm.QueryString.value.toString().replace(/([^ ]) +$/,"$1");
  if ( theForm.QueryString.value != '') return true;
  alert('Please enter some text and try your search again.');
  return false;
}

with (self.document) {
 writeln('<img src="'+params.topImages+'fo-up.gif" alt="" align="bottom" />');
}

window.onload = function(){
 var l;
 l = getObj('tdLangBar'); if (l) l.innerHTML = l.innerHTML.replace(/<\/tr>/i,'<td><img src="'+params.topImages+'fo-lang-end.gif" alt="" /></td></tr>');
 l = getObj('searchFormBox'); if (l) l.innerHTML = '<img src="'+params.topImages+'fo-up.gif" alt="" align="bottom" />';
 l = getObj('menubarLineUp'); if (l) l.innerHTML = '<img src="'+params.topImages+'fo-lang-end-top.gif" alt="" />';
};
