//image rollover for hornav with current section highlighted 
function navRollOver (whichNav,imageFileType) {	
	var rollOverSuffix = "-over";
	var whichNav = whichNav.replace(/^\s+|\s+$/g,'');
	var imageFileType = imageFileType.replace(/^\s+|\s+$/g,'');
	var imagePath = "/i/hornav-";
	var navRoot = document.getElementById(whichNav);
	var args = getUrlSubString();	
	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(){
						if (
							(this.id=="education" && args=="education")||
							(this.id=="kidsproducts" && args=="kids-products")||
							(this.id=="raisingchildren" && args=="raising-children")||							
							(this.id=="kidsentertainment" && args=="kids-entertainment")
							)
						{
							srcactive = imagePath+this.id+"-on"+imageFileType;
						} else {
							srcactive = imagePath+this.id+rollOverSuffix+imageFileType;
						}
						this.src = srcactive;						
					}
					node1.onmouseout=function(){						
						if (
							(this.id=="education" && args=="education")||
							(this.id=="kidsproducts" && args=="kids-products")||
							(this.id=="raisingchildren" && args=="raising-children")||							
							(this.id=="kidsentertainment" && args=="kids-entertainment")
							)
						{
							src = imagePath+this.id+"-on"+imageFileType;
						} else {
							src = imagePath+this.id+imageFileType;	
						}						
						this.src = src;
					}
				}
			}
		}
	}
}

//returns the current section to navRollOver
function getUrlSubString() {
	var url = document.URL;
	var whichPageArray=url.split("/");	
	return whichPageArray[3];
}

//validation for the privacy policy checkbox on login create form
function formValidation(theform) {
	if (theform.privacypolicyagree.checked == false ) {
		alert("You must read and agree to the Privacy Policy.");
		theform.privacypolicytext.style.border="2px solid #999";
		theform.privacypolicytext.focus();
		return false;
	} else {
		return true;		
	}
}