function netRect()
{
  var self = this;
  this.classType = "netRect";
  
  this.left = 0;
  this.top = 0;
  this.width = 0;
  this.height = 0;
  
  this.right = function()
    {
      return this.left+this.width;
    };
    
  this.bottom = function()
    {
      return this.top+this.height;
    };
    
  this.fromDiv = function(objDiv)
    {
      this.left = objDiv.getLeft();
      this.top = objDiv.getTop();
      this.width = objDiv.getWidth();
      this.height = objDiv.getHeight();
    };

  this.toDiv = function(objDiv)
    {
      objDiv.setLeft (this.left);
      objDiv.setTop (this.top);
      objDiv.setWidth (this.width);
      objDiv.setHeight (this.height);
    };
    
  this.copy = function(rect)
    {
      this.left = rect.left;
      this.top = rect.top;
      this.width = rect.width;
      this.height = rect.height;
    };  

  this.copyC = function(cObj)
    {
      this.left = cObj.div.getLeftC();
      this.top = cObj.div.getTopC();
      this.width = cObj.div.getWidth();
      this.height = cObj.div.getHeight();
    };
    
  this.isHorz = function() 
    {
      if (this.height == 1) return true;
      return false;
    };  

  this.isVert = function() 
    {
      if (this.width == 1) return true;
      return false;
    };

  this.isOrtho = function(other)
    {
      if (this.isVert() && other.isHorz()) return true;
      if (this.isHorz() && other.isVert()) return true;
      return false;
    };  

  this.doCross = function(other,ortho,vert)
    {
      if (!ortho) {
        ortho = this.isOrtho(other);
        vert = this.isVert();
        }
      if (ortho) {
        if (vert) {
          if (other.top < this.top) return false;
          if (other.top > this.bottom()) return false;
          if (this.left < other.left) return false;
          if (this.left > other.right()) return false;
          }
        else {
          if (this.top < other.top) return false;
          if (this.top > other.bottom()) return false;
          if (other.left < this.left) return false;
          if (other.left > this.right()) return false;
          }

//newBodyPara("doCross=true: this("+this.left+","+this.top+","+this.right()+","+this.bottom()+"), other("+other.left+","+other.top+","+other.right()+","+other.bottom()+")");
        return true;
        }
    
      return false;
    };

}

