 popup = new Object();
 popup.show = function(href)
 {
      hint = popup.getById('reference');
      posX = popup.getAbsPos(href).x
      if(hint.style.display == 'block')
      {
           hint.style.display = 'none'
           return false;
      }
      hint.style.display = 'block';
      hint.style.left = posX+50+'px';
 }
 popup.getById = function (id) { return document.getElementById(id); }
 popup.getAbsPos = function (el) { var s = { x:0, y:0 }; while (el.offsetParent){s.x += el.offsetLeft;s.y += el.offsetTop;el = el.offsetParent;}; return s; }

function show_image(fullLink, imgWidth, imgHeight){
	if( (imgWidth+30)>screen.width || (imgHeight+30)>screen.height ){
		var ScrollOn = 'yes';
		var windowWidth = Math.floor(screen.width-10);
		var windowHeight = Math.floor(screen.height-100);
		var xPos = 0;
		var yPos = 0;
	}else{
		var ScrollOn = 'no';
		var windowHeight = Math.floor(imgHeight+20);
		var windowWidth = Math.floor(imgWidth+20);
		var xPos = Math.floor(screen.width/2-imgWidth/2);
		var yPos = Math.floor(screen.height/2-imgHeight/2-40);
	}
	big_image=window.open(fullLink+'?isNaked=1', '', 'height=' + windowHeight + ', width=' + windowWidth + ', location=no, scrollbars=' + ScrollOn + ', status=no, menubar=no, toolbar=no, resizable=yes, top=' + yPos + ', left=' + xPos );
}
