window.addEvent('domready', function(){
	
	/* Add a rollover style to each search result list item when you mouse over it */
	$$(".searchResultList li").addEvents({
	    mouseenter: function() {
             $(this).addClass("rollover");   
        },
	    mouseleave: function() {
             $(this).removeClass("rollover");
	    }
	});
	
	/* Add a wrapping class when you key into GLOBAL search input, and remove the wrap class when you key away from it */
	/* Objective: to create a border wrapping the GLOBAL search input */
	//$$("#userSearchWrapper .userSearchField").addEvents({
	//    focus: function() {
        //    $$("#userSearchWrapper").addClass("wrapFocus");
        //},
	 //   blur: function() {
         //   $$("#userSearchWrapper").removeClass("wrapFocus");
	 //   }
	//});
	
	/* Add a wrapping class when you key into TOP MAIN search input, and remove the wrap class when you key away from it */
	/* Objective: to create a border wrapping the TOP MAIN search input */
	//$$(".topMainSearch .mainSearchField").addEvents({
	//    focus: function() {
        //     $$(".topMainSearch .mainSearchInputWrapper").addClass("wrapFocus");   
        //},
	//    blur: function() {
        //     $$(".topMainSearch .mainSearchInputWrapper").removeClass("wrapFocus");
	//    }
	//});
	
	/* Initialisation of top main search */
	//$$(".topMainSearch").setStyle("height","83px");
	//$$(".advancedSearchTable").hide();
	//$$(".closeAdvancedSearch").hide();
	
	/* Click event on advanced search */
	$$(".advancedSearch").addEvent("click", function(el) {
        $$(".topMainSearch").setStyle("height","220px");  
		$$(".advancedSearchTable").show();
		$$(".advancedSearch").hide();
		$$(".closeAdvancedSearch").show();
    });
	
	/* Click event on close advanced search */
	$$(".closeAdvancedSearch").addEvent("click", function(el) {
        $$(".topMainSearch").setStyle("height","83px");  
		$$(".advancedSearchTable").hide(); 
		$$(".closeAdvancedSearch").hide();
		$$(".advancedSearch").show();
	});
	
});
