// Duncan hack, get the entire path, turn /s to -s 
// strip extension and add that as an id to the body
// so we can target specific pages in the styles if we need to
 
// www.blah.com/this/that/whatever.html -> body id="this-that-whatever"
// or body id="home-page" if at root / 
 $(document).ready(function() {
   
var pathname = window.location.pathname;
var pathSlashesReplaced = pathname.replace(/\//g, "-");
var pathSlashesReplacedNoFirstDash = pathSlashesReplaced.replace("-","");
var newID = pathSlashesReplacedNoFirstDash.replace(/(\.[\s\S]+)/ig, "");
 
	$(".sidenavigation ul li").each(function(){ 

	var className = $(this).attr("class");
	
	if(  className ==   newID ) {
	//	alert(  className );
		 $(this).addClass("leftnavselected");
		 
		 //does this need a thicker red background?
		 if ( $("body").attr("id") == "thickbackground")
{
	 	
    
	$(this).addClass("leftnavselectedbig");
}
		 
}
     
 });
 

});





function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
 $(document).ready(function() {
 
 
 
		
		$("span.spoiler").hide();
		
	  	 $('<p class="alignedrightnofloat" style="margin-top: -10px;"><a class="reveal ">Read More &raquo;</a></p> ').insertBefore('.spoiler');
	
		$("a.reveal").click(function(){
			$(this).parents("p").children("span.spoiler").fadeIn(2500);
			$(this).parents("p").children("a.reveal").fadeOut(600);
		});



	/* FANCYBOX - FOR PHONE NUMBERS
	Apply fancybox to top phone */
	
	$("a.loginmiddle").fancybox({
	'width'				: '94%',
		'height'			: '94%',
        'autoScale'     	: true,
		 'scrolling'     	: 'auto',
        'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe'
	});
	
	

});
