
/*------------------------------------------------------------------------------------------ INIT */

$(function(){
	init_partners();
	init_cycle();
});


/*--------------------------------------------------------------------------------------- SITEMAP */

function sitemap() {
	$("#sitemap-link").toggleClass("open");
	$("#sitemap").toggle();
	return false;
}

/*-------------------------------------------------------------------------------------- PARTNERS */

var partnerImages = {
	"default":"/images/people/Group.jpg",
	"/people/tbrown":"/images/people/TomBrown.jpg",
	"/people/phobbs":"/images/people/PaulHobbs.jpg",
	"/people/bhobbs":"/images/people/BillHobbs.jpg",
	"/people/rmcmurray":"/images/people/RichMcMurray.jpg",
	"/people/dmcmurray":"/images/people/DickMcMurray.jpg"
};

function init_partners() {
	$("#partners a").mouseover(show_current_partner);
	$("#partners").hover(function(){}, hide_current_partner);
}
function show_current_partner() {
	var imageAttrs = {
		title:"Current Partner",
		src:partnerImages[$(this).attr("href")]
	}
	$("<img/>").attr(imageAttrs).addClass("rpi").hide().load(function(){$(this).fadeIn();}).appendTo("#right");
}
function hide_current_partner() {
	$("img.rpi:not(img.rpi:last)").remove();
	$("img.rpi:last").fadeOut("slow",function(){$(this).remove();});
}


/*----------------------------------------------------------------------------------------- CYCLE */


function init_cycle() {
	$("#rotator").cycle({timeout:10000, speed:2000});
}

