var calloutArray = [
	"includes/callout_saag_sauce.html",
	"includes/callout_classic_sauce.html",
	"includes/callout_creamy_sauce.html",
	"includes/callout_spicy_sauce.html"
];
var calloutCount = 0;
var timer;
function calloutRotate()
{
	clearInterval(timer);
	var url = calloutArray[calloutCount];
	$.ajax({
		type:"GET",
		url:url,
		datatype:"html",
		success:function(data,status) { processData(data,status,"#callouts"); }
	});
	calloutCount = (calloutCount < calloutArray.length-1) ? calloutCount+1 : 0;
	//if(calloutCount < calloutArray.length)
	//	calloutCount++;
	timer = setInterval("calloutRotate()",10000);
}
/*-----------------------*/

function processData(data,status,id)
{
	if(status == "success")
	{
		var el = $(id);
		el.fadeOut("fast",function(){ el.fadeIn("fast").html(data) })
	}
}
/*-----------------------*/

var oldRecipe;
function initRecipeLinks()
{
	$(".recipeLink").click(function()
	{
		var attr = this.getAttribute("rel");
		if(oldRecipe != attr)
		{
			$("#"+oldRecipe).slideUp();
			$("#"+attr).slideDown();
		}
		else if(oldRecipe == attr)
		{
			var el = $("#"+attr)
			if(el.css("display") == "block")
				$("#"+attr).slideUp();
			else
				$("#"+attr).slideDown();
		}
		else
		{
			$("#"+attr).slideDown();
		}
		oldRecipe = this.getAttribute("rel");
		return false;
	});
}
/*-----------------------*/
