var MenuArray = new Array(
		{pageid:121881, hoffset:0, voffset:0, animate:"true"},
		{pageid:121882, hoffset:0, voffset:0, animate:"true"},
		{pageid:121883, hoffset:0, voffset:0, animate:"true"},
		{pageid:121885, hoffset:0, voffset:0, animate:"true"},
		{pageid:122668, hoffset:0, voffset:0, animate:"true"},
		{pageid:121884, hoffset:0, voffset:0, animate:"true"}
	),
	cycleDelay = 0;

$(document).ready(function(){
	$("body").bulletin({sid:JavaScriptSchoolID,gid:EM_ID});
	initMenu("nav","right",MenuArray,0);

if($.browser.msie && $.browser.version.split(".")[0]<7){ $("#hpPhotoShadow").css("display","none"); }
	
	$("#newsBar").newsHeadline(
		{
			maxNews:25,
			charHeadline:55,
			callback:function(thisID){
				var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
				setTimeout(function(){
				$("#"+thisID+" .pubDate").each(function(){
						var strArray = $(this).html().split("/"),
							output = "<span class='monthName'>" + monthNames[strArray[0]-1] + "</span><span class='day'>";
						strArray[1].length==1 ? output += "0" + strArray[1] : output += strArray[1];
						output +=  "</span><span class='year'>" + strArray[2] + "</span>";
						$(this).html(output);
					});
					$("#"+thisID).cycle({sync:0,pause:1});
				},500);
			}
		}
	);
	var defaultStuff = $("#hpPhotoContainer").html();
	$("#hpPhotoContainer").html("").getPhotoAlbums(
		{
			maxAlbums:1,
			maxItems:3,
			randomizeAlbums:1,
			startRandomKeepOrder:1,
			photosPerItem:10,
			writeInHorizontalOrder:1,
			hardPhotoWidth:254,
			minPhotosPerAlbum:3,
			callback1:function(thisID){
				setTimeout(function(){
					$(".photoItem img").each(function(){ $(this).css("height","254"); });
					$("#"+thisID+" li").each(function(){
						$(this).cycle({sync:1,speed:500,delay:cycleDelay});
						cycleDelay+=500;
					//	$(this).css("display","none");
					});
				},500);
				//$("#"+thisID).parent().css("overflow","visible");
			},
			callback2:function(){ if($("#hpPhotoContainer").html().length<5){ $("#hpPhotoContainer").html(defaultStuff); } }
		}
	);
});
