// JavaScript Document
var global;
function getHTTPObject(){
   if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
   else if (window.XMLHttpRequest) return new XMLHttpRequest();
   else {
      alert("Your browser does not support AJAX.");
      return null;
   }
}   
function CaricaCommenti(labelcommenti)
{
   global=labelcommenti;
   var fratello=global.previousSibling;
   if(fratello.nodeName!='DIV')
   {
     httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET", "commenti.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = setOutput;
     }
   }
   else
   {
	   cancellanodo(fratello);
   }
}

// Change the value of the outputText field
function setOutput(){
   if(httpObject.readyState == 4)
   { 
       var padre;
	   var g;
	   g=global;
	   padre=global.parentNode;
	   var div = document.createElement('DIV');
	   var imm = document.createElement('IMG');
	   imm.setAttribute('src', 'Immagini/preload1.gif'); 
	   padre.insertBefore(div,global);
	   padre.insertBefore(imm,div);
       div.innerHTML = httpObject.responseText;
	   cancellanodo(imm);
   }
}
function cancellanodo(nodo)
{
	var padre=nodo.parentNode;
	padre.removeChild(nodo);
}
function Reset(oggetto)
{
	oggetto.value='';
}
function Controlla(oggetto)
{
	if(oggetto.value == '' && oggetto.name == 'nome')
	{
	   oggetto.value='Anonymous...';
	}
	if(oggetto.value == '' && oggetto.name == 'commento')
	{
	   oggetto.value='Lascia un commento...';
	}
}
/*
function Send(oggetto)
{
   var commento=oggetto.parentNode.parentNode.previousSibling.previousSibling.childNodes[0].childNodes[0];
   var nome=oggetto.parentNode.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.childNodes[0].childNodes[0];
   if(commento.value != 'Lascia un commento...')
   {
	  var imm = document.createElement('IMG');
	  imm.setAttribute('src', 'Immagini/preload1.gif'); 
	  oggetto.parentNode.appendChild(imm); 
	  alert('Con AJAX inviare a uno scriot php');
   }
}

function Outputeditoriale(){
   if(httpObject.readyState == 4)
   {
      var conflitti=document.getElementById('ConflittiQuotidiani');
	  var padre=conflitti.parentNode;
	  conflitti.parentNode.removeChild(conflitti);
	  padre.innerHTML=httpObject.responseText;
   }
}
function editoriale()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","editoriale.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputeditoriale;
     }
	 
}
function Outputpdo(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function pdo()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","pianodellopera.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputpdo;
     }
	 
}
function Outputabbonamenti(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function abbonamenti()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","abbonamenti.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputabbonamenti;
     }
	 
}

function Outputcontatti(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function contatti()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","contatti.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputcontatti;
     }
	 
}

function Outputedizionilabrys(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function edizionilabrys()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","edizionilabrys.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputedizionilabrys;
     }
	 
}


function Outputdirettore(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function direttore()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","direttore.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputdirettore;
     }
	 
}

function Outputcomitatoscientifico(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function comitatoscientifico()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","comitatoscientifico.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputcomitatoscientifico;
     }
	 
}


function Outputredazione(){
   if(httpObject.readyState == 4)
   {
      var cont=document.getElementById('Cont');
	  while(cont.hasChildNodes())
	  {
		  cont.removeChild(cont.firstChild);
	  }
	  cont.innerHTML=httpObject.responseText;
   }
}
function redazione()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","redazione.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function comepubblicare()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","comepubblicare.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function AIC()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","AIC.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function IERC()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","IERC.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function networkaic()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","networkaic.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

*/


