function getXY(obj)
{
   var curleft = 0;
   var curtop = obj.offsetHeight + 5;
   var border;
   if (obj.offsetParent)
   {
      do
      {
         if (getStyle(obj, 'position') == 'relative')
         {
            if (border = _pub.getStyle(obj, 'border-top-width')) curtop += parseInt(border);
            if (border = _pub.getStyle(obj, 'border-left-width')) curleft += parseInt(border);
         }
         curleft += obj.offsetLeft;
         curtop += obj.offsetTop;
      }
      while (obj = obj.offsetParent)
   }
   else if (obj.x)
   {
      curleft += obj.x;
      curtop += obj.y;
   }
   return {'x': curleft, 'y': curtop};
}

function getStyle(obj, styleProp)
{
   if (obj.currentStyle)
   return obj.currentStyle[styleProp];
   else if (window.getComputedStyle)
   return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp);
}

function centerThis(id) {
   var winH = $(window).height();
   var winW = $(window).width();
   var centerDiv = $(id);
   centerDiv.css('top', winH/2-centerDiv.height()/2);
   centerDiv.css('left', winW/2-centerDiv.width()/2);
}

function centerThisParent(id) {
   var winH = parent.document.body.clientHeight;
   var winW = parent.document.body.clientWidth;
   var centerDiv = parent.$(id);
   centerDiv.css('top', winH/2-centerDiv.height());
   centerDiv.css('left', winW/2-centerDiv.width()/2);
}

function autoSize() {
   parent.$('#obj-validator').css("width",$('#validator').width());
   parent.$('#obj-validator').css("height",$('#validator').height());
   centerThisParent('#obj-validator');
}