document.write("<style>.pgbnr { visibility:hidden; height:0;}</style>");

$(document).ready(function(){
	/*--- pull image from page banner and put it in banner --*/
	if($(".pgbnr").html()){
		//**** place page image in banner ****
		var imgPath = $(".pgbnr").children().attr("src");
		var imgHeight = $(".pgbnr").children().attr("height");
		if(imgPath != undefined){
			$(".pgbnr").children().remove();
			$("#img_wrapper img").attr("src",imgPath);
			$("#img_wrapper").css({"display":"block","visibility":"visible"});
			$("#Form1").css("background","url(/ftpimages/254/podium/style548/bodybg_largeblue.png) repeat-x");
			$("#header_wrapper").css("height","33px");

		}	
	}else {
		$("#self_mng_image img").attr("src","/ftpimages/254/podium/style548/self_mng_img_bar.png");
		$("#header_wrapper").css("height","34px");
		
	}	
	/*-- end page image pull--*/

	//Bulletin
	$('body').bulletin({sid:254,gid:12083,emButton:false});
	//menu
	var MenuArray = new Array(
			{pageid : 129163,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129166,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129164,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129165,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129726,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129167,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129168,hoffset:0,voffset:0,animate:"true"},
			{pageid : 129169,hoffset:0,voffset:0,animate:"true"}
	);
	//var L1_on = 0;
	var L1_on = pdGlobal.currentPages[0].id;
	
	var options = {
		xml_path:"/xml/default.asp",
		sid:254,
		direction:"down",
		hOffset:0,
		vOffset:0,
		settings:MenuArray,
		currentL1:L1_on,
		showL3s:false,
		debug:false
	};
	$('#L1').menu(options);
	
	//self managed dropdown
	$selectBox = $("<select>")
		.attr({ "id":"quicklinksSelect", "name":"quicklinksSelect" });
		$("#quicklinks_go").click(function(){
			if ($("#quicklinks select").val() == "#") {
				alert("Please select a link form the list.")
			}else {
				thevalue = $("#quicklinks select").val()
				if (thevalue.split(",")[1] == "true") {
					window.open(thevalue.split(",")[0])
				}else {
					window.location = thevalue.split(",")[0] 
				}
			}
		});
		
	$("<option>").attr("value","#").html("Quick Links").appendTo($selectBox);
	$("<option>").attr("value","#").html("&nbsp;").appendTo($selectBox);

	$.getJSON('/data/json.asp?type=link&id=14037',function(data){
		if(data.link.length>0){
			for(var linkCount=0;linkCount<data.link.length;linkCount++){
				$("<option>")
					.attr("value",(data.link[linkCount].url.indexOf("http")<0)?"http://"+data.link[linkCount].url:data.link[linkCount].url+","+data.link[linkCount].target )
					.html(data.link[linkCount].title)
					.appendTo($selectBox);
			}
		}
		else{ if(window.console && window.console.firebug){ console.log("no quicklinks returned"); } }
		$("#quicklinks").append($selectBox);
	});
	
	//site map
	var $sitemap = $(".sitemap");
	if($sitemap.length > 0){
		willow.getMenu("129163|129166|129164|129165|129726|129167|129168|129169",function(data){
			$sitemap.sitemap(data);
		});
	}
	
	willow.breadcrumb();
	
	//$object = $("#search");
	//willow.setSearch($object,{t:130911,pt:'University School of Milwaukee'});
	
	$('#search').pdSearch({showButton:true, showButtonClass:'searchSubmit',showButtonText:''});
	
});

willow.breadcrumb = function(seperator){

	if(typeof seperator === "undefined"){
		seperator = "&nbsp;>&nbsp;";
	}
	var bc = "<ul class='breadcrumbs'>";
	for(var i = 0; i < pdGlobal.currentPages.length; i++){
		var aClass = "";
		if(i === 0){
			bc += "<li><a class='crumb' href='/'>Home</a><li>";
		}
		if(parseInt(pdGlobal.currentPages[i].id) === parseInt(pdGlobal.currentPages[pdGlobal.currentPageLevel-1].id)){
			aClass = "on";
		}
		bc += "<li><span>"+seperator+"</span><a class='crumb "+aClass+"' href='/podium/default.aspx?t="+pdGlobal.currentPages[i].id+"'>"+pdGlobal.currentPages[i].title+"</a><li>";
	}
	bc += "</ul>";
	
	$("#custom_breadcrumb").append(bc);
}

/* pop up window */
function popWinNGC() {window.open("/ngccampusmap/","NGC_Map","menubar=no,width=935,height=535,toolbar=no");}
function popWinUSM() {window.open("/usmcampusmap/","USM_Map","menubar=no,width=1000,height=650,toolbar=no");}

//CSP sdb 101110 added this to bring down the content from the breadcrumb trail
$(document).ready(function(){
	if(pdGlobal.currentPageLevel === 5 && pdGlobal.currentPages[4].id === 6648) {
		$(".ldob").css("margin-top","30px");
	}
});


