Event.observe(window,'load', function(){
	  Event.observe('search_form','submit',search);
	  Event.observe('search_form','click',function(ev){ 
		  $('search').value = '';  
	  });
});

function hide_block(block)
{
	if ($(block).getStyle('display') != 'none') new Effect.SwitchOff(block);
}

function show_block(block)
{
	if ($(block).getStyle('display') == 'none')	new Effect.BlindDown(block);					
}

function err(t)
{
	alert('Error ' + t.status + ' -- ' + t.statusText);
}

String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
};

function search(ev) { ev.stop(); window.location = application_root+'search/'+encodeURIComponent($F('search')); }

