﻿$(function() {
	LogoAndQuoteBoxFixed();
	$(".quoteBox").show();
	$(".navItem").hover(function() {
		$(this).children("a").children("img").stop().animate({ marginTop: "0px" }, 250, "linear");
	}, function() {
		$(this).children("a").children("img").stop().animate({ marginTop: "5px" }, 250, "linear");
	});
	quoteRotator();
});
$(window).resize(function() {
	LogoAndQuoteBoxFixed();
});
function LogoAndQuoteBoxFixed() {
	if ($(window).width() < 980) {
		$("#lC").css("position", "static");
	} else {
		$("#lC").css("position", "fixed");
	}
}
function quoteRotator() {
	$("#quoteRotator ul li").hide();
	$("#quoteRotator").height($("#quoteRotator ul li:first").height());
	$("#quoteRotator ul li:first").addClass("show").show();
	if ($("#quoteRotator ul li").size() > 1) {
		setInterval("rotateQuote()", 10000);
	}
}
function rotateQuote() {
	var current = ($("#quoteRotator ul li.show") ? $("#quoteRotator ul li.show") : $("#quoteRotator ul li:first"));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $("#quoteRotator ul li:first") : current.next()) : $("#quoteRotator ul li:first"));
	$("#quoteRotator").animate({ height: next.height() }, 1000);
	setTimeout(function() { current.fadeOut(1000).removeClass("show"); }, 1000);
	setTimeout(function() { next.addClass("show").fadeIn(1000) }, 1000);
};