$( document ).ready( function() {
    $( '.creature' ).mouseover( function () {
        var ARROW_HEIGHT = 14;
        var ARROW_WIDTH = 30;
        var id = this.getAttribute( 'data-creatureid' );
        var username = this.getAttribute( 'data-username' );
        var x = this.getAttribute( 'data-x' );
        var y = this.getAttribute( 'data-y' );
        var hp = this.getAttribute( 'data-hp' );
        var maxHp = this.getAttribute( 'data-maxHp' );
        var $this = $( this );
        var offsetTop = $this.offset().top - $( '.infobubble' ).height() - 14;
        var $infobubble = $( '.infobubble' );
        var positioning;

        $infobubble.show();
        $( '.player' ).text( username );
        $( '.creatureid' ).text( 'Creature ' + id );
        $( '.location' ).text( x + ', ' + y );
        $( '.numeric' ).text( hp + ' / ' + maxHp );
        $( '.damage' ).css( 'width', Math.floor( 100 * ( maxHp - hp ) / maxHp ) + '%' );
        if ( offsetTop < 0 ) {
            positioning = $this.height() + ARROW_HEIGHT;
            $infobubble.addClass( 'reversed' );
        }
        else {
            positioning = -$infobubble.height() - ARROW_HEIGHT;
        }
        $infobubble.css( 'top', $this.position().top + positioning );
        $infobubble.css( 'left', $this.position().left - $infobubble.width() + ARROW_WIDTH );
    } );
    $( '.creature' ).mouseout( function() {
        var $infobubble = $( '.infobubble' );
        $infobubble.removeClass( 'reversed' );
        $infobubble.hide();
    } );
    function findGameAndRoundId( href ) {
        var hrefArray = href.split( "?" )[ 1 ].split( "&" );
        var attribute, gameid, roundid;

        for ( var i = 0; i < hrefArray.length; ++i ) {
            attribute = hrefArray[ i ].split( "=" );
            switch ( attribute[ 0 ] ) {
                case 'roundid':
                    roundid = parseInt( attribute[ 1 ] );
                    break;
                case 'gameid':
                    gameid = parseInt( attribute[ 1 ] );
                    break;
            }
        }
        return {
            gameid: gameid,
            roundid: roundid
        }
    }
    function fixUserList( hasCreatures ) {
        var $nodes = $( '.playerList li' );
        $.each( $nodes, function( index, value ) {
            $node = $nodes.eq( index );
            var userid = $node.attr( 'data-id' );
            var $nameNode = $node.contents()[ 1 ];
            var $newNameNode = $( document.createTextNode( $node.text() ) );

            if ( !hasCreatures[ userid ] && $nameNode.nodeName != "DEL" ) {
                $newNameNode = $( "<del>" + $newNameNode.text() + "</del>" );
            }
            $nameNode.remove();
            $node.append( $newNameNode );
        } );
    }
    function getMap( href ) {
        $.getJSON( href, function( creatures ) {
            var maxHp = $( '.creature' ).attr( 'data-maxHp' );
            var maxRounds = $( '.gamemeta h2' ).attr( 'data-rounds' );
            var nextHref = $( '.next a' ).attr( 'href' );
            var previousHref = $( '.previous a' ).attr( 'href' );
            var gameInfo = findGameAndRoundId( href );
            var prefix = "game/view?gameid=" + gameInfo.gameid + "&roundid=";
            var currentRoundid = gameInfo.roundid;
            var hasCreatures = new Array();

            history.pushState( {}, "", href );

            $( '.next' ).toggle( currentRoundid + 1 < maxRounds );
            $( '.next a' ).attr( 'href', prefix + ( currentRoundid + 1 ) );

            $( '.previous' ).toggle( currentRoundid - 1 >= 0 );
            $( '.previous a' ).attr( 'href', prefix + ( currentRoundid - 1 ) );

            $( '.round' ).text( 'Round ' + findGameAndRoundId( href ).roundid );

            $( '.creature' ).remove();
            for ( var i = 0; i < creatures.length; ++i ) {
                var creature = creatures[ i ];
                if ( creature.hp > 0 ) {
                    hasCreatures[ creature.userid ] = true;
                    var $user = $( '.playerList li[data-id=' + creature.userid + ']' );
                    var username = $user.text();
                    var color = $user.find( 'span.bubble' ).attr( 'data-color' );
                    creatureInfo = {
                        creatureid: creature.id,
                        username: username,
                        x: creature.x,
                        y: creature.y,
                        hp: creature.hp,
                        maxHp: maxHp
                    };
                    $creature = $( '<div class="' + color + ' creature"></div>' );
                    for ( var attribute in creatureInfo ) {
                        var value = creatureInfo[ attribute ];
                        $creature.attr( 'data-' + attribute, value );
                    }
                    $creature.css( {
                        left: creature.x * 20 + 'px',
                        top: creature.y * 20 + 'px'
                    } );
                }
                $( '.gameboard' ).prepend( $creature );
            }
            fixUserList( hasCreatures );
        } );
    }
    $( '.next a' ).click( function() {
        getMap( this.href );
        return false;
    } );
    $( '.previous a' ).click( function() {
        getMap( this.href );
        return false;
    } );
} );

@@ -2776,24 +2776,263 @@
  %7D );%0A    %7D%0A
+    function makeUrls( gameid, roundid ) %7B%0A        var url = %22game/view?gameid=%22 + gameid + %22&roundid=%22;%0A        $( %22.next a%22 ).attr( 'href', url + ( roundid + 1 ) );%0A        $( %22.previous a%22 ).attr( 'href', url + ( roundid - 1 ) );%0A    %7D%0A
     function
@@ -3236,132 +3236,8 @@
  );%0A
-            var nextHref = $( '.next a' ).attr( 'href' );%0A            var previousHref = $( '.previous a' ).attr( 'href' );%0A
     
@@ -3307,38 +3307,16 @@
 var 
-prefix = %22game/view?
 gameid
+ 
 =
-%22 +
  gam
@@ -3323,38 +3323,24 @@
 eInfo.gameid
- + %22&roundid=%22
 ;%0A          
@@ -3345,24 +3345,17 @@
     var 
-currentR
+r
 oundid =
@@ -3495,32 +3495,25 @@
 ' ).toggle( 
-currentR
+r
 oundid + 1 %3C
@@ -3530,85 +3530,8 @@
  );%0A
-            $( '.next a' ).attr( 'href', prefix + ( currentRoundid + 1 ) );%0A%0A
     
@@ -3563,24 +3563,17 @@
 toggle( 
-currentR
+r
 oundid -
@@ -3599,72 +3599,33 @@
     
-$( '.previous a' ).attr( 'href', prefix + ( currentRoundid - 1 )
+makeUrls( gameid, roundid
  );%0A

Add makeUrls function