ciao ragazzi,
ho visto nei topic di questa sezione ma, purtroppo, non ho trovato niente che mi potesse aiutare a risolvere il mio problema...

In pratica ho una pagina con vari DIV..in uno di questo risiede una mappa dove vi sono vari link (mappata).

Passando il mouse su questi link mi dovrebbe comparire una immagine (situata anche essa in un DIV nascosto) con del testo.

Adesso, questa immagine dovrebbe comparire sopra il link richiesto...quindi passandogli dei valori (coordinate) della pagina..

Il problema è..che lo script che avevo messo su funziona..ma se presente lo scrollbar tali valori si vanno a fare benedire..facendomi vedere l'immagine in una posizione errata..

Qui di seguito vi mostro il codice che avevo messo su...sperando che qualcuno mi possa dare una mano a risolvere il mio problema:

codice:
var agt=navigator.userAgent.toLowerCase(); 

    // *** BROWSER VERSION *** 
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
    var is_major = parseInt(navigator.appVersion); 
    var is_minor = parseFloat(navigator.appVersion); 

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection. 
    // If you want to allow spoofing, take out the tests for opera and webtv. 
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1)); 
    var is_nav2 = (is_nav && (is_major == 2)); 
    var is_nav3 = (is_nav && (is_major == 3)); 
    var is_nav4 = (is_nav && (is_major == 4)); 
    var is_nav4up = (is_nav && (is_major >= 4)); 
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || 
                          (agt.indexOf("; nav") != -1)) ); 
    var is_nav5 = (is_nav && (is_major == 5)); 
    var is_nav5up = (is_nav && (is_major >= 5)); 

    var is_ie   = (agt.indexOf("msie") != -1); 
    var is_ie3  = (is_ie && (is_major < 4)); 
    var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
    var is_ie4up  = (is_ie  && (is_major >= 4)); 
    var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
    var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
    var is_firefox = (agt.indexOf("firefox") != -1);
    var is_opera = (agt.indexOf("opera") != -1); 
    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_mac    = (agt.indexOf("mac")!=-1);

var rest_width;
var punt_width;
var diff_punti_x;
var diff_punti_y;

if (is_nav) {rest_width="26"; punt_width="2"};
if (is_ie) {rest_width="50"; punt_width="4";};
if (is_opera) {rest_width="52"; punt_width="6";};

var ref1, ref2, winref;
winref = 'window.self.';
window.moveTo(0,0);
window.focus();

if (is_ie4up){					//Explorer 4, 5, 5.5
ref1 = 'document.all[\'';
ref2 = '\'].style';
}
else {
if (document.getElementById){			//Netscape 6
      ref1 = 'document.getElementById(\'';
      ref2 = '\').style'}
      else {if (is_nav){			//Netscape 4
           ref1 = 'document.layers[\'';
           ref2 = '\']';
           }
      }
}


function ShowPoint(x,y,text){
  todo=eval(winref + ref1 + 'punto' + ref2);
  todo.visibility="visible";

diff_punti_x = x;
diff_punti_y = y;

	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	var leftPos = diff_punti_x;
	obj.style.left = leftPos + 'px';
	obj.style.top = diff_punti_y + st + 'px';
}



function HidePoint(){
todo=eval(winref + ref1 + 'punto' + ref2);
todo.visibility="hidden";
}
questo è il codice che mi dovrebbe far comparire l'immagine nascosta, dopo avergli passato le coordinate.

...e questo è il codice dove indico i div...quella della mappa e quello dove risiede l'immagine nascosta che compare quando richiesto:

codice:
<div id="contenitore">
..
..
..
..
<div id="mappa_home">

[img]img/mappa.png[/img]
<map name="mappa">
<area shape="rect" coords="61,160,80,178" href="#" target="_self" alt="Record 1" onmousemove="ShowPoint(-10,50,'Record 1');" onmouseout="HidePoint();">

<area shape="rect" coords="207,219,222,237" href="#" target="_self" alt="Record 2" onmousemove="ShowPoint(62,80,'Record 2');" onmouseout="HidePoint();">

<area shape="rect" coords="190,130,210,156" href="#" target="_self" alt="Record 3" onmousemove="ShowPoint(55,35,'Record 3');" onmouseout="HidePoint();">
</map>


<DIV id="punto" style="position:absolute; width:147px; height:60px; z-index:4; margin-left: 0px; margin-top: 0px; visibility: hidden;">
<div id="bubble_tooltip">
<div class="bubble_top"><span></span></div>
<div class="bubble_middle"><span id="bubble_tooltip_content">Contenuto del div.</span></div>
<div class="bubble_bottom"></div>
</div>
</DIV>


</div>

...
...
...
...
</div>