$(function(){
	// Document is ready
	$(".clicker").each(function(i){
		makeClickable(this);
		//console.log("text:" + $(this).text() );
	});
	if(doclicks) {
		$(".expand_me").each(function(i){
			$(this).click();
		});
	}
	if(location.hash) {
		$("#clicker"+location.hash.replace("#","")).click();
	}
	makeLessonHovers();
});


function makeClickable(the_element) {
	the_element.onclick = function() {
		var me = this;
		var bro = me.nextSibling;
		if(bro) {
			if(this.title == "Click to hide lessons") {
				// not hidden, hide it
				$(bro).slideToggle();
				this.childNodes[1].childNodes[0].nodeValue = "(+)";
				this.title = "Click to view lessons";
			} else {
				// hidden, unhide it
				$(bro).slideToggle();
				//bro.className = bro.className.replace(/ hidden/,"");
				this.childNodes[1].childNodes[0].nodeValue = "(-)";
				this.title = "Click to hide lessons";
			}
		}
	}
}
/*

$(function(){
	// Document is ready
	$(".clicker").each(function(i){
		makeClickable(this);
		clickIt(this);
	});
	makeLessonHovers();
});

function clickIt(the_element) {
	var bro = the_element.nextSibling;
	if(bro) {
		if(the_element.title == "Click to hide lessons") {
			// not hidden, hide it
			$(bro).slideToggle();
			the_element.childNodes[1].childNodes[0].nodeValue = "(+)";
			the_element.title = "Click to view lessons";
		} else {
			// hidden, unhide it
			$(bro).slideToggle();
			//bro.className = bro.className.replace(/ hidden/,"");
			the_element.childNodes[1].childNodes[0].nodeValue = "(-)";
			the_element.title = "Click to hide lessons";
		}
	}
}

function makeClickable(the_element) {
	the_element.onclick = function() {
		var me = this;
		clickIt(me);
	}
}
*/

function league_nav() {
	if(parent.opener) {
		parent.opener.focus();

	} else {
		location.href="http://www.leagueworldwide.org/";
	}
}
