// JavaScript Document
// tabs.js - controls generic tab animations for Evoke site

function tabanim(linkid, numtabs)
{
	var noclass = false;
	if(arguments.length == 3)
	{
		noclass = true;
	}
	// if we're showing everything
	if(linkid == -1)
	{		
		if(!noclass)
		{
			document.getElementById('all-link').className = "active";
		}
		for(i=1; i<=numtabs; i++)
		{
				tabstr = "#tab-" + i;
				$j(tabstr).slideDown(800, 'easeInExpo');
				if(!noclass)
				{
					document.getElementById(i+ '-link').className = "";
				}
		}
		
	}
	else
	{
		if(!noclass)
			document.getElementById('all-link').className = "";
		for(i=1; i<=numtabs; i++)
		{
			if(i == linkid)
			{
				tabstr = "#tab-" + i;
				$j(tabstr).slideDown(800, 'easeInExpo');
				if(!noclass)
					document.getElementById(i+ '-link').className = "active";
				continue;
			}
			tabstr = "#tab-" + i;
			$j(tabstr).slideUp(800, 'easeOutExpo');
			if(!noclass)
				document.getElementById(i+ '-link').className = "";
		}
	}
}
