function iLabel( name, text, normalCSS, rolloverCSS, width, height ){
	this.name 		= name
	this.text 		= text
	this.width		= width
	this.height		= height
	this.normalCSS		= normalCSS
	this.rolloverCSS	= rolloverCSS
	this.currentCSS		= normalCSS
	this.hAlign		= null
	this.vAlign		= null
	this.imgContent		= null
  this.wrap = true

	this.setRollover	= iLabel_setRollover
	this.setText		= iLabel_setText
	this.setStyle		= iLabel_setStyle
	this.update		= iLabel_update
	this.cancelRollover	= iLabel_cancelRollover

	this.init		= iLabel_init
	this.move		= iLabel_move
}

function iLabel_move( left, top ){
	this.container.move( left, top )
	this.content.move( left, top )
}

function iLabel_init(){
	this.container	= new iLayer( this.name )
	this.content	= new iLayer( this.name + "Content" )

	this.width	= this.content.getWidth()
	this.height	= this.content.getHeight()

	this.container.setWidth( this.width )
	this.container.setHeight( this.height )

	var imgContent = unescape( this.imgContent )

	imgContent = imgContent.replace( "#width#", this.width )
	imgContent = imgContent.replace( "#height#", this.height )

	MM_setTextOfLayer( this.name, '', imgContent )

	this.currentCSS = this.rolloverCSS
	this.update()
	this.currentCSS = this.normalCSS
	this.update()
}

function iLabel_cancelRollover( isCancel ){
	this.isCancel = isCancel
}

function iLabel_setRollover( isRollover ){
	if( this.isCancel ){ return }

	this.currentCSS = isRollover ?	this.rolloverCSS : this.normalCSS
	this.update()
}

function iLabel_setText( text ){
	this.text = text
	this.update()
}

function iLabel_setStyle( style ){
	this.currentCSS = style
	this.update()
}

function iLabel_update(){
	var content =	"<table cellpadding='0' cellspacing='0' border='0' width='" + this.width + "'> " +
			"<tr><td "	+ ( this.height!= null? "height='" + this.height + "' ": "" )
					+ ( this.width!= null? "width='" + this.width + "' ": "" )
					+ ( this.hAlign!= null? "align='" + this.hAlign + "' ": "" )
					+ ( this.vAlign!= null? "valign='" + this.vAlign + "' ": "" )
					+ " class='" + this.currentCSS + "' " 
          + (!this.wrap?"nowrap":"" )
					+ ">" +
			this.text + 
			"</td></tr></table>"
	MM_setTextOfLayer( 	this.name + "Content" ,
				"",
				content );

}