if(document.all['_onlineHelp'] == null) document.write('<textarea id=_onlineHelp readonly style="z-index:999; font-size:9pt; display:none; position:absolute; border:1 solid black" onmouseout="style.display=&quot;none&quot;"></textarea>');

/**
 * 显示在线帮助信息。
 * @param tag 目标元素。弹出的框将显示在其旁边
 * @param hint 帮助信息，如果目标元素的title不为空，则此参数无效，取title作提示
 * @param pos 弹出框的显示方位。0=右方(默认),1=上方,2=左方,3=下方
 * @param cols 每行字数，默认20
 * @param rows 窗口文字行数，默认5
 * @param bgcolor 背景色，默认为#FFFFE8，即浅黄色
 * @param txtcolor 文字颜色，默认为黑色
 */
function onlineHelp(tag,hint,pos,cols,rows,bgcolor,txtcolor) {
    var helper = document.all["_onlineHelp"];
    tag.attachEvent("onmouseout",mouseout);

    if(tag.title != '') {
        hint = tag.title;
        tag.title = '';
    }
    helper.value = hint;
    helper.cols = typeof(cols) != 'undefined' ? cols : 20;
    helper.rows = typeof(rows) != 'undefined' ? rows : 5;
    helper.style.backgroundColor = typeof(bgcolor) != 'undefined' ? bgcolor : '#FFFFE8';
    helper.style.color = typeof(txtcolor) != 'undefined' ? txtcolor : 'black';

    helper.style.display = '';
    var rc = tag.getBoundingClientRect();
    var rc2 = helper.getBoundingClientRect();
    if(typeof(pos) == 'undefined') pos = 0;
    helper.style.left = -2+document.body.scrollLeft+(pos==1||pos==3?rc.left:pos==0?rc.right:rc.left-(rc2.right-rc2.left));
    helper.style.top = -2+document.body.scrollTop+(pos==0||pos==2?rc.top:pos==3?rc.bottom:rc.top-(rc2.bottom-rc2.top));


    function mouseout() {
        //var tag = event.srcElement;
        //var helper = document.all["_onlineHelp"];
        tag.detachEvent("onmouseout",mouseout);
        if(tag.title == '' ) tag.title = helper.value;

        if(event.toElement != helper) helper.onmouseout();
    }
}
