
/* ------------------------------------------

    === Tr Color Changer ===
    
    
    Powered by . kerry

        
--------------------------------------------- */



function bgccc()
{
    // ------- 設定　--------------------------- //


    //  適用させたいテーブルの ID 。コンマで区切り複数指定可。
    //  e.g.
    //  var tableId = new Array( "exsample", "hello", "test" );
    
    var tableId     = new Array( "tbl1","tbl2","tbl3","tbl4" );
    
    //  背景色
    var trBgColor   = "#DFEEFF";
    
    //  文字色
    var trTxtColor = "#0000FF";
	
    //  文字重み
    var fontW = "600";
	
    //  文字サイズ（他もCSS設定と同じ）
	var fontS = "85%";



    // -------- 設定終わり　--------------------------- //



    var ie = !!(document.all && !window.opera);
    this.attPNode   = ie ? "parentElement": "parentNode";
    this.attTgt     = ie ? "srcElement": "target";
    
    this.checkId = function(_id) { 
        for (var i=0; i<tableId.length; i++) if (_id==tableId[i]) return true; 
    };
    this.checker = function(_o) { 
        return _o.tagName == "TR" && this.checkId(_o[this.attPNode][this.attPNode].id) 
    };
    this.temp = function(_o) {
        with (_o.style)
        {
            this.cssColor = color;
            this.cssBgColor = backgroundColor;
            this.csstextWeight = fontWeight;
            this.cssfontSize = fontSize;

            color = trTxtColor;
            backgroundColor = trBgColor;
			fontWeight = fontW;
			fontSize = fontS;
        }
    };
    this.resetVal = function(_o) {
        with (_o.style)
        {
            color = this.cssColor;
            backgroundColor = this.cssBgColor;
			fontWeight = this.csstextWeight;
			fontSize = this.cssfontSize;
         }
    };
    
    var evOv = function() { document.onmouseover = bgColorChanger };

    if (window.onload) window.onload.prototype = new evOv;
    else window.onload = evOv; 
}


function bgColorChanger(_e)
{
    var isTd = (_e? _e: event)[bgccc.attTgt];
    var isTr = isTd[bgccc.attPNode];
    
    if (bgccc.checker(isTr)) 
    {
        bgccc.temp(isTr);
        if (!isTd.onmouseout) isTd.onmouseout = function() { bgccc.resetVal(isTr) };
    }
}

if (document.all || document.getElementById) bgccc = new bgccc;





