
/*** utility.js ***/
/**
  Utility functions and classes
  (C)2006 elab
*/

if (!Array.prototype.push) {
  Array.prototype.push = function(el) {
    this[this.length] = el; 
  };
}

var WRollback = function(element, mouseOverFunction, mouseOutFunction) {
  this.element = $(element);
  this.over = mouseOverFunction;
  this.out = mouseOutFunction;
  this.element.onmouseover = mouseOverFunction;
  this.element.onmouseout = mouseOutFunction; 
};
WRollback.prototype.disable = function() {
  this.element.onmouseover = null;
  this.element.onmouseout = null;
};
WRollback.prototype.enable = function() {
  this.element.onmouseover = this.over;
  this.element.onmouseout = this.out;
};


/*** search_suggest.js ***/
cancelDefaultEvents = function(keyEvent) {
  if (keyEvent.preventDefault) keyEvent.preventDefault();
  keyEvent.returnValue = false;
};

var searchRolloverImage = new Image(19,16,'/wf/gfx/searchsquare_rounded_over.gif');

Event.observe(window,"load",function(a){
	
    $('searchBox').setAttribute('autocomplete', 'off');
	 
	new WRollback("search",
	  function(b){
		 Element.addClassName("search","hover");
         $("searchButton").src="/wf/gfx/searchsquare_rounded_over.gif"
      },
  
      function(b){
        Element.removeClassName("search","hover");
        $("searchButton").src="/wf/gfx/searchsquare_rounded.gif"
     })

     $("searchBoxLabel").show();
     $("searchBox").observe("focus",function(){$("searchBoxLabel").hide() });
     $("searchBox").observe("blur", function(){if(!$F("searchBox")){$("searchBoxLabel").show()}})
});
