// 2010.03.04 - For AAF Pensacola
// Grendelfly - A Division of SC&G Technology Solutions
//
// Requires JQuery: jquery-1.3.2.min.js or above



$(function(){
$(document).ready(function() {

// Main Navigation Effect
	$('ul.mn_nav li').hover(function(){
		$(this).animate({'width':'254px'});
		},function(){
		$(this).animate({'width':'234px'});
		});

// Hero Animation
$('#idHeroOFF img.frame').show();
$('#idHeroOFF img.#pic_1').fadeIn(800);
var fTimer = ""; // Declears Variable fTime

// Rotator and Time Function
fTimer = setInterval(function(){fRotate()}, 5000); // timed at 5 seconds per rotation
							
function fRotate(){
	var nDiv = $('#idHero img.hero').length; nDiv = nDiv - 1; // Get number of divs in set
	var nPnl = $('#idHero_Stats').html(); nPnl = parseInt(nPnl) + 1; // Get what div (panel) number we're currently on and moves one forward
	if (nPnl>nDiv) { nPnl=0;}; // if we've seen all panels let's start from the beginning
	
	$('#idHero img.hero').fadeOut(1800); // hide all divs

	$('#idHero img.hero').each(function (index, domEle) { // index is 'number count' / domEle is 'this'

		if (index==nPnl){
			
			var titl_txt = $(domEle).attr('title');
			$('#idHero p').html(titl_txt);
			
			$(domEle).fadeIn(1800); // Change 'Show' effect here - show,fadeIn,slideDown
			$('#idHero_Stats').html(parseInt(nPnl));
			return false; // stops process			
		}; // if (index==nPnl)
	}); // $('#gFly_Rotr div').each

}; // function fRotate()


}); // $(document).ready(function()
}); // $(function()


