        function jumpto( url )
          {
	  if ( url.length )
	    location = url;
	  }

        function autofarm_jumpto( url )
          {
          if ( !url.length )
            return;

          if ( url == 'logout' )
            {
            location = "/log_out.php";
            return;
            }

          var autofarm_frame = get_ref( "auto_farm_frame" );
/*          if ( autofarm_frame )
            autofarm_frame.src = "auto_farm/" + url;
          else  */
            location = "/auto_farm.php?page=" + url;
          }

        function autofarm2_jumpto( url )
          {
          if ( !url.length )
            return;

          if ( url == 'logout' )
            {
            location = "/log_out.php";
            return;
            }

          var autofarm_frame = get_ref( "auto_farm_frame" );
/*          if ( autofarm_frame )
            autofarm_frame.src = "auto_farm/" + url;
          else  */
            location = "/auto_farm2.php?page=" + url;
          }


        var farm_stats = new Array( );
        var farm_stats_idx = 0;

        function farm_stat( name , value )
          {
          this.name = name;
          this.value = value;
          this.show = function( )
            {
            get_ref( "farm_status" ).innerHTML = this.name + ":" + this.value;
            }          
          }

        function display_stat( )
          {
          if ( !get_ref( "farm_status" ) )
            return;
          if ( farm_stats_idx < farm_stats.length ) 
            {
            //logln( "display_stat:" + farm_stats_idx );
            //logln( "display_stat:" + farm_stats.length );
            farm_stats[ farm_stats_idx++ ].show( );
            }
          if ( farm_stats_idx >= farm_stats.length ) farm_stats_idx = 0;
          setTimeout( display_stat , 1000 );
          }

        function farm_status_xml_handler( )
          {
          logln( "farm_status_xml_handler..." );
          var docelt = req.responseXML.documentElement;
          if ( !docelt )
            {
            logln( "farm_status - no documentElement" );
            set_text( get_ref( "farm_status" ) , req.responseText );
            setTimeout( refresh_farm_status , 1000 );
            return;
            }
          var childNodes = docelt.childNodes;
          var count = childNodes.length;
          var new_stats = new Array( );
          logln( "childNodes.length:" + count );
          for( var idx = 0; idx != count ; ++idx )
            {
            var item = childNodes[ idx ];
            if( item.nodeName != 'item' )
              continue;
            new_stats[ new_stats.length ] = new farm_stat( item.getAttribute( 'name' ) , item.getAttribute( 'value' ) );
            logln( item.getAttribute( "name" ) + ":" + item.getAttribute( "value" ) );
            }
          logln( "storing new_stats as farm_stats" );
          farm_stats = new_stats;
          setTimeout( refresh_farm_status , 30000 ); // refresh every 30 seconds
          }

        function refresh_farm_status( )
          {
          request_xml_doc( "farm_status.php" , farm_status_xml_handler );
          }


