
/* SLIDER */
$(document).ready(function(){

			$(function() {
			$("a#directions").click(
			function(){
			$(this).toggleClass("xhidden");

			$("div#directions_slider").slideToggle("slow");
			return false;
			},
			function(){  
			$(this).toggleClass("xhidden");

			$("div#directions_slider").slideToggle("fast");
		
			});
			});

	
	
});


$(document).ready(function() {	

//If its a page parent (based off wordpress), add the class "displayMe"
//This way the accordion will be opened up on the page you are on.
if ($('#page-list ul li').hasClass("current_page_item")) {
	$('#page-list ul li.current_page_item ul').addClass("displayMe");
}

//Hide the submenus
$('#page-list ul li ul').hide();

//Add a class to the parent li IF it has sub UL's
$("#page-list ul li:has(ul)").addClass("theDon");

//Da henchman
$("#page-list ul li ul li:has(a)").addClass("henchmen");

//Remove the link if it has a submenu
$('#page-list .theDon > a').attr('href', '#');

//When you click it, toggle bitch.
$('#page-list ul li a').click(
function() {

//Onclick Remove the class dipslay me which is only display:block;
//This way they can close it if they click it or it will glitch
$(this).next().slideToggle('slow').removeClass("displayMe");

//return false so the # doenst move view to the top of the page
if ($(this).attr('href') == '#') { return false; }

//Close it all out
	});
 });

 
 

/*
addPrintLink function by Roger Johansson, www.456bereastreet.com
*/
var addPrintLink = {
	init:function(sTargetEl,sLinkText) {
		if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support
		if (!document.getElementById(sTargetEl)) {return;} // Check that the target element actually exists
		if (!window.print) {return;} // Check that the browser supports window.print
		var oTarget = document.getElementById(sTargetEl);
		var oLink = document.createElement('a');
		oLink.id = 'print-link'; // Give the link an id to allow styling
		oLink.href = '#'; // Make the link focusable for keyboard users
		oLink.appendChild(document.createTextNode(sLinkText));
		oLink.onclick = function() {window.print(); return false;} // Return false prevents the browser from following the link and jumping to the top of the page after printing
		oTarget.appendChild(oLink);
	},
/*
addEvent function included here for portability. Replace with your own addEvent function if you use one.
*/
/* addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html */
	addEvent:function(obj, type, fn) {
		if (obj.addEventListener)
			obj.addEventListener(type, fn, false);
		else if (obj.attachEvent) {
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() {obj["e"+type+fn](window.event);}
			obj.attachEvent("on"+type, obj[type+fn]);
		}
	}
};
addPrintLink.addEvent(window, 'load', function(){addPrintLink.init('article','Print this page');});
