// JavaScript Document - vandersluis bonrouge hybrid



// vandersluis - hides stuff in javascript instead of css
if (document.getElementById) { 
	// include all feature tests needed for your DOM script
   	createStyleRule(".pane", "display:none;");
	// keith - DOM Scripting - addLoadEvent
	addLoadEvent(toggleOnload);

	addLoadEvent(myUnobtrusiveBehavior);
	addLoadEvent(styleTogs);

}




// bonrouge
function toggleNext(el) {
	if (!document.getElementById) return false;
	var next=el.nextSibling;
	while(next.nodeType != 1) next=next.nextSibling;
	next.style.display=((next.style.display=="none") ? "block" : "none");
	}
		
function toggleNextByTagName(tname) {
	var ccn="clicker";
	var clickers=document.getElementsByTagName(tname);
	for (i=0; i<clickers.length; i++) {
		clickers[i].className+=" "+ccn;
 
	 // my mouseover underline functions
		clickers[i].onmouseover = function() {
			this.style.textDecoration = "underline";
			}
		clickers[i].onmouseout = function() {
			this.style.textDecoration = "none";
			}
		// end my mouseover functions
		clickers[i].onclick=function() {
			toggleNext(this)
			}
			toggleNext(clickers[i]);
			}
		}



function toggleOnload() {
	toggleNextByTagName("h8");// h8 works with 'span' for some reason. do not change

}


// vandersluis - prevents display:none flicker
function myUnobtrusiveBehavior() {

	setElementStyleByClassName("pane", "display", "none"); // fallback for IE5/Mac


	// h8 works with 'span' for some reason. do not change
	document.getElementsByTagName("h8").onclick = function() {
		setElementStyleByClassName("pane", "display", "none");
		return false;
		};
}



// my toggle style functions
function stylePosTog0() {
	if (!document.getElementById) return false;
	if (!document.getElementById("tog0")) return false;
	var elemBG = document.getElementById("tog0");
	elemBG.className = "togPos";
	elemBG.onclick = function() {
		styleNegTog0(this);
		toggleNext(this)
		}
		function styleNegTog0() {
			if (!document.getElementById) return false;
			var elemBGswitch = document.getElementById("tog0");
			elemBGswitch.className = "togNeg";
			elemBGswitch.onclick = function() {
				stylePosTog0(this);
				toggleNext(this)
				}
			}
	}
	
	
function stylePosTog1() {
	if (!document.getElementById) return false;
	if (!document.getElementById("tog1")) return false;
	var elemBG = document.getElementById("tog1");
	elemBG.className = "togPos";
	elemBG.onclick = function() {
		styleNegTog1(this);
		toggleNext(this)
		}
		function styleNegTog1() {
			if (!document.getElementById) return false;
			var elemBGswitch = document.getElementById("tog1");
			elemBGswitch.className = "togNeg";
			elemBGswitch.onclick = function() {
				stylePosTog1(this);
				toggleNext(this)
				}
			}
	}


function stylePosTog2() {
	if (!document.getElementById) return false;
	if (!document.getElementById("tog2")) return false;
	var elemBG = document.getElementById("tog2");
	elemBG.className = "togPos";
	elemBG.onclick = function() {
		styleNegTog2(this);
		toggleNext(this)
		}
		function styleNegTog2() {
			if (!document.getElementById) return false;
			var elemBGswitch = document.getElementById("tog2");
			elemBGswitch.className = "togNeg";
			elemBGswitch.onclick = function() {
				stylePosTog2(this);
				toggleNext(this)
				}
			}
	}
	
	
function stylePosTog3() {
	if (!document.getElementById) return false;
	if (!document.getElementById("tog3")) return false;
	var elemBG = document.getElementById("tog3");
	elemBG.className = "togPos";
	elemBG.onclick = function() {
		styleNegTog3(this);
		toggleNext(this)
		}
		function styleNegTog3() {
			if (!document.getElementById) return false;
			var elemBGswitch = document.getElementById("tog3");
			elemBGswitch.className = "togNeg";
			elemBGswitch.onclick = function() {
				stylePosTog3(this);
				toggleNext(this)
				}
			}
	}
	
	
	
function stylePosTog4() {
	if (!document.getElementById) return false;
	if (!document.getElementById("tog4")) return false;
	var elemBG = document.getElementById("tog4");
	elemBG.className = "togPos";
	elemBG.onclick = function() {
		styleNegTog4(this);
		toggleNext(this)
		}
		function styleNegTog4() {
			if (!document.getElementById) return false;
			var elemBGswitch = document.getElementById("tog4");
			elemBGswitch.className = "togNeg";
			elemBGswitch.onclick = function() {
				stylePosTog4(this);
				toggleNext(this)
				}
			}
	}



		
function styleTogs() {
	stylePosTog0();
	stylePosTog1();
	stylePosTog2();
	stylePosTog3();
	stylePosTog4();
	}








