/* homepage js */

/** image rotation **/

/** quote rotation **/

var quoteSelector = '#rotating_quotes span';
var quoteTimeout = 10000; // timeout in milliseconds
var lastQuoteIndex = -1; // init last quote index to invalid number
var quotes = [
{'quote': 'Satan does not care what you do as long as you do not do it NOW!', 'size': 18},
{'quote': 'If the devil reminds you of your past, remind him of his future.', 'size': 18},
{'quote': 'The men that move the world are the men that do not allow the world to move them.', 'size': 18},
{'quote': 'When I can\'t, God can;  when I can and don\'t, God won\'t.', 'size': 18},
{'quote': 'Our children are living messages we send to a time and a place we will never see.', 'size': 18},
{'quote': 'Contentment is not found in circumstances but in the condition of the heart.', 'size': 18},
{'quote': 'Authority is either established or destroyed in youth.', 'size': 18},
{'quote': 'A person has hope as long as he will listen.', 'size': 18},
{'quote': 'God\'s work done in God\'s way will never lack God\'s supplies.', 'size': 18},
{'quote': 'A Pharisee is hard on others and easy on himself, but a spiritual man is easy on others and hard on himself.', 'size': 14},
{'quote': 'If you have the smile of God what does it matter if you have the frown of men?', 'size': 18},
{'quote': 'Die to self - die to compliments - die to criticism.', 'size': 18},
{'quote': 'We fear men so much because we fear God so little.', 'size': 18},
{'quote': 'My main ambition in life is to be on the devil\'s most wanted list.', 'size': 18},
{'quote': 'What we see depends mainly on what we look for.', 'size': 18},
{'quote': 'He that is too busy to pray is too busy to lead a holy life.', 'size': 18},
{'quote': 'Never sacrifice the future on the altar of the immediate.', 'size': 18},
{'quote': 'The fire of God does not fall upon an empty altar.', 'size': 18}
];

/**
 * puts a new quote into the element found by $(quoteSelector)
 */
function changeQuote() {
	// make sure we're not repeating the last quote immediately
	do {
		var newQuoteIndex = Math.floor(Math.random()*quotes.length);
	} while (newQuoteIndex == lastQuoteIndex);
	lastQuoteIndex = newQuoteIndex;
	
	var new_quote = quotes[newQuoteIndex];
	var text = $(quoteSelector);
	
	var quote = new_quote.quote;
	var size = new_quote.size;

	text.fadeOut('slow', function(){
		text.html(quote).css('fontSize', size).fadeIn('slow');
	});
	
	// rinse and repeat
	setTimeout('changeQuote()', quoteTimeout);
}

try{
/* quotes init */
$(document).ready(function(){
	var text = $(quoteSelector);
	text.fadeIn('slow');
	setTimeout('changeQuote()', quoteTimeout);
});


/* image fade init */
$(document).ready(function(){
	$('#rotatingImages').innerfade({containerheight: 316, containerwidth: 316});
});

} catch (e) {}