function getElementPosition(elemID){
 var offsetTrail = document.getElementById(elemID);
 var offsetLeft = 0;
 var offsetTop = 0;
 while (offsetTrail){
  offsetLeft += offsetTrail.offsetLeft;
  offsetTop += offsetTrail.offsetTop;
  offsetTrail = offsetTrail.offsetParent;
 }
 if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
  offsetLeft += document.body.leftMargin;
  offsetTop += document.body.topMargin;
 }
 return {left:offsetLeft,top:offsetTop};
} 

function showpopup(productid, des){
initialise();
var box = document.getElementById("box" + productid);
var elm = document.getElementById("texthover" + productid);
var r = document.getElementById("popmidr" + productid);
var l = document.getElementById("popmidl" + productid);
var popper = document.getElementById("poptext" + productid);
box.style.display = 'block';
var x = getElementPosition('texthover' + productid).top;
var y = getElementPosition('texthover' + productid).left;
//alert((x - 35) + "|" + (y + 35));
if(des == 'd')
{
	box.style.top = x - 50 + "px";
	box.style.left = y + 50 + "px";
}
else
{
	box.style.top = x - 50 + "px";
	box.style.left = y - 200 + "px";
}
var h = box.offsetHeight;
var side = r.style.height;
//alert(((h-30)+"px")+ "|" + (side));
if(((h-28)+"px") != (side) && ((h-30)+"px") != (side))
{
r.style.height = h + "px";
l.style.height = h + "px"; 
popper.style.height = h + "px";
}
}

function hidepopup(productid){
var box = document.getElementById("box" + productid);
//alert(productid);
if(box)
	box.style.display = 'none';
}
