
	$(function(){

		// Accordion
		$("#accordion").accordion({ header: "h3", autoHeight: false });

		
		//hover states on the static widgets
		$('#dialog_link, ul#icons li').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); }
		);

		// update the background
		switch(window.location.pathname){
			case '/welcome.php':
			case '/index.php':
				$('body').css('background-image', 'url(/images/homeBG.jpg)');
				break;
			default:
				$('body').css('background-image', 'url(/images/subBG.jpg)');
		}
	});

	function contentarea(f) {
		$.get("/cmsjs.php?filename="+f,null,function(c) {
			$("#contenttitle").html(c.title);
			$("#crumbtitle").html(c.title);
			$("#contentarea").html(c.pagetext);
		},'json');
	}

//useful function that we'll be using throughout
function confirmClick(msg) {
	var okay=confirm(msg);
	if(okay)
        	return true; 
        else 
		return false;
}

function el(str,domain,name) {
 document.write('<a href="ma'+'il'+'to:' + str + '@' + domain + '">' + name + '</a>');
}
function em(str,domain) {
  document.write("<a href=\"ma"+"il"+"to:" + str + "@" + domain +"\">" + str + "@" + domain + "</a>");
}


