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

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.left = 26*shadowOffset + 'px';
  newEl.style.top = 1*shadowOffset + 'px';
  newEl.style.zIndex = -1;
  
  targetElement.appendChild(newEl);
}

if (DOMsupport) {
  window.onload = function() {
    applyShadow('hdr1', '#999898',1);
	applyShadow('hdr2', '#000',1);
	applyShadow('hdr3', '#999898',1);
	/*applyShadow('menu4', '#1e5873',1);
	applyShadow('menu5', '#1e5873',1);
	applyShadow('menu6', '#1e5873',1);
	applyShadow('footerhdr1', '#000',1);
	applyShadow('footerhdr2', '#000',0.68);
	applyShadow('footerhdr3', '#000',1);
	applyShadow('lefthdr1', '#000',0.09);*/
	
	
   /* applyShadow('anch', '#99f', 2);
    applyShadow('lipsum', '#c66', 1);
    for (var i = 0; i < document.getElementById('list').getElementsByTagName('li').length; i++) {
      applyShadow(document.getElementById('list').getElementsByTagName('li')[i], '#aaa', 1);
    }*/
  }
}
