//hornav image rollover
function navRollOver (whichNav,imageFileType) {	
	var rollOverSuffix = "-hover";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/"+whichNav+"/";
	var navRoot = document.getElementById(whichNav);
	for(i=0; i<navRoot.childNodes.length; i++){
		node0 = navRoot.childNodes[i];
		if(node0.nodeName=='A'){
			for(a=0; a<node0.childNodes.length; a++){
				node1=node0.childNodes[a];
				if(node1.nodeName=="IMG"){
					node1.onmouseover=function(){
						srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						this.src = srcactive;						
					}
					node1.onmouseout=function(){
						src=imagePath+this.id+imageFileType;
						this.src = src;
					}
				}
			}
		}
	}
}

//place flash on homepage
function addMapSwf() {
	document.write("<embed src='/swf/map.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='693' height='325'></embed>");
}

//hide the userForm div on article.asp when page loads
function hideUserForm() {
	document.getElementById("userForm").style.display="none";
	document.getElementById("readcommentsbutton").disabled=true;
}

//control the hide/reveal of the userForm div
function myUserFormFunction(whichButton) {
	var writeItem="writeacommentbutton";
	var readItem="readcommentsbutton";	
	document.getElementById(whichButton).disabled=true;
	document.getElementById(whichButton).src="/i/formbuttons/"+whichButton+"-hover.gif";
	if (whichButton==writeItem) {		
		document.getElementById(readItem).src="/i/formbuttons/"+readItem+".gif";
		new Effect.SlideDown('userForm', {
			duration: 0.2,
			afterFinish: finishSlideDown
		});		
	} else {
		document.getElementById(writeItem).src="/i/formbuttons/"+writeItem+".gif";
		new Effect.SlideUp('userForm', {
			duration: 0.2,
			afterFinish: finishSlideUp
		});		
	}	
}

function finishSlideDown() {
	document.getElementById("readcommentsbutton").disabled=false;
}

function finishSlideUp() {
	document.getElementById("writeacommentbutton").disabled=false;
}