updateCode=function(thisroot){
	for(var i=0;i<thisroot.childNodes.length;i++){
		node=thisroot.childNodes[i];
		switch(node.nodeName){
			case "IMG":
				if(node.align!=null){if(node.align.toLowerCase()=="left"||node.align.toLowerCase()=="right"){node.className+=' '+node.align.toLowerCase();}}
				node.galleryimg="no";
				break;
		}
		if(node.hasChildNodes()){
			updateCode(node);
		}
	}
}

updateForms=function(thisroot){
	for(var i=0;i<thisroot.childNodes.length;i++){
		node=thisroot.childNodes[i];
		if(node.nodeName=="INPUT"&&typeof node.type!="undefined"){
			node.className+=' '+node.type.toLowerCase();
			if(node.type.toLowerCase()=="submit"){
				node.onmouseover=function(){this.className+=" over";}
				node.onmouseout=function(){this.className=this.className.replace(" over","");}
			}
		}
		if(node.hasChildNodes()){
			updateForms(node);
		}
	}
}

doHide = function (node) {
	if (node) {
		var obj = document.getElementById(node);
		if (obj) {
			if (obj.className.search(/ over/i) >= 0) {
				obj.className = obj.className.replace(" over","");
			}
		}
	}
}

updateNav = function(thisroot, lastid) {
	if(typeof thisroot.nodeType==null){return true;}
	if(thisroot.nodeType==3){return true;}
	for(var i=0;i<thisroot.childNodes.length;i++){
		node=thisroot.childNodes[i];
		if(node.nodeName=="LI"){
			if (!node.id) {
				var j = lastid;
				while (document.getElementById("navli_" + j) != null) { j++; }
				node.id = ("navli_" + j);
				lastid = j;
			}
			node.onmouseover = function () {
				if (this.className.search(/ over/i) < 0) {
					this.className += " over";
				}
				if (this.waiting) {
					clearTimeout(this.waiting);
				}
			}
			node.onmouseout = function() {
				this.waiting = setTimeout("doHide('" + this.id + "')", 150);
			}
		}
		if(node.hasChildNodes()){
			updateNav(node, lastid);
		}
	}
}

modifyDocument=function(){
	if(document.all&&document.getElementById){
		thisroot=document.getElementById("nav");
		if(thisroot!=null){ updateNav(thisroot, 1); }
		thisroot=document.getElementById("center");
		if(thisroot!=null){updateCode(thisroot);}
		if(typeof document.forms!="undefined"){
			for(var i=0;i<document.forms.length;i++){
				thisroot=document.forms[i];
				if(typeof thisroot!="undefined"){
					updateForms(thisroot);
				}
			}
		}
	}
}

if(window.onload){
	var currentFunction=window.onload;
	window.onload=function(){currentFunction;modifyDocument;};
}else{
	window.onload=modifyDocument;
}
