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

if (DOMsupport) {
  window.onload = function() {
    applyShadow('baslik', '#ccc', 4);
    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);
    }
  }
}
