
  var global = new Object();
  
  function getImgSize(imgSrc)
  {
    var newImg = new Image();
    //alert(imgSrc);
    newImg.src = imgSrc;
    var height = newImg.height;
    var width = newImg.width;
    var img = new Object();
    img.w = width;
    img.h = height;
    return img;
  }

  function zoompic(url,text) {
    global.url = url;
    document.getElementById("picholderimg").src = url;
    showtipincenter();
    document.getElementById("pictext").innerHTML = text;
  }
  
  function hidezoom() {
    document.getElementById("picholderimg").src = 'bilder/trans.gif';
    document.getElementById("picholder").className = 'hideit';
    document.getElementById("pictext").innerHTML = '';
  }
  
  function showtipincenter() 
  {
    
    var obj = document.getElementById('picholder');
    var img = getImgSize(global.url);
    
    if(img.h != 0) {
      clearTimeout();
    	var scrolltop = document.body.scrollTop;
    	var scrollleft = document.body.scrollLeft;
    	var wHeight = document.body.clientHeight;
    	var wWidth = document.body.clientWidth;

      //alert(img.w+'*'+img.h);        
      //alert('scroll '+scrolltop+' '+scrollleft);
      //alert('window '+wHeight+' '+wWidth);
      
      var posy = scrolltop + wHeight/2 - img.h/2;
      var posx = scrollleft + wWidth/2 - img.w/2;
      
      obj.style.top = posy +"px";
      obj.style.left = posx +"px";
      obj.className = 'showit';
      
    } else {
      setTimeout('showtipincenter()', 100);
    }
    


  }

