/**
 * @class	K_OnClickInputbox
 * @author	Marco Troost
 */
var K_OnClickInputbox = new Class({
	
	/**
	 * initialize
	 * @param	string	handler_id
	 * @param	string	input_value
	 * @return	void
	 */
	initialize: function(handler_id, input_value, element)
	{
		// nodes
		if(element)
		{
			// if inputbox has no id 
			this.handler_node	= $$('#'+handler_id+' '+element);			
		}
		else 
		{
			this.handler_node	= $(handler_id);			
		}

		
		// strings
		this.input_value	= input_value;
	},
	
	/**
	 * start
	 * @return	void
	 */
	start: function()
	{	
		if (this.handler_node)
		{
			// set events
			this.setEvents();
		}
	},
	
	/**
	 * set events
	 * @return	void
	 */
	setEvents: function()
	{
		// set vars
		var _this = this;
		if (this.handler_node)
		{
			this.handler_node.removeEvents();
			this.handler_node.set('value', this.input_value);

			this.handler_node.addEvent('click',function()			
			{
				var get_value = _this.handler_node.get('value');			
				if (get_value == _this.input_value)
				{					
					_this.handler_node.set('value', '');
				}
			});
			
			this.handler_node.addEvent('blur',function()			
			{
				var get_value = _this.handler_node.get('value');			
				if (get_value == '')
				{					
					_this.handler_node.set('value', _this.input_value);
				}
			});		 
		}
	}
	
});
