var plus = "/img/plus.png", minus = "/img/minus.png";

function setsection(n,i,d) {
	if( window.shrinkPic ) {
		shrinkPic();
	}

	document.getElementById(n+"-img").src = i;
	var e = document.getElementById(n).parentNode;
	do {
		e = e.nextSibling;
		if( e.nodeType == 1 ) {
			e.style.display = d;
		}
	} while( e.id != n+"-end" );
}

function showsection(n) {
	setsection(n, minus, "");
}

function hidesection(n) {
	setsection(n, plus, "none");
}

function togglesection(n) {
	if( document.getElementById(n+"-end").style.display == "none" ) {
		showsection(n);
	} else {
		hidesection(n);
	}
}

function showallsections() {
	var i, h = document.getElementsByTagName("h2");
	for( i = 0; i < h.length; i++ ) {
		if( h[i].className = "helpsection" ) {
			showsection(h[i].firstChild.id);
		}
	}
}

function hideallsections() {
	var i, h = document.getElementsByTagName("h2");
	for( i = 0; i < h.length; i++ ) {
		if( h[i].className = "helpsection" ) {
			hidesection(h[i].firstChild.id);
		}
	}
}

var nohide = window.location.hash.substr(1);
function loadedsection(n) {
	if( nohide == "" ) {
		nohide = n;
	}
	if( nohide != n && nohide != "showall" ) {
		hidesection(n);
	}
}

