com_limelife_search = function() {
	
	var e = YAHOO.util.Event;
	
	return {
		el:null,
		box:null,
		iput:null,
		
		init: function(){
			e.onContentReady('search', this.onContentReadyHandler, this );
		},		

		onContentReadyHandler: function( obj ) {
			/// current scope is element we were listening for
			obj.doInit();
		},
		

		
		doInit: function(){
//			this.el = YAHOO.util.Dom.get('search'); 
//			this.box = YAHOO.util.Dom.get('searchForm'); 
//			this.iput = YAHOO.util.Dom.get('srchEl');  
//			
//			YAHOO.util.Dom.setStyle( this.el, 'cursor', 'pointer');
//			YAHOO.util.Dom.setStyle( this.box, 'display', 'none');
//			
//			var obj = this;
//			this.el.onmouseover = function(){
//				obj.onOverEl();	
//			}
//			this.el.onmouseout = function(){
//				obj.onOutEl();	
//			}
//			this.iput.onfocus = function(){
//				obj.onFocusIput();	
//			}
//			this.iput.onblur = function(){
//				obj.onBlurIput();	
//			}
			
		},
		
		onOverEl: function(){
			YAHOO.util.Dom.setStyle( this.el, 'backgroundColor', '#929291');
			YAHOO.util.Dom.setStyle( this.el, 'color', '#ffffff');
			YAHOO.util.Dom.setStyle( this.box, 'display', 'block');
		},
		onOutEl: function(){
			if (this.focused)
				return;
			YAHOO.util.Dom.setStyle( this.el, 'backgroundColor', '#ffffff');
			YAHOO.util.Dom.setStyle( this.el, 'color', '#B9B9B8');
			YAHOO.util.Dom.setStyle( this.box, 'display', 'none');
		},
		onFocusIput: function(){
			this.focused = true;
		},
		onBlurIput: function(){
			this.focused = false;
			YAHOO.util.Dom.setStyle( this.box, 'display', 'none');
		},
		
		displayResults: function(){
		      var expansion = YAHOO.util.Dom.getElementsByClassName('gsc-expansionArea', 'div');
		      expansion.style.display = "block";
		},
		
		doSearch: function()
		{
	      // Dynamically load CSS to override defaults
	      //var css = document.createElement('link');
	      //css.href = '../../css/gsearch_green.css';
	      //css.type = 'text/css';
	      //css.rel = 'stylesheet';
	      //document.getElementsByTagName('head')[0].appendChild(css);
	      
	      // Create a search control
	      var searchControl = new google.search.SearchControl();
	  	  var displayOpts = new GsearcherOptions();

	  	  displayOpts.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
	      
	
	      // site restricted web search with custom label
	      // and class suffix
	      var siteSearch = new google.search.WebSearch();
	      siteSearch.setUserDefinedLabel("LimeLife");
	      siteSearch.setUserDefinedClassSuffix("siteSearch");
	      siteSearch.setSiteRestriction(WEB_URL.substring(7));
	      searchControl.addSearcher(siteSearch, displayOpts);
	
		  // Set the default results size to be 8 (the largest)
		  searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
	
	      // Establish a keep callback
	     // searchControl.setOnKeepCallback(null, DummyClipSearchResult);
	
	      // tell the searcher to draw itself and tell it where to attach
	      searchControl.draw($("google_search_control"));
	     
	
	      // execute an inital search
	      searchControl.execute(com_limelife_tools.getParameter("q"));
		}
		
	}
}();

com_limelife_search.init();