/******************** FLIPBOOK JAVASCRIPT ********************/
/** © 2009 G Media Limited **/
var delayTimer = 0;
var seqTimer = 0;
var showingItem = 1;
function manFlipItem(num) {
	flipItemMan(num);
	showingItem = num;
	clearTimeout(seqTimer);
	clearTimeout(delayTimer);
	delayTimer = setTimeout("runFlipbook()", 5000);
}
function flipItemMan(num) {
	$("#fL"+showingItem).hide();
	$("#fL"+num).show();
	//document.getElementById("fL"+showingItem).style.display = "none"; // hide the current large item
	//document.getElementById("fL"+num).style.display = "block"; // show the new large item
	$("#fS"+showingItem).removeClass("on"); // deactivate the current number
	$("#fS"+num).addClass("on"); // activate new number
}
function flipItemAni(num) {
	var prevNum = showingItem;
	//$("#fL"+showingItem).hide();
	//$("#fL"+num).show();
	$("#fL"+prevNum).fadeOut("fast", function(){ // hide the current large item
		$("#fS"+prevNum).removeClass("on"); // deactivate the current number
		$("#fS"+num).addClass("on"); // activate new number
		$("#fL"+num).fadeIn("fast"); // show the next large item
	});
}
function runFlipbook() {
	seqTimer = setTimeout("seqNextItem()", 5000);
}
function seqNextItem() {
	var nextNum = showingItem + 1 // NEXT ITEM!
	if (nextNum == 5) nextNum = 1;
	flipItemAni(nextNum);
	showingItem = nextNum;
	seqTimer = setTimeout("seqNextItem()", 5000);
}
$(document).ready(function(){
	runFlipbook();
});