Stworzylem sobie mini gre w php, mysql i js, ale mam problemik z mapka miasta, a mianowicie, wszystko dziala pieknie dopoki na mapce nima obiektow

Czyli mamy pusta mapke, po najechaniu na pole gdzie ma byc budynek, wyswietla nam go z informacjami. (po odjechaniu myszka, budynek i informacje znikaja)
Ale problem pojawia sie gdy chce by budynek poprostu stal, a po najechaniu na niego pojawialy sie jego dane itp. ( czyli gdy zostanie wybudowany).
Nie jestem zbyt mocny w js, wiec gdy wczytalem obrazek w miejsce "area shape" to zakrywalo mi "shape".
Kod wyglada tak:
<?php function showstatus(name) { document.getElementById(name).style.display = ''; document.getElementById(name + '_status').style.display = ''; } function hidestatus(name) { document.getElementById(name).style.display = 'none'; document.getElementById(name + '_status').style.display = 'none'; } function preload_images() { if(document.images) { for(var i = 0; i < preload_images.arguments.length; i++) { document.preload[i] = new Image(); document.preload[i].src = preload_images.arguments[i]; } } } ?>
Kod glowny:
<?php <style type="text/css"> body { margin:0px;} body, td, div, p, li { font-family: Tahoma, verdana, arial, helvetica, sans-serif; font-size:11px; color:#000000; } #glowny { position:absolute; top:140px; left:250px;} #swiatynia { position:absolute; } #magazyn {position:absolute; } #mlyn {position:absolute; } #ratusz {position:absolute;} .status { position:absolute; width:140px; min-height:15px; z-index:5; border:1px solid black; background-color:#FFFFFF; opacity: .7; filter: alpha(opacity=70);} #select { position:absolute; width:100%; height:30px; z-index:0; top:0px; left:0px; } #swiatynia_status { top:250px; left:45px; } #magazyn_status { top:300px; left:120px;} #mlyn_status {top:160px; left:270px;} #ratusz_status {top:220px; left:200px;} #swiatynia { top:160px; left:90px; width:60px; height:72px; } #magazyn {top:255px; left:260px; width:60px; height:71px; } #mlyn {top:100px; left:400px;} #ratusz {top:140px; left:250px;} </style> <script src="funkcje.js" type="text/javascript" > </script> </head> <body> <img src="image/wioska/ratusz.gif" id="glowny" /> <div style=" position:absolute;"> <img src="image/wioska/wioska.jpg" width="520" height="381" alt="wioska" border="0" usemap="#wioska"> <map name="wioska"> <area shape="rect" coords="100,160,150,200" href="" alt="" title="Kopalnia Zlota" onmouseover="showstatus('swiatynia');" onmouseout="hidestatus('swiatynia');"> <area shape="rect" coords="300,260,230,300" href="" alt="" title="magazyn" onmouseover="showstatus('magazyn');" onmouseout="hidestatus('magazyn');"> <area shape="rect" coords="400,180,450,130" href="" alt="" title="mlyn" onmouseover="showstatus('mlyn');" onmouseout="hidestatus('mlyn');"> <area shape="rect" coords="250,220,330,160" href="" alt="" title="ratusz" onmouseover="showstatus('ratusz');" onmouseout="hidestatus('ratusz');" > </map> <img src="image/wioska/swiatynia.gif" id="swiatynia" border="0" alt="" style="display:none;" onmouseover="showstatus('swiatynia');" onmouseout="hidestatus('swiatynia');"> <img src="image/wioska/magazyn.gif" id="magazyn" border="0" alt="" style="display:none;" onmouseover="showstatus('magazyn');" onmouseout="hidestatus('magazyn');"> <img src="image/wioska/mlyn.gif" id="mlyn" border="0" alt="" style="display:none;" onmouseover="showstatus('mlyn');" onmouseout="hidestatus('mlyn');"> <img src="image/wioska/ratusz.gif" id="ratusz" border="0" alt="" style="display:none;" onmouseover="showstatus('ratusz');" onmouseout="hidestatus('ratusz');"> <div id="swiatynia_status" class="status" style="display:none;" onmouseover="showstatus('swiatynia');" onmouseout="hidestatus('swiatynia');"> <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr><td align="center"><b>Swiatynia</b></td></tr> <tr><td><b>Poziom:</b> 0</td></tr> <tr> <td> <b>Koszt: </b> </td> </tr> </table> </div> <div id="magazyn_status" class="status" style="display:none;" onmouseover="showstatus('magazyn');" onmouseout="hidestatus('magazyn');"> <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr><td align="center"><b>Magazyn</b></td></tr> <tr><td><b>Poziom:</b> 0</td></tr> <tr> <td> <b>Koszt: </b> </td> </tr> </table> </div> <div id="mlyn_status" class="status" style="display:none;" onmouseover="showstatus('mlyn');" onmouseout="hidestatus('mlyn');"> <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr><td align="center"><b>Mlyn</b></td></tr> <tr><td><b>Poziom:</b> 0</td></tr> <tr> <td> <b>Koszt: </b> </td> </tr> </table> </div> <div id="ratusz_status" class="status" style="display:none;" onmouseover="showstatus('ratusz');" onmouseout="hidestatus('ratusz');"> <table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr><td align="center"><b>Ratusz</b></td></tr> <tr><td><b>Poziom:</b> 0</td></tr> <tr> <td> <b>Koszt: </b> </td> </tr> </table> </div> </div> ?>
Pozbawilem kod wszystkiego co nie jest potrzebne
