 var d = document;
  var wH; // window handler

  function zoom2(pad,naam,id,pag)
  {
	foto = new Image;
	foto.src = pad;
	w = d[naam].width;
    alert(w);
  }
  
  function zoom(pad,img,id,pag,schaling)
  {
	foto = new Image;
	foto.src = pad;

	w = Math.round(d[img].width * schaling); // foto.width <- IE4;
	h = Math.round(d[img].height * schaling) -2; // foto.height <- IE4;
	
	x = (screen.width - w) / 2;
	y = (screen.height - h) / 2;

	url = pag + '&id=' + id + '&w=' + w + '&h=' + h;
	options = "width=" + w + ",height=" + h + ",left=" + x + ",top=" + y + ",scrollbars=no";

	wH = window.open (url, 'image', options);
	if (!wH) wH.opener = self;
  }

  function zoom3(pad,img,id,pag,afmeting)
  {
	foto = new Image;
	foto.src = pad;

    if (d[img][0])
    {
     breedte = d[img][0].width;
     hoogte = d[img][0].height;

    }
    else
    {
     breedte = d[img].width;
     hoogte = d[img].height;
    }

    if (breedte >= hoogte)
    {
	  percentage = afmeting / breedte;
    }
    else
    {
	  percentage = afmeting / hoogte;
	}

	w = Math.round(breedte * percentage) -3; // foto.width <- IE4;
	h = Math.round(hoogte * percentage); // foto.height <- IE4;
	
	x = (screen.width - w) / 2;
	y = (screen.height - h) / 2;

	url = pag + '&id=' + id + '&w=' + w + '&h=' + h;
	options = "width=" + w + ",height=" + h + ",left=" + x + ",top=" + y + ",scrollbars=no";

	wH = window.open (url, 'image', options);
	if (!wH) wH.opener = self;
  }
 
