     <!--

        ImgClr = new Image(); 
        ImgClr.src = "images/base_block.gif";

        Images = new Array(7);

        for ( i=0; i<7; i++ )
        {
          Images[i] = new Image(); 
          image_name = "images/color_" + i + ".gif"
          Images[i].src = image_name;
        }

        var timerID;

        var matrix;

	var p_shape = new Array (
  	             new Array(0,0), 
                     new Array(0,0),
                     new Array(0,0),
		     new Array(0,0),
		     new Array(0,0)
                   );

	var shape = new Array (
  	             new Array(0,0), 
                     new Array(0,0),
                     new Array(0,0),
		     new Array(0,0)
                   );

	shape0 = new Array (
	          new Array 
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(2,0)
                   ),
	          new Array 
  	           ( new Array(0,-1), 
                     new Array(0,0),
                     new Array(0,1),
		     new Array(0,2)
                   ),
	          new Array 
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(2,0)
                   ),
	          new Array 
  	           ( new Array(0,-1), 
                     new Array(0,0),
                     new Array(0,1),
		     new Array(0,2)
                   )
               );

	shape1 = new Array (
	          new Array
  	           ( new Array(-1,0), 
                     new Array(0,0),
		     new Array(1,0),
                     new Array(0,1)
                   ),
	          new Array 
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(0,-1),
		     new Array(0,1)
                   ),
	          new Array 
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(0,-1)
                   ),
	          new Array 
  	           ( new Array(0,-1), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(0,1)
                   )
               );

	shape2 = new Array (
	          new Array
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(-1,1)
                   ),
	          new Array 
  	           ( new Array(-1,-1), 
                     new Array(0,-1),
                     new Array(0,0),
		     new Array(0,1)
                   ),
	          new Array 
  	           ( new Array(-1,0), 
                     new Array(0,0),
                     new Array(1,0),
		     new Array(1,-1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(0,-1),
                     new Array(0,1),
		     new Array(1,1)
                   )
               );

	shape3 = new Array (
	          new Array
  	           ( new Array(0,0), 
                     new Array(-1,0),
                     new Array(1,0),
		     new Array(1,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(0,-1),
                     new Array(0,1),
		     new Array(-1,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(-1,-1),
                     new Array(-1,0),
		     new Array(1,0)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(0,-1),
                     new Array(1,-1),
		     new Array(0,1)
                   )
               );

	shape4 = new Array (
	          new Array
  	           ( new Array(0,0), 
                     new Array(-1,0),
                     new Array(0,-1),
		     new Array(1,-1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(-1,-1),
                     new Array(-1,0),
		     new Array(0,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(-1,0),
                     new Array(0,-1),
		     new Array(1,-1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(-1,-1),
                     new Array(-1,0),
		     new Array(0,1)
                   )
               );

	shape5 = new Array (
	          new Array
  	           ( new Array(0,0), 
                     new Array(-1,-1),
                     new Array(0,-1),
		     new Array(1,0)
                   ),
	          new Array 
  	           ( new Array(0,0), 
		     new Array(0,1),
                     new Array(1,-1),
                     new Array(1,0)
                   ),
	          new Array
  	           ( new Array(0,0), 
                     new Array(-1,-1),
                     new Array(0,-1),
		     new Array(1,0)
                   ),
	          new Array 
  	           ( new Array(0,0), 
		     new Array(0,1),
                     new Array(1,-1),
                     new Array(1,0)
                   )
               );

	shape6 = new Array (
	          new Array
  	           ( new Array(0,0), 
                     new Array(1,0),
                     new Array(0,1),
		     new Array(1,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(1,0),
                     new Array(0,1),
		     new Array(1,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(1,0),
                     new Array(0,1),
		     new Array(1,1)
                   ),
	          new Array 
  	           ( new Array(0,0), 
                     new Array(1,0),
                     new Array(0,1),
		     new Array(1,1)
                   )
               );

	shapes = new Array ( shape0, 
                             shape1, 
                             shape2, 
                             shape3, 
                             shape4, 
                             shape5, 
                             shape6 );

	shapes_score = new Array ( 2,3,4,4,3,3,4); 

	document.onkeydown = HandleKeyDown;
	document.onkeyup = HandleKeyUp;

        var curr_shape_num;
        var prev_shape_num;
        var next_shape_num;
        var curr_shape_rot;
        var shape_ended;
        var game_ended;
        var num_rows;
        var num_columns;
        var curr_row;
        var curr_column;
        var timeout;
        var busy;
        var lines;
        var score;
        var level;
        var first_time=1;
        var paused=1;
        var highScore;

        function Init() 
        {
          try
          {
            curr_shape_rot=0;
            timeout=500;
            busy=0;
            lines=0;
            score=0;
            level=1;

            val = document.getElementById("NumRows").value;
            num_rows = parseInt(val);     

            val = document.getElementById("NumColumns").value;
            num_columns = parseInt(val);     

            document.getElementById("Level").value = 1;
            document.getElementById("Lines").value = 0;
            document.getElementById("Score").value = 0;

            InitMatrix(); 

            //delete_cookie ( "Score" );
            highScore = parseInt(getCookie("Score"));

            document.getElementById("HighScore").innerHTML = highScore;
          }
          catch(err)
          {
	    alert("Error in function Init : "+err.description);
          }
        }

        function getCookie(c_name)
        {
          try
          {
            if (document.cookie.length>0)
            {
              c_start=document.cookie.indexOf(c_name + "=");
              if (c_start!=-1)
              { 
                c_start=c_start + c_name.length+1; 
                c_end=document.cookie.indexOf(";",c_start);
                if (c_end==-1) c_end=document.cookie.length;
                return unescape(document.cookie.substring(c_start,c_end));
              } 
            }
          }
          catch(err)
          {
	    alert("Error in function getCookie : "+err.description);
          }
          return "0";
        }

        function delete_cookie ( cookie_name )
        {
          try
          {
            var cookie_date = new Date ( );  // current date & time
            cookie_date.setTime ( cookie_date.getTime() - 1 );
            dcument.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
          }
          catch(err)
          {
	    alert("Error in function delete_cookie : "+err.description);
          }
        }

        function setCookie(c_name,value,expiredays)
        {
          try
          {
            var exdate=new Date();

            exdate.setDate(exdate.getDate()+expiredays);

            document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
          }
          catch(err)
          {
	    alert("Error in function setCookie : "+err.description);
          }
        }

        function InitMatrix() 
        {
          try
          {
      	    matrix = new Array(num_columns);

            for ( i=0; i<num_columns; i++ )
            {
              matrix[i] = new Array(num_rows);
            }

            for ( i=0; i<num_columns; i++ )
            {
              for ( j=0; j<num_rows; j++ )
              {
                matrix[i][j]=0;
                shape_name = "pos_" + i + "_" + j;
                document[shape_name].src= ImgClr.src;
              }
            }
            gameStat = document.getElementById("StatusId");
            gameStat.style.color = '#aa0066';
            gameStat.value = "                   Click on 'Play' to start a game!";
          }
          catch(err)
          {
	    alert("Error in function InitMatrix : "+err.description);
          }
        }

        function SetDefaultStartXY () 
        {
          try
          {
            curr_row=0; 

            if ( ( curr_shape_num == 4 ) || ( curr_shape_num == 5 ) )
            {
              curr_row=1; 
            } 

            curr_column=5;

            if ( ( curr_shape_num == 0 ) || ( curr_shape_num == 6 ) )
            {
              curr_column=4;
            }

            curr_shape_rot=0;
          }
          catch(err)
          {
	    alert("Error in function SetDefaultStartXY : "+err.description);
          }
        }

        function StartNewGame () 
        {
          try
          {
            if ( first_time == 1 )
            {
              SetFirstShapeNum(); 

              DrawPreview(curr_shape_num,next_shape_num); 

              shape_ended=0;
              game_ended=0;
              busy = 0;

              SetDefaultStartXY();

              if ( CheckPlace (curr_shape_num,curr_column,curr_row) == 1 )
              {
                SetCurrShape(curr_shape_num,curr_shape_rot);
                DrawShape (curr_column,curr_row) ;
                SavePrevShape(curr_column,curr_row);
              }
              first_time=0;
            }         

            gameStat = document.getElementById("StatusId");
            gameStat.style.color = '#770077';
            gameStat.value = "                                                ";

            timerID  = setTimeout("HandleTimeout()", timeout);
          }
          catch(err)
          {
	    alert("Error in function StartNewGame : "+err.description);
          }
        }

        function PlayPauseGame()
        {
          try
          {
            if ( paused == 1 )
            {
              paused = 0;
              StartNewGame ();
              document.getElementById("StartId").value = "  Pause  ";
            }
            else
            {
              paused = 1;
              clearTimeout(timerID);
              timerId=0;
              document.getElementById("StartId").value = "  Resume  ";
            }
          }
          catch(err)
          {
	    alert("Error in function PlayPauseGame : "+err.description);
          }
        }

        function CheckPlace (shape_num,column,row) 
        {
          try
          {
            for ( i=0; i<4; i++ )
            {
              x = shapes[shape_num][0][i][0];
              y = shapes[shape_num][0][i][1];

              if ((x+column<0) || (x+column >= num_columns))
              {
                return 0;
              }
              if ( ( y+row < 0 ) || ( y+row >= num_rows ) ) 
              {
                return 0;
              }
              if ( matrix[x+column][y+row] == 1 ) return 0;
            }
          }
          catch(err)
          {
	    alert("Error in function CheckPlace : "+err.description);
          }

          return 1;
        }

        function HandleTimeout () 
        {
          try
          {
            HandleShapeDown();
            timerID  = setTimeout("HandleTimeout()", timeout);
          }
          catch(err)
          {
	    alert("Error in function HandleTimeout : "+err.description);
          }
        }

        function SetFirstShapeNum () 
        {
          try
          {
            curr_shape_num = Math.floor(Math.random()*7);
            next_shape_num = Math.floor(Math.random()*7);
            prev_shape_num = curr_shape_num;
          }
          catch(err)
          {
	    alert("Error in function SetFirstShapeNum : "+err.description);
          }
        }

        function RedrawShape () 
        {
          try
          {
            SetCurrShape(curr_shape_num,curr_shape_rot);
            DrawShape (curr_column,curr_row) ;
            SavePrevShape(curr_column,curr_row);
          }
          catch(err)
          {
	    alert("Error in function RedrawShape : "+err.description);
          }
        }


        function DeleteShape () 
        {
          try
          {
            x0 = p_shape[4][0];
            y0 = p_shape[4][1];

            for ( i=0; i<4; i++ )
            {
              x = p_shape[i][0]+x0;
              y = p_shape[i][1]+y0;

              shape_name = "pos_" + x + "_" + y;

              document[shape_name].src= ImgClr.src;

              matrix[x][y]=0;
            }
          }
          catch(err)
          {
	    alert("Error in function DeleteShape : "+err.description);
          }
        }
 
        function SetCurrShapeMatrix (x0,y0,value) 
        {
          try
          {
            for ( i=0; i<4; i++ )
            {
              x = shapes[curr_shape_num][curr_shape_rot][i][0]+x0;
              y = shapes[curr_shape_num][curr_shape_rot][i][1]+y0;

              shape_name = "pos_" + x + "_" + y;

              matrix[x][y]=value;
            }
          }
          catch(err)
          {
	    alert("Error in function SetCurrShapeMatrix : "+err.description);
          }
        }
  
        function DrawShape (x0,y0) 
        {
          try
          {
            for ( i=0; i<4; i++ )
            {
              x = shape[i][0]+x0;
              y = shape[i][1]+y0;

              shape_name = "pos_" + x + "_" + y;

              document[shape_name].src= Images[curr_shape_num].src;

              matrix[x][y]=1;
            }
          }
          catch(err)
          {
	    alert("Error in function DrawShape : "+err.description);
          }
        }
 
        function SetCurrShape(shape_num,shape_rot)  
        {
          try
          {
            for ( i=0; i<4; i++ )
            {
              shape[i][0] = shapes[shape_num][shape_rot][i][0];
              shape[i][1] = shapes[shape_num][shape_rot][i][1];
            }
          }
          catch(err)
          {
	    alert("Error in function SetCurrShape : "+err.description);
          }
        }

        function SavePrevShape (column,row) 
        {
          try
          {
            for ( i=0; i<4; i++ )
            {
              p_shape[i][0] = shape[i][0];
              p_shape[i][1] = shape[i][1];
            }
            p_shape[4][0]=column;
            p_shape[4][1]=row;
          }
          catch(err)
          {
	    alert("Error in function SavePrevShape : "+err.description);
          }
        }

        function DrawPreview (shape_num_old,shape_num_new) 
        {
          try
          {
            var x;
            var y;

            off_y=1; 

            if ( ( next_shape_num == 4 ) || ( next_shape_num == 5 ) )
            {
              off_y=2; 
            } 

            off_x=2;

            if ( ( next_shape_num == 0 ) || ( next_shape_num == 6 ) )
            {
              off_x=2;
            }

            prev_off_y=1; 

            if ( ( curr_shape_num == 4 ) || ( curr_shape_num == 5 ) )
            {
              prev_off_y=2; 
            } 

            prev_off_x=2;
  
            if ( ( curr_shape_num == 0 ) || ( curr_shape_num == 6 ) )
            {
              prev_off_x=2;
            }

            for ( i=0; i<4; i++ )
            {
              x = shapes[shape_num_old][0][i][0]+prev_off_x;
              y = shapes[shape_num_old][0][i][1]+prev_off_y;

              shape_name = "shape_" + x + "_" + y;
              document[shape_name].src= ImgClr.src;
            }

            for ( i=0; i<4; i++ )
            {
              x = shapes[shape_num_new][0][i][0]+off_x;
              y = shapes[shape_num_new][0][i][1]+off_y;

              shape_name = "shape_" + x + "_" + y;
              document[shape_name].src = Images[next_shape_num].src;
            }
          }
          catch(err)
          {
	    alert("Error in function DrawPreview : "+err.description);
          }
        }

        function HandleShapeDown () 
        {
          try
          {
            if ( !game_ended )
            {
              del = 1;
              if ( shape_ended == 1)
              {
                GetNextShape ();
                DrawPreview(curr_shape_num,next_shape_num); 
                del = 0;
                shape_ended = 0 ;
                busy = 0;
              }

              MoveShapeDown(del);
            }
          }
          catch(err)
          {
	    alert("Error in function HandleShapeDown : "+err.description);
          }
        }


        function MoveShapeDown (del) 
        {
          try
          {
            if ( shape_ended ) return;

            if ( busy == 0 )
            {
              busy = 1;

              if ( CheckDown () == 1 )
              {
                if ( del == 1 )
                {
                  DeleteShape () ;
                  curr_row++;
                }
  
                RedrawShape ();
              }
              else
              {
                shape_ended = 1;
                val = document.getElementById("Score").value;
                score = parseInt(val);     
                score += shapes_score[curr_shape_num];
                document.getElementById("Score").value = score;
                CheckLevel();
                CheckCompleteLines();
                if ( curr_row < 1 ) 
                {
                  //alert('game ended');
                  clearTimeout(timerID);
                  timerId=0;
                  gameStat = document.getElementById("StatusId");
                  gameStat.style.color = '#aa0066';
                  val = parseInt(document.getElementById("Score").value);

                  if ( val > highScore )
                  {
                    gameStat.style.color = '#118811';
                    gameStat.value = " Congratulations! highest score now is " + val; 
                    setCookie("Score",val,365);
                  }
                  else
                  {               
                    gameStat.value = " Game Ended! Your score is " + val + " points"; 
                  }
  
                  ng = document.getElementById("NewGame");
                  ng.style.visibility = "visible";
                  document.getElementById("StartId").style.visibility = "hidden";
                  game_ended=1;
                }
              }
              busy = 0;
            }
          }     
          catch(err)
          {
	    alert("Error in function MoveShapeDown : "+err.description);
          }
        }

        function CheckLevel()
        {
          try
          {
            levelChanged=0;

            if ( ( score > 1000 ) && ( level == 1 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 2000 ) && ( level == 2 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 3000 ) && ( level == 3 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 4000 ) && ( level == 4 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 5000 ) && ( level == 5 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 6000 ) && ( level == 6 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 7000 ) && ( level == 7 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 8000 ) && ( level == 8 ) )
            {
              level++;
              levelChanged=1;
            }
            else if ( ( score > 9000 ) && ( level == 9 ) )
            {
              level++;
              levelChanged=1;
            }

            if ( levelChanged == 1 )
            {
              document.getElementById("Level").value = level;
              timeout -= 50;
            }
          }
          catch(err)
          {
	    alert("Error in function CheckLevel : "+err.description);
          }
        }

        function CheckCompleteLines()
        {
          try
          {
            for ( i=0; i<num_rows; i++ )
            {
              line_complete=1;
              for ( j=0; j<num_columns; j++ )
              {
                if ( matrix[j][i] == 0 )
                {
                  line_complete=0;
                  break;  
                }
              }
              if ( line_complete )
              {
                RemoveLine(i);
                (document.getElementById("Lines").value)++;
                val = document.getElementById("Score").value;
                score = parseInt(val);     
                score += 50;
                document.getElementById("Score").value = score;
                //alert ("Line number " + i + " is completed");
              }
            }
          }
          catch(err)
          {
	    alert("Error in function CheckCompleteLines : "+err.description);
          }
        }

        function RemoveLine(line)
        {
          try
          {
            for ( i=line; i>0; i-- )
            {
              for ( j=0; j<num_columns; j++ )
              {
                matrix[j][i] = matrix[j][i-1];

                shape_name = "pos_" + j + "_" + i;
                shape_name1 = "pos_" + j + "_" + (i - 1);
                document[shape_name].src= document[shape_name1].src;
              }
            }

            for ( j=0; j<num_columns; j++ )
            {
              matrix[j][0] = 0;
              shape_name = "pos_" + j + "_" + 0;
              document[shape_name].src= ImgClr.src;
            }
          }
          catch(err)
          {
	    alert("Error in function RemoveLine : "+err.description);
          }
        }

        function CheckDown () 
        {
          try
          {
            var row = curr_row + 1;
            var ret = 1;

            SetCurrShapeMatrix (curr_column,curr_row,0); 

            for ( i=0; i<4; i++ )
            {
              x = shapes[curr_shape_num][curr_shape_rot][i][0];
              y = shapes[curr_shape_num][curr_shape_rot][i][1];

              if ( ( y + row < 0 ) || ( y + row >= num_rows ) ) 
              {
                ret=0;
                break;
              }

              if ( matrix[x+curr_column][y+row] == 1 ) 
              {
                ret=0;
                break;
              }
            }

            if ( ret == 0 )
            {
              SetCurrShapeMatrix (curr_column,curr_row,1); 
            }
          }
          catch(err)
          {
	    alert("Error in function CheckDown : "+err.description);
          }

          return ret;
        }

        function GetNextShape () 
        {
          try
          {
            curr_shape_num = next_shape_num; 
            prev_shape_num = curr_shape_num;
            next_shape_num = Math.floor(Math.random()*7);
            SetDefaultStartXY();
          }
          catch(err)
          {
	    alert("Error in function GetNextShape : "+err.description);
          }
        }

        function Accelerate () 
        {
          try
          {
            clearTimeout(timerID);
            timerId=0;
            HandleShapeDown();
          }
          catch(err)
          {
	    alert("Error in function Accelerate : "+err.description);
          }
        }

        function Move_Left () 
        {
          try
          {
            if ( shape_ended ) return;

            if ( busy == 0 )
            {
              busy = 1;
              if ( CheckMove (curr_column,-1) == 1 )
              {
                DeleteShape () ;
                curr_column--;
                RedrawShape () ;
              }
              busy = 0;
            }
          }
          catch(err)
          {
	    alert("Error in function Move_Left : "+err.description);
          }
        }

        function Move_Right () 
        {
          try
          {
            if ( shape_ended ) return;

            if ( busy == 0 )
            {
              busy = 1;
              if ( CheckMove (curr_column,1) == 1 )
              {
                DeleteShape () ;
                curr_column++;
                RedrawShape () ;
              }
              busy = 0;
            }
          }
          catch(err)
          {
	    alert("Error in function Move_Right : "+err.description);
          }
        }

        function CheckMove (curr_column,delta) 
        {
          try
          {
            var ret = 1;
            var col = curr_column;
 
            col += delta;

            SetCurrShapeMatrix (curr_column,curr_row,0); 

            for ( i=0; i<4; i++ )
            {
              x = shapes[curr_shape_num][curr_shape_rot][i][0];
              y = shapes[curr_shape_num][curr_shape_rot][i][1];

              if ( ( x + col < 0 ) || ( x + col >= num_columns ) ) 
              {
                ret=0;
                break;
              }
              if ( matrix[x+col][y+curr_row] == 1 ) 
              {
                ret=0;
                break;
              }
            }

            if ( ret == 0 )
            {
              SetCurrShapeMatrix (curr_column,curr_row,1); 
            }
          }
          catch(err)
          {
	    alert("Error in function CheckMove : "+err.description);
          }

          return ret;
        }

        function Rotate () 
        {
          try
          {
            if ( shape_ended ) return;
          
            if ( busy == 0 )
            {
              busy = 1;

              if ( CheckRotation (curr_shape_rot) == 1 )
              {
                DeleteShape () ;
                curr_shape_rot++;
                curr_shape_rot = curr_shape_rot % 4;

                RedrawShape () ;
              }

              busy = 0;
            }
          }
          catch(err)
          {
	    alert("Error in function Rotate : "+err.description);
          }
        }

        function CheckRotation (curr_shape_rot) 
        {
          try
          {
            var ret=1;
            var rot = curr_shape_rot;

            rot++;
            rot = rot % 4;

            SetCurrShapeMatrix (curr_column,curr_row,0); 

            for ( i=0; i<4; i++ )
            {
              x = shapes[curr_shape_num][rot][i][0];
              y = shapes[curr_shape_num][rot][i][1];

              if ((x+curr_column<0) || (x+curr_column >= num_columns))
              {
                ret=0;
                break;
              }

              if ( ( y+curr_row < 0 ) || ( y+curr_row >= num_rows ) ) 
              {
                ret=0;
                break;
              }

              if ( matrix[x+curr_column][y+curr_row] == 1 ) 
              {
                ret=0;
              }
            }

            if ( ret == 0 )
            {
              SetCurrShapeMatrix (curr_column,curr_row,1); 
            }
          }
          catch(err)
          {
	    alert("Error in function CheckRotation : "+err.description);
          }

          return ret;
        }

        function HandleKeyDown ( e ) 
        {
          try
          {
            if ( ! e ) e = window.event;

            switch ( e.keyCode ) 
            {
              case 37:
                       Move_Left();
   	  	       break;
			
              case 39:
                       Move_Right();
                       break;

              case 38:
                       Rotate();
                       break;

              case 40:
                       Accelerate();
                       break;

              default :;
            }
          }
          catch(err)
          {
	    alert("Error in function HandleKeyDown : "+err.description);
          }
        }

        function HandleKeyUp ( e ) 
        {
          try
          {
    	    if ( ! e ) e = window.event;

  	    if ( e.keyCode == 40 ) 
            {
              clearTimeout(timerID);
              timerID  = setTimeout("HandleTimeout()", timeout);
            }
          }
          catch(err)
          {
	    alert("Error in function HandleKeyUp : "+err.description);
          }
        }


      //-->