Hiho...

ich könnte hier mal hilfe benötigen...
Ich versuche mich gerade daran ein MAP/Karte zu erstellen.
Also sowas:


Das sieht ja auch schonmal ganz gut aus...
Wenn ich mich allerdings bewegen will verschiebt sich die Karte nach rechts etwas runter...also so:


Ich suche jetzt schon seit 2 Tagen und finde einfach nicht den auslöser dafür...
Es wäre schön wenn Ihr mal über den Code schaut ob Ihr da etwas findet:
PHP-Code:
<?
if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];
else $action="main";
if($action=="main") {
$bild_stat = db_query("SELECT * FROM vms_countries WHERE userid = ".$_SESSION['uid']." LIMIT 1");
$bst = mysql_fetch_array($bild_stat);
    $x=$bst['x'];
    $y=$bst['y'];

    if(isset($_GET['x'])) {
        $x=intval($_GET['x']);
    }

    if(isset($_GET['y'])) {
        $y=intval($_GET['y']);
    }


    if(isset($_POST['x_pos'])) {
        $x=intval($_POST['x_pos']);
    }

    if(isset($_POST['y_pos'])) {
        $y=intval($_POST['y_pos']);
    }


    $usr_x=$x;
    $usr_y=$y;

    $max_x=$x+2;
    $max_y=$y+2;

    $min_x=$x-2;
    $min_y=$y-2;
    $navi_oben="<a href=\"javascript:go_map(-1,0)\"><img border= \"0\" src=\"images/map/pfeil_up.png\" width=\"50\" height=\"50\" /></a>";
    $navi_rechts="<a href=\"javascript:go_map(0,1)\"><img border=\"0\" src=\"images/map/pfeil_right.png\" width=\"50\" height=\"50\" /></a>";
    $navi_unten="<a href=\"javascript:go_map(1,0)\"><img border=\"0\" src=\"images/map/pfeil_down.png\" width=\"50\" height=\"50\" /></a>";
    $navi_links="<a href=\"javascript:go_map(0,-1)\"><img border=\"0\" src=\"images/map/pfeil_left.png\" width=\"50\" height=\"50\" /></a>";

    $where="";
    $x_count=0;
    $y_count=0;
    $land=array();
    for($starty=$min_y;$starty <= $max_y;$starty++) {
        $y_count=0;
        for($startx=$min_x;$startx <= $max_x;$startx++) {
            $land[$startx][$starty]="<div class='land_0'>$startx:$starty</div>";
            if ($startx <= 0 || $starty<= 0){

            }else{

        }

        if ($where==""){
            $where="(x='$startx' and y='$starty')";
        }else{
        $where.=" OR (x='$startx' and y='$starty')";
    }


    $y_count++;
}
$x_count++;
}

$sql="SELECT userid,name,size,usesize,islandid,x,y,picid,name FROM vms_countries where $where";

$result= db_query($sql);
while($row= mysql_fetch_array($result)) {
    $x=$row['x'];
    $y=$row['y'];

    $np   = $domain.'/?content=/nickpage&amp;nick=';         // Nickpagelink
    $cur_name=username($row['userid']);
    $land_name=$row['name'];
    $land_size=$row['size'];
    $land_cursize=$row['usesize'];
    $tt="onmouseover=\"Tip('Landname:$land_name<br>Besitzer:$cur_name<br>Größe:$land_size<br>Bebaut:$land_cursize',TITLE,'Info ',FADEIN,400,SHADOW, true,OPACITY, 100,BGCOLOR,'#D3E3F6',BORDERWIDTH,'0',PADDING, 0)\" onmouseout=\"UnTip()\"";
    if ($row['picid']==1) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_1' $tt>$x:$y</div></a>";
    }elseif ($row['picid']==2) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_2' $tt>$x:$y</div></a>";
    } elseif ($row['picid']==3) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_3' $tt>$x:$y</div></a>";

    } elseif ($row['picid']==4) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_4' $tt>$x:$y</div></a>";

    }elseif ($row['picid']==0) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_1' $tt>$x:$y</div></a>";

    }
}

$sql="SELECT * FROM vms_crand where (element_type <> '0') and ($where)";
$result= db_query($sql);
while($row= mysql_fetch_array($result)) {
    $element=$row['element_type'];
    $x=$row['x'];
    $y=$row['y'];


    if ($element==1){
        $tt="onmouseover=\"Tip('Seegebiet',PADDING, 2,BGCOLOR,'#DDDDDD',TEXTALIGN,'center',FADEIN,400,SHADOW, true,OPACITY, 100,FONTCOLOR,'#000000')\" onmouseout=\"UnTip()\"";
        $land[$x][$y]="<div class='land_f' $tt >$x:$y </div>";
    }elseif($element==2){
        $tt="onmouseover=\"Tip('Berge',PADDING, 2,BGCOLOR,'#DDDDDD',TEXTALIGN,'center',FADEIN,400,SHADOW, true,OPACITY, 100,FONTCOLOR,'#000000')\" onmouseout=\"UnTip()\"";
        $land[$x][$y]="<div class='land_b' $tt>$x:$y</div>";
    }

}


$return_div="";
foreach($land as $key1 => $value1) {
    foreach($value1 as $key2 => $value2) {
        $return_div.=$land[$key1][$key2];
    }
}
}

