function DVButton(obj,str)
{	
	this.obj = obj;
	this.str = str;
	this.style = 0;//default
	arguments[0] = this;
	this.itens = {left:null,icon:null,str:null,right:null};
	//----------------------------------------------------------------------------------------------
	this.constructor = function()
	{
		this.obj.className='DVButton';
		this.obj.innerHTML = "<b class = 'bleft'></b><b class = 'bicon'></b><b class = 'bstr'>"+this.str+"</b><b class = 'bright'></b>";
		var itens = this.obj.getElementsByTagName('b');
		this.itens = {left:itens[0],icon:itens[1],str:itens[2],right:itens[3]};
		
		switch(arguments[0].length)
		{
			case 3:
				this.setIcon(arguments[0][2]);
				break;
			case 4:
				this.setIcon(arguments[0][2]);
				this.setStyle(arguments[0][3]);
				break;
			default:
		}
		//84 é o tamanho dos segmentos
		this.obj.onmouseover = function()
		{
			obj.obj.style.backgroundPosition='left -'+((obj.style*84)+63)+'px';
			obj.itens.left.style.backgroundPosition='left -'+((obj.style*84)+21)+'px';
			obj.itens.right.style.backgroundPosition='right -'+((obj.style*84)+21)+'px';
			obj.itens.icon.className = 'bicon_hover';
			obj.itens.str.className = 'bstr_hover';
		}			
		this.obj.onmouseout = function()
		{
			obj.obj.style.backgroundPosition='left -'+((obj.style*84)+42)+'px';;
			obj.itens.left.style.backgroundPosition='left -'+((obj.style*84))+'px';
			obj.itens.right.style.backgroundPosition='right -'+((obj.style*84))+'px';
			obj.itens.str.className = 'bstr';
			obj.itens.icon.className = 'bicon';
		}
		
	}
	//----------------------------------------------------------------------------------------------
	this.alignTo = function(side)
	{
		try
		{
			this.obj.style.cssFloat=side;
			this.obj.style.styleFloat=side;
		}
		catch(err){}
	}
	//----------------------------------------------------------------------------------------------
	this.setTitle = function(str)
	{
		this.obj.title = str;
	}
	//----------------------------------------------------------------------------------------------
	this.setValue = function(str)
	{
		this.itens.str.firstChild.nodeValue = str;
	}
	//----------------------------------------------------------------------------------------------
	this.setIcon = function(pos)
	{
		this.itens.icon.style.display='inline';
		this.itens.icon.style.backgroundPosition = '-'+(pos[0]*16)+'px -'+(pos[1]*16)+'px';
	}
	
	this.setStyle = function(pos)
	{
		this.style = pos;
		
		this.obj.style.backgroundPosition='left -'+((this.style*84)+42)+'px';;
		this.itens.left.style.backgroundPosition='left -'+((this.style*84))+'px';
		this.itens.right.style.backgroundPosition='right -'+((this.style*84))+'px';
		this.itens.str.className = 'bstr';
		this.itens.icon.className = 'bicon';
	}

	this.removeIcon = function(){this.itens.icon.style.display='none'}
	
	//Simula Construtores
	//----------------------------------------------------------------------------------------------

	this.constructor(arguments);
}	
