		function ControlText(spanName,start,end,width)
		{
					
			var i=0;
			var spanid;
			for(i=start;i<end;i++)
			{
				spanid = spanName + i;
				if((document.getElementById(spanid)) != null)
					trimText(width, spanid);
			}			
		}
		function trimText(max, spanid)
		{			
			var oObject = document.getElementsByName(spanid);
			if (oObject.length==0)
				oObject = document.getElementById(spanid);
			var oWid = 0;
			var appLen = 0;
			var margin = 25;
			if (oObject != null)
			{
				if (oObject.length != null)
				{
					for (i = 0; i < oObject.length; i++)
					{
						appLen = 0;
						obj = oObject[i];						
						strText = obj.innerHTML;	
						strText = encodeString(strText);
						
						oWid = obj.offsetWidth;
						if (oWid>max - margin)
						{
							appLen = ((max - margin)/oWid)*strText.length;
							obj.innerHTML = strText.substr(0, appLen) + '...';
							obj.title = encodeString(strText);
						}
						else if((oWid == 0)&(strText.length > 0))
						{
							appLen = ((max - margin-20)/max)*strText.length;
							obj.innerHTML = strText.substr(0, appLen) + '...';
							obj.title = encodeString(strText);
						}
					}//For ends
				}
				else
				{
					obj = oObject;
					strText = obj.innerHTML;
					
					oWid = obj.offsetWidth;
					if (oWid>max - margin)
					{
						appLen = ((max - margin)/oWid)*strText.length;
						obj.innerHTML = strText.substr(0, appLen) + '...';
						obj.title = encodeString(Trim(strText));
					}
					else if((oWid == 0)&(strText.length > 0))
					{
						appLen = ((max - margin-20)/max)*strText.length;
						obj.innerHTML = strText.substr(0, appLen) + '...';						
						obj.title = encodeString(strText);
					}
				}

			}		
		}	
		
		function encodeString(str)
		{
			str = str.replace(/&amp;/g,"&");
			str = str.replace(/&gt;/g,">");
			str = str.replace(/&lt;/g,"<");
			str = str.replace(/&quote;/g,"\"");
			return str;
		}
	
function trimTextHotRelease(max, spanid)
		{
			var oObject = document.getElementsByName(spanid);
			if (oObject.length==0)
				oObject = document.getElementById(spanid);
			var oWid = 0;
			var appLen = 0;
			var margin = 25;
			if (oObject != null)
			{
				if (oObject.length != null)
				{
					for (i = 0; i < oObject.length; i++)
					{
						appLen = 0;
						obj = oObject[i];						
						strText = obj.innerHTML;	
						strText = encodeStringHotRelease(strText);
						obj.innerHTML = strText;
						obj.title = strText;						
						oWid = obj.offsetWidth;
						if (oWid>max - margin)
						{
							appLen = ((max - margin)/oWid)*strText.length;
							obj.innerHTML = strText.substr(0, appLen) + '...';
						}
						else if((oWid == 0)&(strText.length > 0))
						{
							appLen = ((max - margin-20)/max)*strText.length;
							obj.innerHTML = strText.substr(0, appLen) + '...';
						}
					}//For ends
				}
				else
				{
					obj = oObject;
					strText = obj.innerHTML;
					strText = encodeStringHotRelease(strText);
					obj.innerHTML = strText;
					obj.title = strText;											
					oWid = obj.offsetWidth;
					if (oWid>max - margin)
					{
						appLen = ((max - margin)/oWid)*strText.length;
						obj.innerHTML = strText.substr(0, appLen) + '...';
					}
					else if((oWid == 0)&(strText.length > 0))
					{
						appLen = ((max - margin-20)/max)*strText.length;
						obj.innerHTML = strText.substr(0, appLen) + '...';						
					}
				}

			}		
		}	
		
		function encodeStringHotRelease(str)
		{
			str = str.replace(/&amp;/g,"&");
			str = str.replace(/&gt;/g,">");
			str = str.replace(/&lt;/g,"<");
			str = str.replace(/&quote;/g,"\"");

			return str;
		}	