﻿// JScript File
var mode = "Start";
var FJCount = 0;
var NCAACount = 0;
var MLBCount = 0;
var NFLCount = 0;
var AFLCount = 0;
var FJ, NCAA, MLB, NFL, Collection, AFL;
window.onload = function () {
	FJ = $('#Original div.swapImage img');
	NCAA = $('#NCAA div.swapImage img');
	MLB = $('#MLB div.swapImage img');
	NFL = $('#NFL div.swapImage img');
	AFL = $('#AFL div.swapImage img');
	Collection = 'FJ';
	setInterval("rotate()", 1500);
	//rotate();
};
function rotate() {
	var next;
	switch (Collection) {
		case 'FJ':
			next = 'NCAA';
			doRotate(FJ, ++FJCount);
			break;
		case 'NCAA':
			next = 'AFL';
			doRotate(NCAA, ++NCAACount);
			break;
		case 'AFL':
			next = 'NFL';
			doRotate(AFL, ++AFLCount);
			break;
		case 'NFL':
			next = 'MLB';
			doRotate(NFL, ++NFLCount);
			break;
		case 'MLB':
			next = 'FJ';
			doRotate(MLB, ++MLBCount);
			break;
	}
	Collection = next;
};
function doRotate(col, index) {
	var item = $(col.get((index % col.size())));
	item.css('z-index', index);
	item.fadeIn().slideDown(500, function () { item.siblings().hide(); });
};
