var currPhoto = 1;
var timer;

$(document).ready(function() {
   timer = setInterval("loopHomepage()", 10000);
   // This code allows for automated updating of panels on the homepage
   //var now = new Date();
   //var over = new Date();
   //over.setFullYear(2010,10,15);
   //var weekday = new Array(7);
   //weekday[0] = "";
   //weekday[1] = "";
   //weekday[2] = "";
   //weekday[3] = "";
   //weekday[4] = "thursday";
   //weekday[5] = "friday";
   //weekday[6] = "saturday";
   //var youtube = new Array(7);
   //youtube[0] = "jomKLXEg9zY";
   //youtube[1] = "jomKLXEg9zY";
   //youtube[2] = "jomKLXEg9zY";
   //youtube[3] = "jomKLXEg9zY";
   //youtube[4] = "rJPOaEeX2e0";
   //youtube[5] = "ua3Bwyi5GBc";
   //youtube[6] = "IjeXaXj9iF8";
   //var li = weekday[now.getDay()];
   //var yt = youtube[now.getDay()];
   //if ((now>over)||(li=="")) {
	//   li = "sunday";
   //} // if ((now>over)||(li==""))
   //if (li=="sunday") {
	//   yt = "jomKLXEg9zY";
   //} // if (li=="sunday")
   //$("#iolapnvideos li.thursday").hide();
   //$("#iolapnvideos li."+li).show();
   //$("#homephoto1 div.homephotoarea a").attr("href","http://www.youtube.com/oncologynurses#p/a/u/0/"+yt);
});

function homepagePhotoSwitch(photo) {
	if (photo == 1) {
		$("#homephoto1").removeClass("hidePhoto");
	} else {
		$("#homephoto1").addClass("hidePhoto");
	}
	if (photo == 2) {
		$("#homephoto2").removeClass("hidePhoto");
	} else {
		$("#homephoto2").addClass("hidePhoto");
	}
	if (photo == 3) {
		$("#homephoto3").removeClass("hidePhoto");
	} else {
		$("#homephoto3").addClass("hidePhoto");
	}
	if (photo == 4) {
		$("#homephoto4").removeClass("hidePhoto");
	} else {
		$("#homephoto4").addClass("hidePhoto");
	}
	if (photo == 5) {
		$("#homephoto5").removeClass("hidePhoto");
	} else {
		$("#homephoto5").addClass("hidePhoto");
	}
	if (photo == 6) {
		$("#homephoto6").removeClass("hidePhoto");
	} else {
		$("#homephoto6").addClass("hidePhoto");
	}
	
}

function homepagePhotoClick(photo) {
   homepagePhotoSwitch(photo);
   clearInterval(timer);
}

function loopHomepage() {
    currPhoto = (currPhoto % 6) + 1;
    homepagePhotoSwitch(currPhoto);
}
