var  opera = (window.opera); // Opera 5+
var    NS4 = (document.layers) ? 1 : 0;
var    IE4 = (document.all) ? 1 : 0;
var    NS6 = (document.getElementById && !document.all && !this.opera); // Netscape 6+
var   ver4 = (NS4 || IE4) ? 1 : 0;
var   ver5 = (document.getElementById) ? 1 : 0;
var  isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;
var isMenu = (NS4 || IE4) ? 1 : 0;

function showHit(e) {

  // Offsetit
  x = 10;
  y = 5;

	if ( NS6 ) {
		cw = document.getElementById('osuma').offsetWidth;
		ch = document.getElementById('osuma').offsetHeight;
		
		if ((e.pageX + x+15 + cw) > (window.pageXOffset + window.innerWidth)){
        x = e.pageX + 0 - e.pageX + window.pageXOffset + window.innerWidth - cw - 15;
    } else {
	  		x = x + e.pageX;		
		}     		 
    if ((e.pageY + y+10 + ch) > (window.pageYOffset + window.innerHeight)){
        y = e.pageY + 0 - e.pageY + window.pageYOffset + window.innerHeight - ch - 15;
    } else {
				y = y + e.pageY;
		}
    			 
    document.getElementById('osuma').style.left = x;
    document.getElementById('osuma').style.top =y ;
    document.getElementById('osuma').style.visibility = 'visible';
		
	} else if ( NS4 ) { // document.layers && document.layers['osuma']) {
    //Netscape
		
    if ((e.x + x+15 + document.layers['osuma'].clip.width) > (window.pageXOffset + window.innerWidth)){
        x = 0 - e.x + window.pageXOffset + window.innerWidth - document.layers['osuma'].clip.width - 15;
    } 
     
    if ((e.y + y+10 + document.layers['osuma'].clip.height) > (window.pageYOffset + window.innerHeight)){
        y = 0 - e.y + window.pageYOffset + window.innerHeight - document.layers['osuma'].clip.height - 15;
    }
    			 
    document.layers['osuma'].left = e.x + x;
    document.layers['osuma'].top = e.y + y;
    document.layers['osuma'].visibility = 'visible';
    
  } else if (document.all) {
    //MSIE   
    
    if ( ver5 ) {
       if ((window.event.x + x +  document.all['osuma'].offsetWidth) > (document.body.clientWidth + document.body.scrollLeft)){
         px = (document.body.clientWidth + document.body.scrollLeft) - document.all['osuma'].offsetWidth - x;
       } else {
         px = window.event.x + x;
       }
       px =  px + document.body.scrollLeft;
    } else {
       if ( (window.event.x + x + document.all['osuma'].clientWidth) > (document.body.clientWidth + document.body.scrollLeft) ) {
       	  px = document.body.clientWidth + document.body.scrollLeft - document.all['osuma'].clientWidth;
       } else {
          px = window.event.x;
       }
    }

    if ( ver5 ) {
       if ((window.event.y + y + document.all['osuma'].offsetHeight) > (document.body.clientHeight + document.body.scrollTop)){
          py = (document.body.clientHeight + document.body.scrollTop) - document.all['osuma'].offsetHeight - y;
       } else {
          py = window.event.y + y;
       }
       py = py   + document.body.scrollTop;
    } else {
       if ((window.event.y + y + document.all['osuma'].clientHeight) > (document.body.clientHeight + document.body.scrollTop)){
          py = (document.body.clientHeight + document.body.scrollTop) - document.all['osuma'].clientHeight - y;
       } else {
          py = window.event.y + y;
       }
    }
        
    document.all['osuma'].style.posLeft = px;
    document.all['osuma'].style.posTop = py;
    document.all['osuma'].style.visibility = 'visible';
    
  }    	
}

function hideHit() {
	if ( NS6 ) {
	    document.getElementById('osuma').style.visibility = 'hidden';
	} else if (document.layers && document.layers['osuma']) {
    document.layers['osuma'].visibility = 'hidden';
  } else if (document.all ) {
    document.all['osuma'].style.visibility = 'hidden';
  }
}

