// copyright es4designs 2011

var basetime = 4000;
var refreshId;

$(document).ready(function(){
	$("#verse1-text").animate( { opacity: 0 }, 0);
	$("#verse2-text").animate( { opacity: 0 }, 0);
	runAnimation();
  	refreshId = setInterval("runAnimation()", basetime * 14);
  });


function runAnimation() {
	// alert("Start 1");
	$("#anitext").
			delay(basetime).
			animate( { opacity: 0.05, fontSize: '24px' }, basetime, function() { runAni_2() }).
			delay(basetime * 6.5).
			animate( { opacity: 1.00, fontSize: '24px' }, basetime);
	// alert("End 1");
}

function runAni_2() {
	// alert("Start 2");
	$("#verse1-text").
			delay(basetime * 1).
			animate( { fontSize: '22px', opacity: 1.00 }, basetime, function() { runAni_3() }).
			delay(basetime).
			animate( { opacity: 0.05, fontSize: '22px' }, basetime);
	// alert("End 2");
}

function runAni_3() {
	// alert("Start 3");
	$("#verse2-text").
			delay(basetime * 1.5).
			animate( { fontSize: '22px', opacity: 1.00 }, basetime).
			delay(basetime * 1.5).
			animate( { opacity: 0.05, fontSize: '22px' }, basetime);
	// alert("End 3");
}

function show(pad_out, pad_in) {
	// creates the target paths
	var link_elements = "#m1 li.menu-elem a";

	// creates the hover-slide effect for all link elements
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out, backgroundColor: '#123' }, 150);
		},
		function()
		{
			$(this).animate({ paddingLeft: pad_in, backgroundColor: '#ffddbb' }, 150);
		});
	});
}

