//alert("ciao");
var browser = -1; //Settata dalla funzione revealerBrowser()
//alert("ciao");
//alert(revealerBrowser()+ " value: "+browser);


//onmouseover="overServiceLi(this)" onmouseout="outServiceLi(this)"
function outServiceA(){	
	if(document.getElementById){
   		var box = document.getElementById("description");
   		setStyle( box, cssClass.visible, null );
		setStyle(box, cssClass.unvisible, null);
	}
}


//onmouseover="alertCoord(arguments[0]);

/*if( document.captureEvents && Event.MOUSEMOVE ) {
  //remove this part if you do not need Netscape 4 to work
  document.captureEvents( Event.MOUSEMOVE );
}
document.onmousemove = alertCoord;*/

function alertCoord(e, textString) {
//alert(e);
  if( !e ) {
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return;
    }
  }
  if( typeof( e.pageX ) == 'number' ) {
    //most browsers
    var xcoord = e.pageX;
    var ycoord = e.pageY;
  } else if( typeof( e.clientX ) == 'number' ) {
    //Internet Explorer and older browsers
    //other browsers provide this, but follow the pageX/Y branch
    var xcoord = e.clientX;
    var ycoord = e.clientY;
    var badOldBrowser = ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
     ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
     ( navigator.vendor == 'KDE' );
    if( !badOldBrowser ) {
      if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //IE 4, 5 & 6 (in non-standards compliant mode)
        xcoord += document.body.scrollLeft;
        ycoord += document.body.scrollTop;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE 6 (in standards compliant mode)
        xcoord += document.documentElement.scrollLeft;
        ycoord += document.documentElement.scrollTop;
      }
    }
  } else {
    //total failure, we have no way of obtaining the mouse coordinates
    return;
  }
   //alert('Mouse coordinates are ('+xcoord+','+ycoord+')');
   if(document.getElementById){
	var box = document.getElementById("description");
	setStyle( box, cssClass.visible, null );
	var pos = ycoord -255;
	box.style.top = pos+"px";
	box.style.position = "relative";	
	box.innerHTML = /*" Mouse coordinates are ("+xcoord+","+ycoord+") <br/>"+*/textString;
	
   }	
}


function composed( evento, obi, textString){
	//alert(evento);
	if (!evento) evento = window.event;
	if(textString.length >0) {
		textString="<h2>Commenti</h2><p>"+textString+"</p>";
		//alert("ciao composed    "+ textString);	
		if( obi.captureEvents && Event.MOUSEMOVE ) {
			//remove this part if you do not need Netscape 4 to work
			obi.captureEvents( Event.MOUSEMOVE );
			}
		obi.onmousemove = alertCoord(evento, textString);
	}
}


function revealerBrowser(){ //Rileva e restituisce una stringa che identifica l'user agent	
	if(navigator.userAgent.indexOf("Opera")!= -1){
		browser = 3;
		return "Browser: Opera";
		}
	else if (navigator.userAgent.indexOf("Firefox")!= -1){
		browser = 2;
		return "Browser: Mozilla Firefox";
		}
	else if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1){
		var pre = "MSIE ";	
    	var __ttest1 = navigator.appVersion.indexOf(pre)+pre.length;
    	var __test2 = __ttest1 +3;
		var version = navigator.appVersion.substring(__ttest1, __test2);
		switch(version){
			case '6.0': browser = 1; return "Browser: "+navigator.appName +" "+version ;
			case '7.0': browser = 4; return "Browser: "+navigator.appName +" "+version ;
			}//end switch
		}
	
	browser = 0;
	return "Browser: Non riconosciuto ;(";
}