document.write("<style>#photoArea img { visibility:hidden; }</style>");

var onHomepage = (pdGlobal.currentPages[0].id == 128473)?true:false,
	JavaScriptSchoolID = 190, bannerPhotoID = 20022, 
	MenuArray = new Array(
		{pageid:128385, hoffset:0, voffset:0},
		{pageid:128386, hoffset:0, voffset:0},
		{pageid:128388, hoffset:0, voffset:0},
		{pageid:128387, hoffset:0, voffset:0},
		{pageid:128389, hoffset:0, voffset:0},
		{pageid:128390, hoffset:0, voffset:0},
		{pageid:128392, hoffset:0, voffset:0}
	);

if(onHomepage){
	$("body").addClass("onHomepage");
	document.write("<style>#lInTblLCell { display:none; }</style>");
	document.write("<style>#lInTblRCell { background:url(/ftpimages/190/podium/Style761/images/hpPageTop.png) top right no-repeat; }</style>");
	document.write("<style>#lOutTblLCell { background:url(/ftpimages/190/podium/Style761/images/hpLayoutBack.png) top right repeat-y; }</style>");
	document.write("<style>#footerArea { background:url(/ftpimages/190/podium/Style761/images/hpFoot.png) top left no-repeat; }  #flashReplaceArea{height: 347px;}</style>");
	bannerPhotoID = 20021;
	}
	else{
	if($("body").hasClass(".onHomepage")){
		$("body").removeClass(".onHomepage");
		}
	$("body").addClass(".Interior");
	}

$(document).ready(function(){
	if(onHomepage){
		//page and column widths
		$("#lPg").css("width",978+"px");
		$("#lPg span table tbody tr td:nth-child(3) div:first").css("width",606+"px");
		 if(pdGlobal.currentPages[pdGlobal.currentPageLevel-1] != undefined){
			if (pdGlobal.currentPages[pdGlobal.currentPageLevel-1].id == 204){$("#cbcb151").css("padding-left","34px");}
		}
		//checking if in Events detail and adding margin left
		if ($("#cbcb299246").hasClass("cch")){
			$("#cbhcb299246").css("margin-left","34px");
			$("#cbcb299246").css("margin-left","34px");
		}
		//checking news archive
		if ($("#cbcb286940").hasClass("cch")){
			$("#cbhcb286940").css("margin-left","34px");
			$("#cb2cb286940").css("margin-left","34px");
		}
		//adjust the podium flash galleries
		$("embed").each(function(){ if(parseInt($(this).attr("width")) == 388){ $(this).attr("width","606"); } });
		$("object").each(function(){ if(parseInt($(this).attr("width")) == 388){ $(this).attr("width","606"); } });
		
		//reset banner
		
		$hpImg = $("<img />").attr({
						"src":"/ftpimages/190/podium/Style761/images/hpDefaultBannerPhoto.jpg",
						"height":"345",
						"width":"960",
						"alt":""
					});
		$("#photoArea").attr("pid",bannerPhotoID).getPhotoAlbums({
			maxAlbums:3,
			maxItems:20,
			randomizePhotos: 1,
			hardPhotoWidth:960,
			callback2:function(numAlbs){
				if(numAlbs==0){ $("#photoArea").html($hpImg); }
				else{$("#defaultPhoto").css("display","none");}
				$("#photoArea img").css("visibility","visible");
				$(".photosReturn").cycle({timeout: 6000});
			}
		});		
		
	} else {
		//non-homepages
		var defaultBannerPhoto = $("#photoArea").html();
		if(pdGlobal.currentPages[pdGlobal.currentPageLevel-1].type == "content"){
			$("#photoArea").attr("pid",bannerPhotoID).getPhotoAlbums({
				maxAlbums:1,
				maxItems:1,
				randomizePhotos: 1,
				hardPhotoWidth:960,
				hardPhotoHeight:193,
				callback2:function(numAlbs){
					if(numAlbs==0){ $("#photoArea").html(defaultBannerPhoto); }
					else{$("#defaultPhoto").css("display","none");}
					$("#photoArea img").css("visibility","visible");
					$("#hpLink").css("top","33px");
					$("#needless").css("top","146px");
				}
			});
		}
		else{
			$("#photoArea").html(defaultBannerPhoto);		
			$("#photoArea img").css("visibility","visible");
		}
		
		
	}
	
	$("#nav").menu({ sid:JavaScriptSchoolID, settings:MenuArray, currentL1:pdGlobal.currentPages[0].id, showL3s:false });
	
	var options = {
		sid:190
	};
	$('.comm').dean(options);
	
	//sitemap code
	var $sitemap = $(".sitemap");
	willow.getMenu("128385|128386|128388|128387|128389|128390|128392",function(data){

	if($sitemap.length > 0){
		$sitemap.sitemap(data);
               $("#expand").click();
	}
});

});

function submitSearch(){ __pdSiteSearch('', document.getElementById("search").value); }
function SubmitOnEnter(evt){
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if(charCode == "13" || charCode == "26"){ submitSearch(); return false; }
}
