nCell>=objTR.cells.length) return;
objTR=objTBODY.rows[nRow];
objTD=objTR.cells[nCell];
var objs=objTD.all;
for(var i=0;i<objs.length;i++){
//此处使用ojbs[0],实际使用时可能需要加以修改,或加入其他条件
try{
lightonRow(objTR);
objs[i].focus();//setCursorPosition(objs[i],-1);
return;
}catch(e){
continue;
//if error occur,continue to next element
}
}//end for objs.length
}
//设置键盘状态,即bKeyDown的值
function setKeyDown(status){
bKeyDown=status;
}
//得到光标的位置
function getCursorPosition(obj){
var qswh="@#%#^&#*$"
obj.focus();
rng=document.selection.createRange();
rng.text=qswh;
var nPosition=obj.value.indexOf(qswh)
rng.moveStart("character", -qswh.length)
rng.text="";
return nPosition;
}
//设置光标位置
function setCursorPosition(obj,position){
range=obj.createTextRange();
range.collapse(true);
range.moveStart('character',position);
range.select();
}