// Service Logic
// Grendelfly - A Division of SC&G Technology Solutions
// 2011.05.18
// Requires JQuery: jquery-1.4.2.min.js


$(function(){
$(document).ready(function() {

	var i = 0;
	var j = 0;
	var fTimer = setInterval( function(){ fRotate(); }, 8000); // timed at 5 seconds per rotation	
	
		function fSwitch(i){
			$('#idHero img').hide();
			$('#itm_' + i).fadeIn();
			};
			
		fRotate();
		function fRotate(){
			var g_i = $('#idHero img').last().attr('id').replace('itm_','');
			i++; if(i > Number(g_i)){i = 1};
			fSwitch(i);
			};
			
		fRandom();
		function fRandom(){
			var g_i = $('#idHero img').last().attr('id').replace('itm_','');
				g_i = g_i - 1;
			var n_i = Math.floor(Math.random()*g_i)
				n_i = n_i + 1;
			fSwitch(n_i);
			};
		

}); // $(document).ready(function()
}); // $(function()

