var DOMsupport = document.getElementById && document.getElementsByTagName && document.createElement;

/*DROP DOWN MENUS*/
snoHover = function() {
	var snoEls = document.getElementById(nav).getElementsByTagName("li");
	for (var i=0; i<snoEls.length; i++) {
		snoEls[i].onmouseover=function() {
			this.className+=" snohover";
		}
		snoEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" snohover\\b"), "");
		}
	}
}
listHover = function() {
	var listEls = document.getElementById(list).getElementsByTagName("li");
	for (var i=0; i<listEls.length; i++) {
		listEls[i].onmouseover=function() {
			this.className+=" listhover";
		}
		listEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" listhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", snoHover);


/*DROP SHADOW*/
function applyShadow(targetElement, shadowColor, shadowOffset) {
  if (typeof(targetElement) != 'object') {
    targetElement = document.getElementById(targetElement);
  }
  var value = targetElement.firstChild.nodeValue;
  targetElement.style.position = 'relative';
  targetElement.style.zIndex = 1;
    
  var newEl = document.createElement('span');
  newEl.appendChild(document.createTextNode(value));
  newEl.className = 'shadowed';
  newEl.style.color = shadowColor;
  newEl.style.position = 'absolute';
  newEl.style.padding = '10px 40px 10px 20px';
  newEl.style.left = shadowOffset + 'px';
  newEl.style.top = shadowOffset + 'px';
  newEl.style.zIndex = -1;
  
  targetElement.appendChild(newEl);
}

if (DOMsupport) {
  window.onload = function() {
    applyShadow('shadow', 'white', -1);
    for (var i = 0; i < document.getElementById('list').getElementsByTagName('li').length; i++) {
      applyShadow(document.getElementById('list').getElementsByTagName('li')[i], '#aaa', 1);
    }
  }
}

