/*you really don't need these JavaScript codes if you don't care about the support for Firefox */
var TextEllipsis = new function(){

	this.init = function(){		
		
		
		var a = YAHOO.util.Dom.getElementsByClassName('ellipsis','span');
		for(var i=0;i<a.length;i++){
			this.set(a[i]);
		};
	};

	this.set = function(el){

		var ins = document.createElement('ins');
		el.appendChild(ins);
		el.__ElipsisCheck = ins ;
		
		var  dEllipsis= document.createElement('var');
		el.appendChild(dEllipsis );
		el.__ElipsisStyle = dEllipsis.style ;

		this.handleEllipsis.apply(el);

		//only Firefox support these events
		el.addEventListener("overflow", this.handleEllipsis, false);
		el.addEventListener("underflow", this.handleEllipsis, false);

	};

	this.handleEllipsis = function(){
		var oThis = this ;
		setTimeout( function(){
			oThis.__ElipsisStyle.display = (oThis.__ElipsisCheck.offsetLeft>=1)?'block':'';
		},100);

	};

	var sTextOverFlow = YAHOO.util.Dom.getStyle( document.body , 'textOverflow');
	
	if( typeof( sTextOverFlow) == 'string' || !document.getBoxObjectFor){
		
		//remove all methods;
		for(i in this){
			delete this[i];
		};
	
		return null;
	};

	//Only do this for Firefox which does not support text-overflow yet	
	this.init();
};