/* 
Author: Mitch Gohman with much love to JQuery. The Cross Browser Equalizer.
Date: 2010-11-28
*/
var CFS = {}

/*Blog Button*/
CFS.blogOver = function(event) {
	$(this).stop().animate({'top':'-20px'}, 500);
	event.preventDefault();
}
CFS.blogOut = function() {
	$(this).stop().animate({'top':'-40px'}, 500);
}

/*Home*/
CFS.columnClick = function() {
	var thisColumn = this;
	
	var getHref = $("p.findoutMore a",thisColumn).attr("href");
	
	window.location = getHref;
}

CFS.splashCurrent = 1;
CFS.currSlide = 4; //the 5th element of our looped array. We show the first 4. Reduce server load.
CFS.totalSlides; //when we loop we will count the number of slides.
CFS.slides = Array();

CFS.splash_slide = function() {
	CFS.totalSlides = CFS.slides.length;
	
	var loadNewImage = new Image();
	loadNewImage.src = CFS.slides[CFS.currSlide];
	
	$("#splashSlides img").css({'margin-top':'0px'});
	var topImage = $("#splashSlides img:first");	
	
	setTimeout(function() {
			$(topImage).animate({'margin-top':'-364px'},1000,
			function() { 
				$(topImage).attr('src',loadNewImage.src);
				$(topImage).appendTo("#splashSlides");
				CFS.splash_slide();
			});
		},4000);
	
	CFS.currSlide++;
	
	if (CFS.currSlide >= (CFS.totalSlides-1))
		{
		CFS.currSlide = 0;
		}
}


CFS.freeWkShpRotate = function() {
	var getTopImageLink = $(".freeWorkshops a:last");
	
	$(getTopImageLink).fadeTo(1000, 0, function() {
		$(getTopImageLink).prependTo(".freeWorkshops").css({'opacity':'1'});
		setTimeout(CFS.freeWkShpRotate, 5000);
		});
	
	
	
}

$().ready(function() {
	/*Blog Button*/
	$("nav ul.menu1 li.blog").removeClass('hover');
	$("nav ul.menu1 li.blog a").hover(CFS.blogOver, CFS.blogOut);
	
	
	//three-column click
	//$(".three-column .column").click(CFS.columnClick);
	
	//affiliates
	$("#affiliates img").css({'opacity':'.7'});
	$("#affiliates img").hover(
		function(){
			$(this).stop().fadeTo(250, 1);
			},
		function(){
			$(this).stop().fadeTo(250, .7);
			}
		);
});
