function showhide(layer,mode){
	if(mode<'1')
	   document.getElementById(layer).style.display='none';
	else
	   document.getElementById(layer).style.display='block';
	}
function closelayer(){
	
	}
nom='';
function Timer(tempo,nome){
nom=nome;
setTimeout("Scompari()",tempo);
}
function Scompari(){
oggetto= document.getElementById(nom);
oggetto.style.display="none";
}
function Timer2(tempo,nome){
nom=nome;
setTimeout("Scompari2()",tempo);
}
function Scompari2(nom){
oggetto= document.getElementById(nom);
oggetto.style.visibility="hidden";
}
function show1(layer,varr){
 var helloWorld = new ajaxObject(layer, 'tables.php');
 helloWorld.update(varr); 
  }
function ajaxObject(layer,url){
function whenLoading(layer){
	var e = document.getElementById(layer+'replaceme'); 
	e.innerHTML = "<p><font color=white>Sending Data...</font></p>";
}

function whenLoaded(layer){
	var e = document.getElementById(layer+'replaceme'); 
	e.innerHTML = "<p><font color=white>Data Sent...</font></p>";
}

function whenInteractive(layer){
	var e = document.getElementById(layer+'replaceme'); 
	e.innerHTML = "<p><font color=white>getting data...</font></p>";
}
var ie4=document.all
var ns6=document.getElementById&&!document.all
var IE = document.all?true:false
var mouseX = 0
var mouseY = 0
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
	function getMouseXY(e) {
  if (IE) { 
    mouseX = event.clientX + document.body.scrollLeft
    mouseY = event.clientY + document.body.scrollTop
  } else {  
    mouseX = e.pageX
    mouseY = e.pageY
  }  
  if (mouseX < 0){mouseX = 590}
  if (mouseY < 0){mouseY = 101}
  mouseY=mouseY;
  mouseX=mouseX-53;
  return mouseX;
  return mouseY;}
 var that=this;                                                   
   var updating = false;                                             
   this.callback = function() {}                                     

   this.update = function(passData) {                                // Initiates the server call.
      if (updating==true) { return false; }                          // Abort if we're already processing a call.
      updating=true;                                                 // Set the updating flag.
      var AJAX = null;                                               // Initialize the AJAX variable.
      if (window.XMLHttpRequest) {                                   // Are we working with mozilla?
         AJAX=new XMLHttpRequest();                                  //  Yes -- this is mozilla.
      } else {                                                       // Not Mozilla, must be IE
         AJAX=new ActiveXObject("Microsoft.XMLHTTP");                //  Wheee, ActiveX, how do we format c: again?
      }                                                              // End setup Ajax.
      if (AJAX==null) {                                              // If we couldn't initialize Ajax...
         alert("Your browser doesn't support AJAX.");                // Sorry msg.						
         return false                                                // Return false (WARNING - SAME AS ALREADY PROCESSING!)
      } else {
      
	AJAX.onreadystatechange = function() {
	//document.getElementById(layer+'replaceme').style.display='block';
//disattivata perchè mi causa problemi di compatibilità pur essendo molto utile//
//	switch (AJAX.readyState) {
//		case 1:
//		    var e = document.getElementById(layer+'replaceme'); 
//	        e.innerHTML = "<table style='width:150;' bgcolor=#000000 class='tab text'><tr><td><p><font color=red>Sending data...</font></p></td></tr></table>";
//		break;
//		case 2:
//			var e = document.getElementById(layer+'replaceme'); 
//	        e.innerHTML = "<table style='width:150;' bgcolor=#000000 class='tab text'><tr><td><p><font color=red>Data sent...</font></p></td></tr></table>";
//		break;
//		case 3:
//			var e = document.getElementById(layer+'replaceme'); 
//	        e.innerHTML = "<table style='width:150;' bgcolor=#000000 class='tab text'><tr><td><p><font color=red>Loading...</font></p></td></tr></table>";
//		break;
//	}
			
			if (AJAX.readyState==4 || AJAX.readyState=="complete") { //   see if the complete flag is set.
			   
			   LayerID.innerHTML=AJAX.responseText; 
			   showTipBox(layer,'img'+layer); 
			   linkTimer();
               delete AJAX;                                          
               updating=false;                                       
               that.callback();                                     
            //document.getElementById(layer+'replaceme').style.display='none';
			}                                                        
         }                                                           
         var timestamp = new Date(); 
		                                 // Get a new date (this will make the url unique)
         var uri='tables.php?zlayer='+layer+'&mouseX='+mouseX+'&mouseY='+mouseY+'&'+passData+'×tamp='+(timestamp*1);   // Append date to url (so the browser doesn't cache the call)
         AJAX.open("POST", uri, true);                                // Open the url this object was set-up with.
         AJAX.send(null);                                            // Send the request.
         return true;                                                // Everything went a-ok.
      }                                                              // End Ajax setup aok if/else block                 
   }
      
   // This area set up on constructor calls.
   var LayerID = document.getElementById(layer);                     // Remember the layer associated with this object.
   var urlCall = url;                                                // Remember the url associated with this object.
}       
function showTipBox(layerName,imgName){

 img = getImage(imgName);
 TipBoxTop = getImagePageTop(img); // TIP BOX TOP POSITION
 TipBoxLeft =  getImagePageLeft(img); // TIP BOX LEFT POSITION
if (NS4 || IE4) {
 if (timeOn != null) {
 clearTimeout(timeOn) 
 hideLayer(onLayer)
 }
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+TipBoxTop+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+TipBoxLeft+'"');
 } 
 onLayer = layerName
 }
}

 window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null // LAYER SWITCHING CODE
if (NS4 || IE4) {
 if (navigator.appName == "Netscape"){
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
layerVis="show";
layerHid="hide";
 }else
{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";
layerVis="visible";
layerHid="hidden";
 }
}// HIDE MENU
function hideLayer1(layerName){
 if (menuActive == 0) {
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 }
}
function hideLayer(layerName){
 if (menuActive == 0) {
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 }
}// TIMER FOR TIP BOX MOUSE OUT
function linkTimer() {
 timeOn = setTimeout("btnOut()",3000)
}// MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}// GET IMAGE 
function getImage(name) {
  if (NS4) {
    return findImage(name, document);
  }
  if (IE4)
    return eval('document.all.' + name);
  return null;
}
function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;
  if (NS4) {
    if (img.container != null)
      return img.container.pageX + img.x;
    else
      return img.x;
  }
  if (IE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if (NS4) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}
function getPage(page,layer,url){
	document.getElementById('cilento').style.display="none";
	document.getElementById('palinuro').style.display="none";
	document.getElementById('velia').style.display="none";
	document.getElementById('paestum').style.display="none";
	document.getElementById('grotte').style.display="none";
	document.getElementById('castelcivita').style.display="none";
	document.getElementById('padula').style.display="none";
	document.getElementById('morigerati').style.display="none";
	document.getElementById('marina').style.display="none";
	document.getElementById('borgo').style.display="none";
	document.getElementById(layer).style.display="block";
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x objectÃ¢â‚¬Â¦
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
        var file = url; //This is the path to the file we just finished making *
    xmlhttp.open('POST', file + page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **

xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
				
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById(layer).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest

return;
}
// -->