/********************************************************
* 页面js.
* author 陶雄
*
/********************************************************/
function getRow(srcElem) {
	if (srcElem == null || srcElem.tagName == undefined) {
	    return null;
	}
	while (srcElem.tagName != 'TR'
	        && srcElem.tagName != 'TBODY'
	        && srcElem.tagName != 'TABLE'
	        && srcElem != document.documentElement) {
	   srcElem = srcElem.parentNode;
	}
	if (!srcElem.getAttribute("onclick")
	        && !srcElem.getAttribute("onmouseout")
			&& !srcElem.getAttribute("onmouseover")
			&& !srcElem.getAttribute("oncontextmenu")
			&& !srcElem.onclick
			&& !srcElem.onmouseout
			&& !srcElem.onmouseover
			&& !srcElem.oncontextmenu) {
		srcElem = srcElem.parentNode;
		return getRow(srcElem);
	}
	if (srcElem.tagName == 'TR') {
		return srcElem;
	} else {
		return null;
	}
}

function mouseOver() {
         var row = getRow(event.srcElement);
		 if(row) {
		    row.className="table-title";
		 }
}
function mouseOut() {
         var row = getRow(event.srcElement);
		 if(row) {
             row.className="table-content";
		 }
}


/********************************************************
* 显示提示信息
/********************************************************/
var bV = parseInt(navigator.appVersion);
var NN4 = document.layers ? true : false;
var IE4 = document.all && bV >= 4 ? true : false;
var Tipmsg = '';
var eventy = 0;
var Tipshow = true;

function showTip(msg)
{
    if(msg =='') return;

    if (Tipshow)
    {
        Tipmsg = msg;
        eventy = NN4 ? e.y : IE4 ? event.y : 0;
        showTimeOut = setTimeout('delayTip()', 600);
        Tipshow = false;
    }
}
function delayTip()
{
    var obj = 'TipBox';

    if (typeof(showTimeOut) != 'undefined') {clearTimeout(showTimeOut); Tipshow = true;}
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);

    if (NN4)
    {
        if (document.layers[obj].visibility != 'visible')
        {
            with (document[obj].document)
            {
                open();
                write('<layer id=TipBox bgColor=#FF0000 style="width: 600px; border: 1px solid #FF0000" onMouseover="keepTip()" onMousewheel="keepTip()" onMouseout="hideTip()">' + Tipmsg + '</layer>');
                close();
            }
            var objp = document.layers.TipBox;
            objp.moveTo(100, eventy + 6);
        }
        document.layers[obj].visibility = 'visible';
    }
    else if(IE4)
    {
        if (document.all[obj].style.visibility != 'visible')
        {
            document.all[obj].innerHTML = Tipmsg;
            var objp = document.all.TipBox.style;
            var yy = document.body.scrollTop + eventy + 6;
            objp.pixelLeft = 100;
            objp.pixelTop = yy;
        }
        document.all[obj].style.visibility = 'visible';
    }
}
function keepTip()
{
    var obj = 'TipBox';

    if (typeof(showTimeOut) != 'undefined') {clearTimeout(showTimeOut); Tipshow = true;}
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);

    if (NN4)
        document.layers[obj].visibility = 'visible';
    else if(IE4)
        document.all[obj].style.visibility = 'visible';
}
function hideTip()
{
    hideTimeOut = setTimeout('delayHide()', 100);
}


function delayHide()
{
    var obj = 'TipBox';

    if (typeof(showTimeOut) != 'undefined') {clearTimeout(showTimeOut); Tipshow = true;}
    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);

    if (NN4)
    {
        if (document.layers[obj] != null)
            document.layers[obj].visibility = 'hidden';
    }
    else if(IE4)
        document.all[obj].style.visibility = 'hidden';
}