// Sets the z-index of the top most layer
var TOP_Z_INDEX = 10000;

// Function to determine whether the iframe needed is present or not.
function iframeHelperExists(iframeHelperId)
{
  return document.getElementById && document.getElementById(iframeHelperId);
}

// Function to init the iframe helpers
function initIframeHelpers()
{
}

// Function to hide iframe helper with the specified id
function hideIframeHelper(iframeHelperId)
{
  // Quick check to make sure that the iframe helper id is there.
  if (!iframeHelperExists(iframeHelperId)) {
    return false;
  }
  
  // Set the visibility and the z-index appropriately.
  document.getElementById(iframeHelperId).style.visibility  = 'hidden';
  document.getElementById(iframeHelperId).style.zIndex      = -1000;
}

// Function to show iframe helper with the specified id
function showIframeHelper(iframeHelperId, x, y, w, h)
{
  //alert('id:' + iframeHelperId + ' |x:' + x + ' |y:' + y + ' |w:' + w + ' | h:' + h );
  
  // Quick check to make sure that the iframe helper id is there.
  if (!iframeHelperExists(iframeHelperId)) {
    return false;
  }
  
  // Set the location of the top corner of the iframe under the div.
  document.getElementById(iframeHelperId).style.left        = x;
  document.getElementById(iframeHelperId).style.top         = y;
  
  // Now set the width of the iframe under the div.
  if (isNaN(w)) {
    // alert('invalid width: "' + w + '"');
  }
  else {
    document.getElementById(iframeHelperId).style.width       = w + 'px';
  }
  
  // Now set the width of the iframe under the div.
  if (isNaN(h)) {
    // alert('invalid height: "' + w + '"');
  }
  else {
    document.getElementById(iframeHelperId).style.height      = h + 'px';
  }
  
  // Set the visibility and z-index behind the div.
  document.getElementById(iframeHelperId).style.zIndex      = 1;
  document.getElementById(iframeHelperId).style.visibility  = 'visible';
}

