/*Site is Designed and Developed by studioblossoms you can find us @ www.studioblossoms.com*/
var current_links = new Array(null);
var recent_array = new Array(3, 0 );

window.addEvent("domready", function()
{
	for(i = 1; i <= recent_array.length; i++)
	{
		var scroll = new Fx.Scroll("recent_" + i, 
		{
			wait: false,
			duration: 500,
			wheelStops: false,
			transition: Fx.Transitions.Quad.easeInOut
		});

		for(j = 1; j <= recent_array[i-1]; j++)
		{
			$("recent_link_" + i + "_" + j).scroll = scroll;
			$("recent_link_" + i + "_" + j).index = i;
			$("recent_link_" + i + "_" + j).item = "recent_" + i + "_" + j;
			$("recent_link_" + i + "_" + j).addEvent("click", function(event)
			{
				event = new Event(event).stop();

				current_links[this.index].className = "";
				this.className = "active_link";
				current_links[this.index] = this;

				this.scroll.toElement(this.item);
			});
		}
	}
});

function toggle_work(wrapper_id, link)
{
	var wrapper = "recent_" + wrapper_id;
	var first_frame = wrapper + "_1";	
	var first_link = "recent_link_" + wrapper_id + "_1";
	var link_wrapper = "recent_links_" + wrapper_id;

	var scroll = new Fx.Scroll(wrapper, 
	{
		wait: false,
		duration: 500,
		wheelStops: false,
		transition: Fx.Transitions.Quad.easeInOut
	});

	if(link.src.test("enlarge"))
	{
		current_links[wrapper_id] = $(first_link);
		current_links[wrapper_id].className = "active_link";

		$(wrapper).effect("height", {duration:1000}).start(120, 272).chain(function(){$(link_wrapper).setStyle("opacity", 0);$(link_wrapper).setStyle("display", "block");$(link_wrapper).effect("opacity", {duration: 500}).start(0.0, 1.0);});
		link.src = "images/close_button.jpg";
	}
	else
	{
		if(current_links[wrapper_id].className)
			current_links[wrapper_id].className = "";

		if(!current_links[wrapper_id].id.test("_1$"))
			scroll.toElement(first_frame).chain(function(){$(link_wrapper).effect("opacity", {duration: 500}).start(1.0, 0.0).chain(function(){$(wrapper).effect("height", {duration:1000}).start(272, 120)})});
		else
			$(link_wrapper).effect("opacity", {duration: 500}).start(1.0, 0.0).chain(function(){$(wrapper).effect("height", {duration:1000}).start(272, 120)});

		current_links[wrapper_id] = $(first_link);
		current_links[wrapper_id].className = "active_link";

		link.src = "images/enlarge_button.jpg";
	}
}
