/** ------------------------------------------------------
 * Variable Declaration
* ------------------------------------------------------
*/
var tabs = new Array('muffins', 'snackin_chips', 'garlic_chips', 'melts', 'quesadillas', 'bars');
var tabs_container = new Array('muffins_recipe', 'snackinchips_recipe', 'garlicchips_recipe', 'melts_recipe', 'quesadillas_recipe', 'bars_recipe');

/** ------------------------------------------------------
 * Tab Events
* ------------------------------------------------------
*/

function initTabs()
{
	for (var i=0; i<tabs.length; i++)
	{
		var ct = document.getElementById( tabs[i] );
		if( ct ) ct._index     = tabs[i];
		if( ct ) ct._container = tabs_container[i];
		if( ct ) ct._tracking  = tabs_tracking[i];
		if( ct ) ct.onmouseup  = function(){
			swapTabs( this._index );
			trackTag( this._tracking );
		};
		if( ct ) ct.onclick = function(){ return false; };
		
	}
};

function swapDivs(id)
{
	for (var i=0; i<tabs.length; i++)
	{
		var ct = document.getElementById( tabs_container[i] );
		ct.style.display = (tabs[i]==id) ? 'block' : 'none';
		scrollTo(0,500);
	}
};


/** ------------------------------------------------------
 * Construct
* ------------------------------------------------------
*/
function init_si(){
	initTabs();
};
window.onload = init_si;


