 hexa = new Array(16);
        for(var i = 0; i < 10; i++)
                hexa[i] = i;
        hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
        hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

        function hex3(i) 
        {
                if (i < 0)
                        return "00";
                else if (i > 255)
                        return "ff";
                else
                        return "" + hexa[Math.floor(i/16)] + hexa[i%16];
        }

        function setbgColor3(r, g, b) 
        {
                document.bgColor = "#"+hex3(r)+hex3(g)+hex3(b);
        }
        
        // 1 -- white --> black
        // -1 -- black --> white
        var inc = 1;
        var cur_i = 20;
        var max_step = 20;
        var in_progress = false;
        
        function msovera3()
        {
                inc = -1;
                if( !in_progress )
                        step3();
        }

        function msouta3()
        {
                inc = 1;
                if( !in_progress )
                        step3();
        }
        
        function step3()
        {		
        	//	alert(document.bgColor);
                setbgColor3( Math.floor(255 * cur_i / max_step),
                                Math.floor(40 * cur_i / max_step),
                                /* Math.floor(00 * cur_i /max_step) */ 200);
           //    alert("2:" + document.bgColor);
                cur_i += inc;
                if( (inc > 0 && cur_i > max_step) || (inc < 0 && cur_i < 0) )
                {
                        cur_i -= inc;
                        inc = -inc;
                        in_progress = false;
                }
                else
                {
                        in_progress = true;
                        setTimeout("step3()", 3);
                }
        }