//globals
var ie = (document.all) ? true : false;

var ns = (document.layers) ? true : false;

var dom = (!document.all && document.getElementById) ? true : false;

//set the toggle switch for the portfolio section
var toggleSwitch = 2;



//nav

//preload('nFirm_on','images/nav/firm_on.gif');
//preload('nFirm_off','images/nav/firm_off.gif');

function preload(imgObj,imgSrc) {

	if (document.images) {

		eval(imgObj+' = new Image()')

		eval(imgObj+'.src = "'+imgSrc+'"')

	}

}

function chgImg(imgField,newImg) {

	if (ns) {eval('document.images[imgField].src = '+newImg+'.src')}

	if (ie) {document[imgField].src = eval(newImg+'.src')}

	if (dom) {document.images[imgField].src = eval(newImg+'.src');}

}



// css menus: http://www.alistapart.com/articles/dropdowns

startList = function() {

	if (document.all&&document.getElementById) {

		navRoot = document.getElementById("menuFirm");

		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {

					this.className+=" over";

				}

				node.onmouseout=function() {

					this.className=this.className.replace(" over", "");

				}

			}

		}



		navRoot = document.getElementById("menuPractice");

		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {

					this.className+=" over";

				}

				node.onmouseout=function() {

					this.className=this.className.replace(" over", "");

				}

			}

		}



		navRoot = document.getElementById("menuAttorneys");

		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {

					this.className+=" over";

				}

				node.onmouseout=function() {

					this.className=this.className.replace(" over", "");

				}

			}

		}



		navRoot = document.getElementById("menuEmployment");

		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {

					this.className+=" over";

				}

				node.onmouseout=function() {

					this.className=this.className.replace(" over", "");

				}

			}

		}


		navRoot = document.getElementById("menuNews");

		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {

					this.className+=" over";

				}

				node.onmouseout=function() {

					this.className=this.className.replace(" over", "");

				}

			}

		}


	}

}

window.onload=startList;

