function showDiv (DivID) {
document.getElementById(DivID).style.display = 'block';
}

function hideDiv (DivID) {
document.getElementById(DivID).style.display = 'none';
}

function toggleDivShow(DivID) {
document.getElementById(DivID+'_show').style.display = 'none';
document.getElementById(DivID+'_hide').style.display = 'block';
showDiv (DivID);
}

function toggleDivHide(DivID) {
document.getElementById(DivID+'_show').style.display = 'block';
document.getElementById(DivID+'_hide').style.display = 'none';
hideDiv (DivID);
}



//used to cycle through content randomly on successive page loads by cycling through a set of CSS "id" values randomly
function rotateSidebarContent(prefix,rotations) {
		var currentPrefix='sbfeature_'+prefix;
		var currentID=Math.floor(Math.random()*rotations)
		for (var i=0; i<rotations; i++) {
		document.getElementById(currentPrefix+'_'+i).style.display = 'none';
		document.getElementById(currentPrefix+'_'+i).style.visibility = 'hidden';
		//alert(currentPrefix+'_'+i)
		}
		document.getElementById(currentPrefix+'_'+currentID).style.display = 'block';
		document.getElementById(currentPrefix+'_'+currentID).style.visibility = 'visible';
}

function hideSidebarFeature(classID) {
		var currentID = classID;
		document.getElementById('sbfeature_'+currentID+'_0').style.visibility = 'hidden';
		document.getElementById('sbfeature_'+currentID+'_0').style.display = 'none';
}



/***********************************************
* Random Content Order script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function randomizeContent(classname,hiddenObj){
//alert('test')
		var contents=randomizeContent.collectElementbyClass(classname)
		contents.text.sort(function() {return 0.5 - Math.random();})
		for (var i=0; i<contents.ref.length; i++){
				//contents.ref[i].style.visibility="visible"
				contents.ref[i].innerHTML=contents.text[i]
		}
}

randomizeContent.collectElementbyClass=function(classname){ //return two arrays containing elements with specified classname, plus their innerHTML content
var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
var contentobj=new Object()
contentobj.ref=new Array() //array containing references to the participating contents
contentobj.text=new Array() //array containing participating contents' contents (innerHTML property)
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (var i=0; i<alltags.length; i++){
if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1){
contentobj.ref[contentobj.ref.length]=alltags[i]
contentobj.text[contentobj.text.length]=alltags[i].innerHTML
}
}
return contentobj
}
