function MyAlert(){ this.getSelectPosition=function getSelectPosition(obj) { var objLeft = obj.offsetLeft; var objTop = obj.offsetTop; var objParent = obj.offsetParent; while(objParent.tagName != "BODY") { objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.offsetParent; } return([objLeft,objTop]); } this.alert=function myAlert(obj,content) { obj.style.color="#b0b0b0"; obj.value=content; /* var newMask =document.createElement("div"); newMask.name="myalert"; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; newMask.className=obj.className; newMask.style.width=obj.style.width; newMask.style.height=18; newMask.style.top =this.getSelectPosition(obj)[1]+1+"px"; newMask.style.left =this.getSelectPosition(obj)[0]+2+"px"; newMask.style.background = "#FFFFFF"; newMask.onmouseover=function(){this.removeNode(true);} document.body.appendChild(newMask); newMask.innerHTML="
"+content+"
";*/ } this.closewin=function closewin() { document.getElementById('myalert1').removeNode(true); } } function alertTimeDiv(divid,content){ var obj=document.getElementById(divid); var alertDiv=new MyAlert(); alertDiv.alert(obj,content); //"如:2009-01-01" } function clearTime(obj) { obj.style.color="#000000"; obj.value=""; }