	$(function(){
		function randomFromTo(from, to){
       return Math.floor(Math.random() * (to - from + 1) + from);
    }
		var tout = "";
		var swappy = function( ){
			var d = $(this);
			var pTxt = d.find("p" );
			var h2Txt = d.find("h2" );
			//alert( h2Txt.html()+" = "+$('#home-hero div.hot').find("h2").html());
			if( $('#home-hero div.hot').find("h2").html() != h2Txt.html() ){
				clearTimeout( tout );
				$("#home-hero div").unbind('mouseover');
				// Turn off current hot
				$('#home-hero div.hot').find('p').css('display','none');
				$('#home-hero div.hot').find('h2').animate( {fontSize: '4.7em','margin-left':'0px','margin-top':'0px'},200,function(){$('#home-hero div.hot').removeClass('hot')} )
				// Turn this one to hot
				$(this).find('h2').animate({fontSize: '8.7em',marginLeft:'-4px',marginTop:'-5px'},300, function(){ d.addClass("hot");pTxt.css("display","block");
				$("#home-hero div").bind('mouseover', swappy); } );
				tout = setTimeout(advanceHero, randomFromTo(5000,9000) );
			}
		}
		
		var advanceHero = function() {
			clearTimeout( tout );
			// disable mouseover events on our hero divs
			$("#home-hero div").unbind('mouseover');
			// select the hot div
			var classlist = $("#home-hero div.hot").attr("class");
			var curHot = $("."+ classlist.slice(0, -4) );
			curHot.find("p").css("display","none");
			curHot.find("h2").animate({fontSize: '4.7em',marginLeft:'0px', marginTop:'0px'},200,function(){$("#home-hero div.hot").removeClass("hot")})
			// select the nextDiv
			var d = $(".one");
			switch(classlist.slice(0, -4)){
				case "one":
					d = $(".two");break;
				case "two":
					d = $(".three");break;
				case "three":
					d = $(".one");break;
				default:
					d = $(".one");
			}
			// Turn nextDivClass to hot	
			d.find("h2").animate( {fontSize:'8.7em',marginLeft:'-4px', marginTop:'-5px'},300, function(){ d.addClass("hot"); d.find("p").css("display","block");
			$("#home-hero div").bind('mouseover', swappy); } );
			tout = setTimeout(advanceHero, randomFromTo(5000,9000) )
		}

		tout = setTimeout(advanceHero, randomFromTo(5000,9000) );
		$("#home-hero div").bind('mouseover', swappy);
	});
