/**
 * class	JH_ImageScrubber
 * author	Paul Kruijt
 */
var JH_ImageScrubber = new Class({
	
	/**
	 * initialize
	 * @return void
	 */
	initialize: function()
	{
		// nodes
		this.filter_page_node				= $('filter_page');
		this.main_node						= $('main');
		
		this.search_navigation_node			= $('search_navigation');
		this.homepage_navigation_node		= $('homepage_navigation');
		this.page_navigation_node			= $('page_navigation');
		
		this.search_results_node			= $('search_results');
		this.homepage_results_node			= $('homepage_results');
		this.homepage_results_found_node	= $('homepage_results_found');
		this.homepage_results_total_node	= $('homepage_results_total');
		this.details_results_node			= $('details_results');
		this.details_results_found_node		= $('details_results_found');
		this.details_results_total_node		= $('details_results_total');
		
		// classes
		this.hide_class	= 'hide';
		
		// strings
		this.homepage_item_prefix	= 'homepage_item_';
		
		// settings
		this.alpha_duration	= 400;
	},
	
	/**
	 * start
	 * @return void
	 */
	start: function()
	{
		// set object as var
		var _this	= this;
		
		// get item nodes
		var item_nodes			= $$('#homepage .item_img');
		var total_item_nodes	= item_nodes.length;
		
		if (total_item_nodes > 0)
		{
			for (var a=0; a<total_item_nodes; a++)
			{
				var item_node		= item_nodes[a];
				var item_node_id	= item_node.id;
				
				// start cymeq software image scrubbers
				var cs_image_scrubber = new CS_ImageScrubber(item_node_id);
				cs_image_scrubber.start();
				
				//set events
				item_node.onclick = function()
				{
					var item_node_id		= this.id;
					var arr_item_node_id	= item_node_id.split(_this.homepage_item_prefix);
					var details_id			= arr_item_node_id[1];
					
					document.location = 'index.php?page_id='+details_page_id+'&portfolio_id='+details_id;
				}
			}
		}
	}
	
});