﻿// JScript File
// Create the namespace
var AppJs = {}; // create the namespace.

AppJs.cover = function (bottom, top, ignoreSize, shiftY, shiftX) 
   {
      //var bottom = $(bottomId);
      //var top = $(topId);
      top.style.display = 'block';
      var location = Sys.UI.DomElement.getLocation(bottom);
      var ignoreSize = (ignoreSize == null) ? true : ignoreSize;
      var shiftY = (shiftY == null || AppJs.isInt(shiftX) == false) ? 0 : shiftY;
      var shiftX = (shiftX == null || AppJs.isInt(shiftY) == false) ? 0 : shiftX;
      
      top.style.position = 'absolute';
      top.style.top = (location.y + shiftY) + 'px';
      top.style.left = (location.x + shiftX ) + 'px';
      if (!ignoreSize) 
      {
         top.style.height = bottom.offsetHeight + 'px';
         top.style.width = bottom.offsetWidth + 'px';
      }
   }
   
AppJs.isInt = function(x) 
   { 
      var y=parseInt(x); 
      if (isNaN(y)) return false; 
      return x==y && x.toString()==y.toString(); 
   } 
   