
var nStep = 8;

 function zoomout(theObj, again)
 {
   var obj = $(theObj); 
   if (again)
   {
      if (obj.style.zIndex == 1 && obj.width > obj.constantWidth)
      {
          obj.width = obj.width - nStep*2;
          obj.height = obj.height - nStep*2;
          var reg_b = /bottom/;
          var reg_r = /right/;
          var reg_vc = /vcenter/;
          var reg_hc = /hcenter/;
          if (reg_b.test(obj.how)) {
              obj.style.top = (obj.offsetTop + nStep*2) + 'px';
          }
          if ( reg_r.test(obj.how)) {
              obj.style.left = (obj.offsetLeft + nStep*2) + 'px';
          }
          if ( reg_vc.test(obj.how)) {
              obj.style.left = (obj.offsetLeft + nStep) + 'px';
          }
          if (reg_hc.test(obj.how)) {
              obj.style.top = (obj.offsetTop + nStep) + 'px';
          }
          setTimeout('zoomout("'+theObj+'", 1)',1);
      }
   }
   else {
      obj.style.zIndex = 1;
      obj.zoom = 0;
      zoomout(theObj , 1);
   }
 }


 function zoomin(theObj, how, multi, again)
 {
   var obj = $(theObj);
   if (!multi) {
     multi = 1.5;
   }
   if ( again ) {
      if (obj.style.zIndex == 999 && obj.width < (obj.constantWidth * obj.multi))
      {
        obj.width = obj.width + nStep*2;
        obj.height = obj.height + nStep*2;
        var reg_b = /bottom/;
        var reg_r = /right/;
        var reg_vc = /vcenter/;
        var reg_hc = /hcenter/;
        if (reg_b.test(obj.how)) {
           obj.style.top = (obj.offsetTop - nStep*2) + 'px';
        }
        if (reg_r.test(obj.how)) {
           obj.style.left = (obj.offsetLeft - nStep*2) + 'px';
        }
        if (reg_vc.test(obj.how)) {
           obj.style.left = (obj.offsetLeft - nStep) + 'px';
        }
        if (reg_hc.test(obj.how)) {
           obj.style.top = (obj.offsetTop - nStep) + 'px';
        }
        setTimeout('zoomin("'+theObj+'", "'+how+'",' + multi +', 1)',1);
      }
   } else { 
    if (!obj.constantWidth) {
      obj.constantWidth = obj.width;
      obj.constantHeight = obj.height;
      obj.how = how;
      obj.multi = multi;
    }
     obj.style.zIndex = 999;
     obj.zoom = 1;
     zoomin(theObj, how, multi, 1);
   }
 }

