// JavaScript Document
onloadArray.push(function()
{
  var pi = document.getElementById('PurchasingInfo');
  var relInfo = document.getElementById('RelatedInfo');
  var spec = document.getElementById('Specifications');
  var piBot = pi.offsetTop + pi.clientHeight;
  var relInfoBot = relInfo.offsetTop + relInfo.clientHeight;
  if (piBot < relInfoBot)
  {
    var auxProds = document.getElementById('AuxProducts');
    var callToAction = document.getElementById('CallToAction');

    if (callToAction)
        callToAction.style.marginTop = (relInfoBot - piBot)+"px";
    else if (auxProds)
        auxProds.style.marginTop = (relInfoBot - piBot)+"px";
    else
        spec.style.marginTop = (relInfoBot - piBot)+"px";
        
  }
});
function thumbClick(imgCellNode, largePath)
{
  var locX = getFullOffsetLeft(imgCellNode);
  var locY = getFullOffsetTop(imgCellNode);
  var containerDiv = document.createElement('div');
  document.body.appendChild(containerDiv);
  containerDiv.className="auxProductContainerDiv";
  containerDiv.style.left = (locX - 10) + "px";
  containerDiv.style.top = (locY - 10) + "px";
  var largeThumb = document.createElement('img');
  containerDiv.appendChild(largeThumb);
  largeThumb.src = largePath;
  largeThumb.onmouseout = createThumbUnclickFunction(containerDiv);
  largeThumb.onclick = createThumbUnclickFunction(containerDiv);
}
function createThumbUnclickFunction(containerDiv)
{
  return function()
  {
    document.body.removeChild(containerDiv);
  }
}
