/*---------------------------------------------
功能：把一人无边框的宽度一定的文本框放在表格中，当文本框中内容超过了
这个没有边框的文本框的宽度时，将被表现成截断的样子，当鼠标移上去时，可以完整显示
<INPUT onmouseover="LDM_ShowLayerForMyTitle(this)" style="WIDTH: 60px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" readOnly type=text value="这里面的字可能超过了这个没有边框的文本框的宽度，将被表现成截断的样子，当鼠标移上去时，可以完整显示">

*/

function LDM_InitLayerForTitle()
{	
	var flag=0;
	try
	{
		if(window.document.body) flag=1;
	}
	catch(e)
	{
		flag=0;
	}
	if(flag==1)
	{
		var div111=document.createElement("div");
		div111.innerHTML="<div aligh=\"left\" id=\"LDM_LayerForMyTitle\" onmouseout=\"LDM_HideLayerForMyTitle(LDM_LayerForMyTitle)\" style=\"Z-INDEX: 1000; LEFT: -100px; OVERFLOW: visible; CURSOR: default; POSITION: absolute; TOP: -100px;\"><INPUT id=\"INPUT_ShowAllText\" type=\"text\" style=\"BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #ffffdd;cursor:default;\" readOnly></div>";
		document.body.appendChild(div111);
	}

}


function LDM_GetObjPosition(e)//获得当前对像的位置
{
	
	var p = new Object()
	p.x = e.offsetLeft
	p.y = e.offsetTop
	while (e = e.offsetParent)
	{
	p.x += e.offsetLeft
	p.y += e.offsetTop
	}
	return (p)
}
function  LDM_GetTextRangeBoundingWidth(obj)//获得对像中字符串的宽度
{   
    var  range  =  obj.createTextRange();   
     return range.boundingWidth;              
}  
				
function LDM_ShowLayerForMyTitle(this1)
{
	try
	{
		if(this1.style.pixelWidth<LDM_GetTextRangeBoundingWidth(this1))
		{
			LDM_LayerForMyTitle.style.top=LDM_GetObjPosition(this1).y-1;
			LDM_LayerForMyTitle.style.left=LDM_GetObjPosition(this1).x;
			INPUT_ShowAllText.value=this1.value;
			INPUT_ShowAllText.style.pixelWidth=LDM_GetTextRangeBoundingWidth(this1)+6;
			LDM_LayerForMyTitle.style.visibility="visible";
		}
	}
	catch(e)
	{
		LDM_InitLayerForTitle();
		LDM_ShowLayerForMyTitle(this1);		
	}
}
function LDM_HideLayerForMyTitle(LayerId)
{
	LayerId.style.top=-10;
	LayerId.style.left=0;
	LayerId.style.visibility="hidden";
}