// roll over script for the listed products page
function setupRollovers() {
  if (!document.getElementsByTagName)
    return;
  var all_links = document.getElementsByTagName('a');
  for (var i = 0; i < all_links.length; i++) {
    var link = all_links[i]; 
    if (link.className &&
        (' ' + link.className + ' ').indexOf(' prodDetails ') != -1) {
        link.onmouseover = mouseover;
        link.onmouseout = mouseout;
    }
  }
}

function find_target(e)
{
  /* Begin the DOM events part, which you */
  /* can ignore for now if it's confusing */
  var target; 

  if (window.event && window.event.srcElement) 
    target = window.event.srcElement;
  else if (e && e.target)
    target = e.target;
  if (!target)
    return null;

  while (target != document.body &&
      target.nodeName.toLowerCase() != 'a')
    target = target.parentNode;

  if (target.nodeName.toLowerCase() != 'a')
    return null;

  return target;
}

function mouseover(e) {
  var target = find_target(e);
  if (!target) return;

  // the only the first child node in the a tag will be targeted
  var div_tag = target.firstChild;
  div_tag.style.visibility = 'visible';
}

function mouseout(e) {
  var target = find_target(e);
  if (!target) return;

  // the only the first child node in the a tag will be targeted
  var div_tag = target.firstChild;
  div_tag.style.visibility = 'hidden';
}

// When the page loads, set up the rollovers
// window.onload = setupRollovers;
// IMPORTANT THE ABOVE CODE IS IN THE BODY TAG of the products page
