﻿$(document).ready(function () {

	//Initialize kwicks plugin
	$('.kwicks').kwicks({
		max: 470,
		spacing: 4,
		event: 'mouseenter'
	});

	//Make entire kwick clickable
	$('.kwicks li').click(function () {
		location.href = $(this).find("a").attr("href");
	});

	//Fixes bug where animation stops before padding is back to 40px
	$("#panelHolder").delay(1000).mouseleave(function () {
		$(".sideA").animate({ paddingLeft: "40px" });
		$("#textHolder").fadeIn("slow");
	});

	//Change background image on rollover
	var kwickName;

	$(".kwicks li").hover(function () {
		kwickName = $(this).attr('id');
		kwickNumber = kwickName.replace("kwick", "");
		$(".kwickImage:eq(" + kwickNumber + ")").fadeIn("slow");
		$("#textHolder").fadeOut("slow");
	}, function () {
		kwickName = $(this).attr('id');
		kwickNumber = kwickName.replace("kwick", "");
		$(".kwickImage:eq(" + kwickNumber + ")").delay(500).fadeOut("slow");
	});

})

Cufon.replace('h1,.iconTitle1, .iconTitle2', { fontFamily: 'OceanSemiBold' });
