ZoomBar = function(newID, newParent, newXPosition, newYPosition, newZIndex, newVisibility, mapObject, ratio, numDivs)
{
  if (arguments.length > 0)
    this.init(newID, newParent, newXPosition, newYPosition, newZIndex, newVisibility, mapObject, ratio, numDivs);
};

ZoomBar.prototype = new GuiWidget();
ZoomBar.prototype.constructor = ZoomBar;
ZoomBar.superclass = GuiWidget.prototype;

ZoomBar.prototype.init = function(newID, newParent, newXPosition, newYPosition, newZIndex, newVisibility, mapObject, ratio, numDivs)
{
  ZoomBar.superclass.init.call(this, newID, newParent, newXPosition, newYPosition, newZIndex, 25, numDivs*11+50, newVisibility, "ZoomBar");
  this.ratio = ratio;
  this.numDivs = numDivs;
  this.setMapObject(mapObject);
};

ZoomBar.prototype.setMapObject = function(newMapObject)
{
  this.mapObject = newMapObject;
  if (this.mapObject)
    this.mapObjectId = this.mapObject.id;
  else
    this.mapObjectId = '';
  this.draw();  
};

ZoomBar.prototype.draw = function()
{
  colorval = linearGradient("#636952", "#9C306B",this.numDivs);
  var html = '<center><TABLE class="zoomBar"><TR cellspacing="0" cellpadding="0" height="10px"><TD><center><b>+</b></center></TD></TR>';
  for (var lcv=0;lcv < this.numDivs;lcv++)
  {
    html = html + '<TR cellspacing="0" cellpadding="0"><TD class="zoomBarCell" bgcolor="'+colorval[lcv]+'"><IMG src="./'+GuiWidget.THEME_PATH+GuiWidget.THEME+'/images/'+'blank.gif" class="blackborderpointer" height="5px" width="10px" onmouseover="this.src = \'./'+GuiWidget.THEME_PATH+GuiWidget.THEME+'/images/'+'zoomBarHighlight.gif\';" onmouseout="this.src=\'./blank.gif\'" onclick="document.getGuiControl(\''+this.mapObjectId+'\').zoombar('+this.ratio+','+lcv+','+this.numDivs+');"></TD></TR>';
  }
  html = html + '<TR cellspacing="0" cellpadding="0" height="10px"><TD><center><b>-</b></center></TD></TR></TABLE></center>';
  this.element.cbe.innerHtml(html);
};


