$(function(){
	$(".accordion").accordion({"autoHeight":false});

	$(".accordion a, .accordion h2").click(function(){
		$(this).css("outline","none");
	});

	$('.aboutbox .block p:eq(0)').mouseover(function(){
		sIFR.replacements[0].changeCSS('.sIFR-root { background-color: #ffffff; color: #774117; text-decoration:none; } a { color:#bea704; text-decoration:none; } a:hover { color:#bea704; }');
	}).mouseout(function(){
		sIFR.replacements[0].changeCSS('.sIFR-root { background-color: #ffffff; color: #774117; text-decoration:none; } a { color:#774117; text-decoration:none; } a:hover { color:#bea704; }');
	});

	$('.aboutbox .block p:eq(1)').mouseover(function(){
		sIFR.replacements[1].changeCSS('.sIFR-root { background-color: #ffffff; color: #774117; text-decoration:none; } a { color:#bea704; text-decoration:none; } a:hover { color:#bea704; }');
	}).mouseout(function(){
		sIFR.replacements[1].changeCSS('.sIFR-root { background-color: #ffffff; color: #774117; text-decoration:none; } a { color:#774117; text-decoration:none; } a:hover { color:#bea704; }');
	});

	var $mg = $("#main-grains");
	if( $mg.length > 0 )
	{
		setTimeout( slideIn, 4000 );
	}

});

function slideOut()
{
	$("#main-grains a").stop().animate({"width":"218px"}, "normal", "swing");
}

function slideIn()
{
	$("#main-grains a").stop().animate({"width":"115px"}, "normal", "swing", makeHover);
}

hoverBound = false;
function makeHover()
{
	if( !hoverBound ) $("#main-grains a").hover( slideOut, slideIn );
	hoverBound = true;
}
