/**
 * @class	O_Search
 * @author	Marco Troost
 */
var O_Search = new Class({
	
	/**
	 * initialize
	 * @param	string	root_node_id
	 * @param	integer	effect_type
	 * @return	void
	 */
	initialize: function(root_node_id)
	{
		// nodes
		this.root_node			= !root_node_id ? $('cs_search_pages_form') : $(root_node_id);
		
		this.input_node			= $$('#cs_search_pages_input input');
		this.button_node		= $$('#cs_search_pages_button a');
	},
	
	/**
	 * start
	 * @return	void
	 */
	start: function()
	{
		if (this.root_node)
		{			
			// set events
			this.setEvents();
		}
	},
	
	
	/**
	 * set events
	 * @return	void
	 */
	setEvents: function()
	{
		// set vars
		var _this	= this;

		if (_this.button_node && _this.button_node)
		{
			_this.button_node.set('onclick', 'return false');
			
			// show input
			_this.button_node.addEvent('click',function()			
			{				
				_this.input_node.setStyle('display', 'block');
				return false;
			}); 
			
			// hide input
			_this.input_node.addEvent('blur',function()			
			{	
				_this.input_node.setStyle('display', 'none');
				return false;
			}); 			
		}
	}

});
