// JavaScript Document

var oldVerdict="";

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function showSection(myId){
	var aSections = getElementsByClass('divVerdictSection');
	for(i=0; i<aSections.length; i++){
		oDivSection = aSections[i];
		oDivSection.style.display = 'none';
		if (oldVerdict != ""){
			oldVerdict.style.display = 'none';
			oldVerdict="";
		}
	}
	var oSection = document.getElementById(myId);
	oSection.style.display = 'block';
}

function toggleVerdict(myId,MyAnchor){
	if (oldVerdict != ""){
		oldVerdict.style.display = 'none';
		var oVerdict = document.getElementById(myId);
		if (oldVerdict != oVerdict){
	      oVerdict.style.display = 'block';
		  oldVerdict = oVerdict;
		} else {
			oVerdict.style.display = 'none';
		    oldVerdict = "";
		}
	} else {
		var oVerdict = document.getElementById(myId);
	    oVerdict.style.display = 'block';
		oldVerdict = oVerdict;
	}
	curLocation = window.location.href.toString();
	curLocation = curLocation.split('#');
	var url=curLocation[0] + "#" + MyAnchor;
	window.location = url;
	
}

function showAllSections(){
	var aSections = getElementsByClass('divVerdictSection');
	for(i=0; i<aSections.length; i++){
		oDivSection = aSections[i];
		oDivSection.style.display = 'block';
		if (oldVerdict != ""){
			oldVerdict.style.display = 'none';
			oldVerdict="";
		}
	}
}