//Image resize script.
var maat = 0;
function init_resize(classname, element, breed) {
  var s = document.getElementsByTagName(element);
  for (var i=0; i<s.length; i++) {
    if (s[i].className==classname) {
      var imgs = s[i].getElementsByTagName("img");
      for (var j=0; j<imgs.length; j++) {
		maat = breed;  
        imgs[j].onload = auto_resize;
      }
    }
  }
}

function auto_resize() {
  var newWidth = maat;
  if (this.offsetWidth > newWidth) {
    this.style.width = newWidth + "px";
    this.style.cursor = "pointer";
    this.style.border = "1px dotted black";
    this.onclick = img_onclick; 
  }
  this.onload = null;
}

function img_onclick() {
  this.onclick = auto_resize;
  this.style.width = "";
  this.style.border = "";
}