/** 
 * This is  the ContainerDiv class.  It defines an object that manages 
 * the data and reference associated with a div object that exists for the 
 * purpose of holding a given curve on the screen.
 */
// ContainerDiv is a widget and hence inherits from the widget superclass.
PrtContainerDiv.prototype = new abstract_Widget(); 
/**
 * This is the intermediate superclass for the ContainerDiv class.
 */
function PrtContainerDiv() {
  // Properties:
  //   Constants:
  ContainerDiv.BORDER_WIDTH = 5;
  //   Variables:
  this.strId = "";
  this.strHtml = "";
  this.objDomRef = null;
  this.intHeight = 500; // Default.
  this.intWidth = 500;  // Default.
  this.intTop = 20;
  this.intLeft = 20;
  this.strStyle = "  border-width: " + ContainerDiv.BORDER_WIDTH + "px; ";
  // Methods:
  this.clear = ContainerDiv_clear;
  this.getData = function () { 
    return "This widget currently holds no data.";
  };
  this.getBorderWidth   = ContainerDiv_getBorderWidth;
}

// Static properties:
ContainerDiv.prototype = new PrtContainerDiv();

/** 
 * This is the class constructor for the ContainerDiv class.
 * @param intOffsetLeft  The left offset to start the ContainerDiv at, from (0,0).
 * @param intOffsetRight "                                                       "
 * @param intWidth  The width in pixels of the container div.
 * @param intHeight  The height in pixels of the container div.
 * @intId The integer i.d. of the ContainerDiv.
 */
function ContainerDiv(intOffsetLeft, intOffsetTop, intWidth, intHeight, intId) {
  var strStyle;
  this.strId     = "ContainerDiv"+intId;
  this.abstract_Widget(); // Invoke the superclass constructor here.  
  if (this.intLeft == null || typeof this.intLeft == "undefined") {
    this.intLeft  += intOffsetLeft;
  }
  if (this.intTop == null || typeof this.intTop == "undefined") {
    this.intTop   += intOffsetTop;
  }
  if (this.intHeight == null || typeof this.intHeight == "undefined") {
    this.intHeight = intHeight;
  }
  if (this.intWidth == null || typeof this.intWidth == "undefined") {
    this.intWidth  = intWidth;
  }
   // Note: z-index '500' is reserved for the graph axes.
  strStyle = "style = ' top: "+this.intTop+"px;  left: "+this.intLeft+"px; "+this.strStyle
    + " height: "+this.intHeight+"px; width: "+this.intWidth+"px; "
    + " border-color: " + this.GRAPH_COLORS[intId] + "; "+" z-index: " + (intId+1) 
    + "; ' ";                                                                   
  this.strHtml  += "<div id='"+this.strId+"' class='containerDiv'  "+strStyle+" >  </div> \n ";
  // alert("this.strHtml="+this.strHtml);
}


/**
 * This method returns the border width of the 
 * container div.
 * @return string  A string literal containing the above.
 */
function ContainerDiv_getBorderWidth() {
  return ContainerDiv.BORDER_WIDTH;
}


/**
 * This method clears the contents of the ContainerDiv.
 */
function ContainerDiv_clear() {
  if (this.getDomObj()) {
    this.getDomObj().innerHTML = "";
  }
}



