function getFirstChildElement(root) {
  var child = root.firstChild;
  while ( (child != null) && (child != root.lastChild) && (child.nodeType != 1) ) {
    child = child.nextSibling;
  }
  if (child == null) {
    return null;
  } else {
    return child;
  }
} 

function imagezoom() {
  var a_list = document.evaluate("//a", document, null, XPathResult.ANY_TYPE, null);
  var a_elem = a_list.iterateNext();
  var firstElem;
  while (a_elem != null) {
    var href = a_elem.getAttribute("href");
    
    firstElem = getFirstChildElement(a_elem);
    if (firstElem != null) { 
      alert(firstElem.getAttribute("href"));
    }
    
    a_elem = a_list.iterateNext();
  }
}
