/**
 * JavaScript for JamesHanton.com - requires JQuery and JQuery Cycle plugin
 */
var browser, version;
browser = navigator.appName;
version = parseFloat(navigator.appVersion);

$('#front-graphic').cycle({ 
	fx: 'fade',
	timeout: 6000,
	after: onAfter,
	pager: '#front-index',
	pagerEvent: 'mouseover'
});

var graphicIndex = 1;
function onAfter() {
	switch (this.id) {
		case "graphic01":
			$('#graphic-desc').html("See James in <em>World Physique</em> magazine! Athlete of the Month, July 2009, and Personal Trainer of the Month, September 2009.");
			$('#graphic-link').html("<a href='fitnessmodeling.html' title='Personal Trainer of the Month, September 2009'>MORE...</a>");
			$('#front-caption').html("Personal Trainer of the Month, September 2009");

			break;
		case "graphic02":
			$('#graphic-desc').html("Listen to James with Micah LaCerte and Diana Chaloux on HitchFit Radio. Listen to past shows and pick up some quick tips.");
			$('#graphic-link').html("<a href='links.html' title='Listen to HitchFit Radio'>MORE...</a>");
			$('#front-caption').html("Listen to HitchFit Radio");

			break;
		case "graphic03":
			$('#graphic-desc').html("12 and 16 Week Online Training programs are available. Get help with cardio, weight, and nutrition programs.");
			$('#graphic-link').html("<a href='onlinetraining.html' title='Online Training'>MORE...</a>");
			$('#front-caption').html("Online Training");

			break;
	}
	
	if (graphicIndex < 3) {
		graphicIndex += 1;
	} else {
		graphicIndex = 1;					
	}
}