var CToggleResults = new Class(
{
	initialize: function()
	{
		
		//alert(111);
		/*this.width_big = 308;
		this.height_big = 210;	
	
		this.width_small = 149;
		this.height_small = 100;	

		this.width_diff = this.width_big - this.width_small;
		this.height_diff = this.height_big - this.height_small;
		*/
		this.initEvents();
	},
	
	initEvents: function()
	{
		//alert(66)
		var base_url = "";
		var tc = $('table_content');
		var toggles = tc.getElements('.toggle');
		var fx_array = new Object();
		toggles.each(function(e, i)
		{
			var togg = e;
			
			var img_reset = e.getElements('img');
			var id = togg.id.replace('toggle_', '');
			var toggle_reset = $('togglecontent_' + id);
			fx_array[id] = new Fx.Slide($('togglecontent_' + id));
			fx_array[id].hide();
				
			e.addEvent('click', function(event)
			{
				var id = togg.id.replace('toggle_', '');
				var img = e.getElements('img');
				
				var tgc = $('togglecontent_' + id);
				var is_open  = fx_array[id].open;
				/////////////////
				var tc_reset = $('table_content');
				var toggles_reset = tc_reset.getElements('.toggle');
				
				toggles_reset.each(function(e, i)
				{
					var togg_inner = e;
					var img_reset = e.getElements('img');
					var id_inner = togg_inner.id.replace('toggle_', '');
					if (fx_array[id_inner].open)
					{
						fx_array[id_inner].hide();
						img_reset[0].src = base_url + '/img/toggle_out.gif';
						if ($('bottom_box'))
						{
							$('bottom_box').style.visibility = 'hidden';
						}
					}
				});
				////////////////
				if (!is_open) 
				{
					var trans = new Fx.Scroll(document.body);
					var new_y = $('toggle_' + id).getPosition().y - 95;
					trans.set(0, new_y);
					fx_array[id].slideIn();
					img[0].src = base_url + '/img/toggle.gif';
					if ($('bottom_box'))
					{
							$('bottom_box').style.visibility = 'visible';
					}
						
					//alert($('toggle_' + id).getPosition().y)
				}
			});
		});
	}
	
});
	
