// home flash banner definition with jQuery - 22/06/2011
$(document).ready(function(){
	$('#homeBanner').flash( 
		 { 
			 src: '/images/HomeBanner4.swf', 
			 width: 900, 
			 menu:true, 
			 height: 245, 
			 id: 'homeFlashBanner'
		  }, 
		  { 
			  expressInstall: true, 
			  version: '8' 
		  }
	 );
	 
	function divRotate(boxName) {

		setTimeout(function() {

			if (boxName=="box3") {
				$("#divHomeBox3").removeClass("box3");
				$("#divHomeBox3").addClass("box4");
				$(".btn1").removeClass("selected");
				$(".btn2").addClass("selected");
				divRotate("box4");

			}
			else
			{
				$("#divHomeBox3").removeClass("box4");
				$("#divHomeBox3").addClass("box3");
				$(".btn2").removeClass("selected");
				$(".btn1").addClass("selected");
				divRotate("box3");
			}

		}, 5000);			
		
	}

	$(".btn1").click(function (event) {
		event.stopPropagation();
		$("#divHomeBox3").removeClass("box4");
		$("#divHomeBox3").addClass("box3");
		$(".btn2").removeClass("selected");
		$(this).addClass("selected");
		
	});

	$(".btn2").click(function (event) {
		event.stopPropagation();
		$("#divHomeBox3").removeClass("box3");
		$("#divHomeBox3").addClass("box4");
		$(".btn1").removeClass("selected");
		$(this).addClass("selected");
		
	});
	
	$(".box3").live("click", function () {
		window.location="/sections/connectwithmycommunity/Diabetes-and-Health-News";
	});

	$(".box4").live("click", function () {
		window.location="/members/register.aspx";
	});

	divRotate("box3");
 
	 
});

// home flash banner is updated by the navigation mouse on/off actions - 22/06/2011
function callBanner(nav){
   var sendText = nav;
   window.document.homeFlashBanner.SetVariable("navID", sendText);
}

