function imgresize(img, thumb, full) {
  if (!exist(img)||(!isImage(img))) return true;
  var parent = img.parentNode;
  return hs.expand(parent);
  //if the path to the full image was not passed in then try to get it from the link wrapping this image
  if (!exist(full)) full = parent.href;
  if (!exist(full)) return true;

  if ((!exist(parent.offsite))&&((!exist(parent.getAttribute))||(!exist(parent.getAttribute('offsite'))))) 
  {
    var link = createOffsiteLink(full);
    parent.appendChild(link)
    parent.setAttribute('offsite', link);
  }
  if (0<=(img.className.indexOf('thumbnail'))) {
    img.src 	    = full;
    img.className   = img.className.replace('thumbnail','full');
  } else {
    img.src 	    = thumb;
    img.className   = img.className.replace('full','thumbnail');
  }
  return false;
}
function exist(el) {
  if ((!el)||(null==el)||('undefined'==typeof el)) return false;
  return true;
}
function createOffsiteLink(uri) {
  var link 		= document.createElement('a');
  link.appendChild(document.createTextNode('full image >>'));
  link.className 	= 'offsite';
  link.href 		= uri;
  link.target		= '_blank';
  return link;
}
function isImage(el) {
  if ((!el.src)||(null==el.src)||('undefined'==typeof el.src)) return false;
  return true;
}
