// Function to position the top-nav tabs
function positionTab(div, parentObj) {
  divObj = document.getElementById(div);
  var top = findPosY(parentObj);
  var left = findPosX(parentObj);
  if (navigator.appName == "Microsoft Internet Explorer") {
     divObj.style.top = top + 28;
     divObj.style.left = left;
  } else {
     divObj.style.top = top + 9;
     divObj.style.left = left - 1.5;
  }
}

 // Function to find the X position of an element
 function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

 // Function to find the Y position of an element
  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }



   function trim(s){
     if((s==null)||(typeof(s)!='string')||!s.length)return'';
     return s.replace(/^\s+/,'').replace(/\s+$/,'');
   }
