// JavaScript Document

$(document).ready(function() {
	$('.team-member a').click(function() { 
		var theId = $(this).attr("id");
		$('#member-content-'+theId).slideToggle();
		return false;
	});
	$("#left-content img").addcaption();
	$('.team-member a').hover(
		function () {
			var theId = $(this).attr("id");
			$('.team-member .click-here-'+theId).css("display", "inherit");
		},
		function () {
			var theId = $(this).attr("id");
			$('.team-member .click-here-'+theId).css("display", "none");
		}
	);
	Cufon.replace('#main-menu li', {
		fontFamily: 'AvantGardeITC',
		hover: true
	});
	Cufon.replace('#right-content #home-widgets h2', {
		fontFamily: 'LucidaGrande'
	});
	Cufon.replace('#right-content #home-widgets p', {
		fontFamily: 'LucidaGrande'
	});
	Cufon.replace('#right-content #footer li p', {
		fontFamily: 'LucidaGrande'
	});
	Cufon.replace('#right-content #left-content h2', {
		fontFamily: 'LucidaGrande'
	});
	Cufon.replace('#content-page h2', {
		fontFamily: 'LucidaGrande'
	});
	$('#images').before('<div id="nav">').cycle({ 
		fx:     'scrollHorz', 
		speed:  750,
		timeout: 4000,
		startingSlide: 0,
		continuous:    0,
		autostop:	5,
		pager:  '#nav' 
	});
	$("ul#subnav li").hover(function(e) {
		$('#images').before('<div id="nav">').cycle({ 
			fx:     'fade', 
			speed:  0,
			timeout: 0,
			startingSlide: 0,
			continuous:    0,
			autostop:	5
		});
        var theId = $(this).attr("id");
		var slide = 0;
		switch(theId) {
			case 'subnav_about': slide=0;  break;
			case 'subnav_e15-e85-e100': slide=1; break;
			case 'subnav_retailers-fleets': slide=2; break;
			case 'subnav_distributers-wholesalers': slide=3; break;
			case 'subnav_risk-management': slide=4; break;
		}
		$('#images').cycle(slide);
    });
});