if($action=="goto") {
require ('../../lib/functions.lib.php');
db_connect();
require ('../../lib/session.lib.php');


    $x=intval($_GET['x']);
    $y=intval($_GET['y']);


    $max_x=$x+2;
    $max_y=$y+2;

    $min_x=$x-2;
    $min_y=$y-2;

    $where="";
    $x_count=0;
    $y_count=0;

    $land=array();
    for($starty=$min_y;$starty <= $max_y;$starty++) {
        $y_count=0;
        for($startx=$min_x;$startx <= $max_x;$startx++) {
            $land[$startx][$starty]="<div class='land_0'>$startx:$starty</div>";
            if ($startx <= 0 || $starty<= 0){

            }else{

        }

        if ($where==""){
            $where="(x='$startx' and y='$starty')";
        }else{
        $where.=" OR (x='$startx' and y='$starty')";
    }


    $y_count++;
}
$x_count++;
}

$sql="SELECT islandid,x,y,picid,name,userid,points,size,usesize FROM vms_countries where $where";

$result= db_query($sql);
while($row= mysql_fetch_array($result)) {
    $x=$row['x'];
    $y=$row['y'];
    $np   = $domain.'/?content=/nickpage&amp;nick=';         // Nickpagelink
        $cur_name=username($row['userid']);
    $land_name=$row['name'];
    $land_size=$row['points'];
    $land_cursize=$row['usesize'];
    $tt="onmouseover=\"Tip('Landname:$land_name<br>Besitzer:$cur_name<br>Punkte:$land_size<br>Bebaut:$land_cursize',TITLE,'Info ',BGCOLOR,'#D3E3F6',BORDERWIDTH,'0',FADEIN,400,SHADOW, true,OPACITY, 100,PADDING, 0)\" onmouseout=\"UnTip()\"";

    if ($row['picid']==1) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_1' $tt>$x:$y</div></a>";
    }elseif ($row['picid']==2) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_2' $tt>$x:$y</div></a>";
    } elseif ($row['picid']==3) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_3' $tt>$x:$y</div></a>";

    } elseif ($row['picid']==4) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_4' $tt>$x:$y</div></a>";

    }elseif ($row['picid']==0) {
        $land[$x][$y]="<a href=\"$np$cur_name\"><div class='land_1' $tt>$x:$y</div></a>";

    }

}

$sql="SELECT * FROM vms_crand where (element_type <> '0') and ($where)";
$result= db_query($sql);
while($row= mysql_fetch_array($result)) {
    $element=$row['element_type'];
    $x=$row['x'];
    $y=$row['y'];

    if ($element==1){
        $tt="onmouseover=\"Tip('Seegebiet',PADDING, 2,BGCOLOR,'#DDDDDD',TEXTALIGN,'center',FADEIN,400,SHADOW, true,OPACITY, 80,FONTCOLOR,'#000000')\" onmouseout=\"UnTip()\"";
        $land[$x][$y]="<div class='land_f' $tt>$x:$y</div>";
    }elseif($element==2){
        $tt="onmouseover=\"Tip('Berge',PADDING, 2,BGCOLOR,'#DDDDDD',TEXTALIGN,'center',FADEIN,400,SHADOW, true,OPACITY, 80,FONTCOLOR,'#000000')\" onmouseout=\"UnTip()\"";
        $land[$x][$y]="<div class='land_b' $tt>$x:$y</div>";
    }

}

$return_div="";
foreach($land as $key1 => $value1) {
    foreach($value1 as $key2 => $value2) {
        $return_div.=$land[$key1][$key2];
    }
}

}
?>
<script type="text/javascript" src="js/wz_tooltip.js"></script>

<style>
#map_all {background-image:url(images/map/mapbg.png);
      background-repeat:repeat;
      width:400px;
      height:400px;
     }
.land_0{
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      
      }
.land_1 {background-image:url(images/map/land1.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
.land_2 {background-image:url(images/map/land2.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
.land_3 {background-image:url(images/map/land3.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
.land_4 {background-image:url(images/map/land4.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
.land_b {background-image:url(images/map/landb.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
.land_f {background-image:url(images/map/landf.png);
       width:80px;
       height:80px;
       float:left;
       border:0px;
       font-size:9px;
       text-align:center;
      }
</style>  
<script language='javascript' type='text/javascript'>
/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
window.XMLHttpRequest = function() { return new ActiveXObject('Microsoft.XMLHTTP') }
@end @*/
var curpos_x=<?=$usr_x;?>;
var curpos_y=<?=$usr_y;?>;
function go_map(var_x,var_y)
 {var x = new XMLHttpRequest();
 curpos_x+=var_x;
 curpos_y+=var_y;
 
 
  x.open("GET","/content/karte/map.php?action=goto&x="+curpos_x+"&y="+curpos_y,false);
  x.send(null);
  resp = x.responseText;
  
 document.getElementById("map_all").innerHTML = " "+resp+" ";
  
 }       
</script> 

<!-- Karte -->
<center> 
<table width="500" height="500" align="center" >
  <tr> 
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;<?=$navi_oben;?></td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
  </tr>
  <tr> 
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
  </tr>
  <tr> 
    <td align='center'><?=$navi_links;?></td>
    <td align='center'></td>
    <td align='center'><div id='map_all'><?=$return_div;?></div></td>
    <td align='center'></td>
    <td align='center'><?=$navi_rechts;?></td>
  </tr>
  <tr> 
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
  </tr>
  <tr> 
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;<?=$navi_unten;?></td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
  </tr>
  <tr> 
<form name="show_map_pos" method="post" action="?content=/karte/map&cxid=<?=$sid;?>">
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
    <td align='center'><br /><br />
    zeige: 
    <input class="textinput_smal" name="x_pos" type="text" size="7" maxlength="3" value="<?=$usr_x;?>">
    :
    <input class="textinput_smal" name="y_pos" type="text" size="7" maxlength="3" value="<?=$usr_y;?>">
    <input type="submit" class="button" name="Submit" value="anzeigen">
  
    
    </td>
    <td align='center'>&nbsp;</td>
    <td align='center'>&nbsp;</td>
  </form>
  </tr>
 </table>
</center>
<?if($action=="goto") {db_close();}?>