/*var MenuArray = new Array(
	{pageid : 124830,hoffset:4,voffset:-1},
	{pageid : 124831,hoffset:-8,voffset:-1},
	{pageid : 124832,hoffset:-8,voffset:-1},
	{pageid : 124833,hoffset:-8,voffset:-1},
	{pageid : 124834,hoffset:-8,voffset:-1}
	);

	var options = {
	css_path:"/css/menu_down.css",
	xml_path:"/xml/default.asp",
	sid:437,
	direction:"down",
	settings:MenuArray,
	currentL1: pdGlobal.currentPages[0].id,
	speed:500,
	debug: true
	};*/
	
	willow.ready(function($) {

		//CSP sdb 092110 added this for the Podium search feature
		$('#search').pdSearch({showButton:true,showButtonClass:'searchArea'});
		
		//menu options
		var menuOptions = {
			direction:"down",
			showL3s:true,
			speed:500
		};
		//menu
		willow.getMenu("124830|124831|124832|124833|124834",function(data){
			$("#L1").menu(data.menu,menuOptions);
		});
		
		//$('body').bulletin({sid:437,gid:11175});
		var options = {
			emButtonPosition: "right",
			emButton: false,
			data: [
				{type:"news",id:11175}
			]
		};
		//emergency bulletin
		$('#Form1').bulletin(options);
		
		willow.smButtons($("#social_media"),16479);
	});

	willow.smButtons = function($obj,id){
		willow.getLinks(id,function(data){
			var links = data.link;
			if(links.length === 0){return;}
			var lstring = "";
			for(var i = 0; i < links.length; i++){
				lstring += "<a href='"+links[i].url+"'" + ((links[i].target == "true") ? " target='_blank'" : "") + ">"+
				((typeof links[i].image !== "undefined") ? "<img src='"+links[i].image.path+"' border='0'/>" : links[i].title)+"</a>";
			}
			$obj.html(lstring);
		});
	}


/*Search Functions */
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;
	}
}


