subclass(StyleButton,Mixin_DomInsertable,Mixin_HandlesEvents);function StyleButton(name,id,label,onClick,toolTip,icon,buttonClass)
{if(!id)
id=name;this.icon=icon;this.buttonClass=buttonClass;if(!buttonClass&&0!=buttonClass)
this.buttonClass=StyleButton.statics.Size["NORMAL"];Mixin_DomInsertable.call(this,"table",name,id);Mixin_HandlesEvents.call(this,onClick);if(label||icon)
{this.DrawButton(label);if(toolTip)
this.setToolTip(toolTip);else
this.setToolTip(label);this.setLabel(label);this.SetButtonState(StyleButton.statics.State["NORMAL"]);var thisObject=this;this.SetOnMouseOver(function(){thisObject.SetButtonState(StyleButton.statics.State["OVER"])});this.SetOnMouseDown(function(){thisObject.SetButtonState(StyleButton.statics.State["DOWN"])});this.SetOnMouseOut(function(){thisObject.SetButtonState(StyleButton.statics.State["NORMAL"])});this.SetOnMouseUp(function(){thisObject.SetButtonState(StyleButton.statics.State["OVER"])});}}
StyleButton.statics=new Object();StyleButton.statics.Size={};StyleButton.statics.Size["SMALL"]=0;StyleButton.statics.Size["NORMAL"]=1;StyleButton.statics.Size["SHORT"]=2;StyleButton.statics.State={};StyleButton.statics.State["NORMAL"]=0;StyleButton.statics.State["OVER"]=1;StyleButton.statics.State["DOWN"]=2;StyleButton.prototype.DrawButton=function(hasLabel)
{this.tableBodyNode=document.createElement("tbody")
this.GetDomNode().appendChild(this.tableBodyNode);this.rowCellNode=document.createElement("tr");this.tableBodyNode.appendChild(this.rowCellNode);this.leftCapCellNode=document.createElement("td");this.rowCellNode.appendChild(this.leftCapCellNode);this.leftCapCellNode.className='leftCap';this.leftCapSpacerNode=document.createElement("img");this.leftCapCellNode.appendChild(this.leftCapSpacerNode);this.leftCapSpacerNode.className='spacer';if(this.icon&&hasLabel)
{this.iconCellNode=document.createElement("td");this.rowCellNode.appendChild(this.iconCellNode);this.iconCellNode.className='text icon';this.iconImageNode=document.createElement("img");this.iconImageNode.src=this.icon;this.iconCellNode.appendChild(this.iconImageNode);this.textCellNode=document.createElement("td");this.rowCellNode.appendChild(this.textCellNode);this.textCellNode.className='text textIconWidth';}
else
{this.textCellNode=document.createElement("td");this.rowCellNode.appendChild(this.textCellNode);if(!hasLabel&&this.icon)
{this.textCellNode.className='text icon';}
else
{if(StyleButton.statics.Size.SHORT==this.buttonClass)
this.textCellNode.className='text textShort';else
this.textCellNode.className='text';}}
this.rightCapCellNode=document.createElement("td");this.rowCellNode.appendChild(this.rightCapCellNode);this.rightCapCellNode.className='rightCap';this.rightCapSpacerNode=document.createElement("img");this.rightCapCellNode.appendChild(this.rightCapSpacerNode);this.rightCapSpacerNode.className='spacer';}
StyleButton.prototype.Clone=function(name,id)
{var clone=new StyleButton(name,id);var clonedNode=this.GetDomNode().cloneNode(true);clonedNode.name=name;if(!id)
id=clonedNode.name;clonedNode.id=id;clone.SetDomNode(clonedNode);clone.GetInternalDomNodes(clonedNode);clone.buttonClass=this.buttonClass;clone.setToolTip(this.getToolTip());clone.setLabel(this.getLabel());clone.icon=this.icon;clone.SetButtonState(StyleButton.statics.State["NORMAL"]);clone.SetOnMouseOver(function(){clone.SetButtonState(StyleButton.statics.State["OVER"])});clone.SetOnMouseDown(function(){clone.SetButtonState(StyleButton.statics.State["DOWN"])});clone.SetOnMouseOut(function(){clone.SetButtonState(StyleButton.statics.State["NORMAL"])});clone.SetOnMouseUp(function(){clone.SetButtonState(StyleButton.statics.State["OVER"])});return clone}
StyleButton.prototype.GetInternalDomNodes=function(node)
{this.tableBodyNode=node.getElementsByTagName("tbody")[0];this.rowCellNode=this.tableBodyNode.getElementsByTagName("tr")[0];var cells=this.rowCellNode.getElementsByTagName("td");if(4==cells.length)
{this.leftCapCellNode=cells[0];this.leftCapSpacerNode=this.leftCapCellNode.getElementsByTagName("img")[0];this.iconCellNode=cells[1];this.iconImageNode=this.iconCellNode.getElementsByTagName("img")[0];this.textCellNode=cells[2];this.rightCapCellNode=cells[3];this.rightCapSpacerNode=this.rightCapCellNode.getElementsByTagName("img")[0];}
else if(3==cells.length)
{this.leftCapCellNode=cells[0];this.leftCapSpacerNode=this.leftCapCellNode.getElementsByTagName("img")[0];this.textCellNode=cells[1];this.rightCapCellNode=cells[2];this.rightCapSpacerNode=this.rightCapCellNode.getElementsByTagName("img")[0];}}
StyleButton.prototype.SetButtonState=function(state)
{var buttonClass='button';if(StyleButton.statics.Size["SMALL"]==this.buttonClass)
buttonClass='buttonSmall';switch(state)
{case StyleButton.statics.State["OVER"]:buttonClass=buttonClass+' '+buttonClass+'Over';break;case StyleButton.statics.State["DOWN"]:buttonClass=buttonClass+' '+buttonClass+'Down';break;}
this.GetDomNode().className=buttonClass;}
StyleButton.prototype.getLabel=function()
{return this.label;}
StyleButton.prototype.setLabel=function(l)
{if(l)
{this.label=l.replace(/ /g,'&nbsp;').replace(/-/g,'&#8209;');if(this.textCellNode)
{if(this.icon)
this.textCellNode.innerHTML=this.label+'&nbsp;';else
this.textCellNode.innerHTML=this.label;}}
else
{this.label=null;if(this.textCellNode)
{if(this.icon)
this.textCellNode.innerHTML='<img src="'+this.icon+'" alt="'+this.toolTip+'" />';}}}
StyleButton.prototype.getToolTip=function()
{return this.toolTip;}
StyleButton.prototype.setToolTip=function(t)
{this.toolTip=t;if(this.GetDomNode())
{this.GetDomNode().title=this.toolTip;}}