// 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,id)
{
   global=labelcommenti;
   var fratello=global.previousSibling;
   if(fratello.nodeName!='DIV')
   {
     httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET", "commenti.php?id="+id, 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 OutputSend()
{
    if(httpObject.readyState == 4)
    { 
	    cancellanodo(document.getElementById('Caricamenti_Commento'));
		alert('Il commento e\' stato inviato con successo!! La sua pubblicazione verra\' autorizzata dall\' amministratore');	
	}
		
}

function Send(oggetto,id_join)
{
   var commento=document.getElementById('commento_campo'+id_join);
   var nome=document.getElementById('nome_campo'+id_join);
   if(commento.value != 'Lascia un commento...')
   {
	  var imm = document.createElement('IMG');
	  imm.setAttribute('src', 'Immagini/preload1.gif'); 
	  imm.setAttribute('id', 'Caricamenti_Commento'); 
	  oggetto.parentNode.appendChild(imm);                         
	  httpObject = getHTTPObject();
      if (httpObject != null) 
      {
        httpObject.open("POST","InviaCommento.php", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
		parametro="nome="+encodeURI(nome.value)+"&commento="+encodeURI(commento.value)+"&id_join="+encodeURI(id_join);
		httpObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		httpObject.send(parametro);
        httpObject.onreadystatechange = OutputSend;
      }
	                     
   }
}

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.php", 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(id)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","SchedaComponente.php?id="+id, 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.php", 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.php", 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.php", 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.php", 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;
     }
	 
}

function vistarivista(anno,numero)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
		var param="VistaRiviste.php?anno="+anno+"&numero="+numero;
        httpObject.open("GET",param,true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function ListaRiv(anno)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaRiviste.php?anno="+anno, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function ListaEdit(anno)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaEditoriale.php?anno="+anno, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function vistaeditoriale(anno,numero)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
		var param="VistaEditoriale.php?anno="+anno+"&numero="+numero;
        httpObject.open("GET",param,true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}
function ArchivioConflitti(pagina)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ArchivioConflitti.php?pagina="+pagina, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function ListaEventi(chiave)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaEventi.php?chiave="+chiave, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function newsletter()
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","newsletter.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}

function Outputinvianewsletter(){
   if(httpObject.readyState == 4)
   {
      NotLoading();
	  var conflitti=document.getElementById('ConflittiQuotidiani');
	  var padre=conflitti.parentNode;
	  padre.innerHTML=httpObject.responseText;
   }
   
}

function invianewsletter(mail)
{

	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","insnewsletter.php?mail="+mail, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputinvianewsletter;
     }
	 
}


function Loading()
{
  var imm=document.getElementById('immageload');
  imm.style.visibility='visible';
}
function NotLoading()
{
  var imm=document.getElementById('immageload');
  imm.style.visibility='hidden';
}


function BiblioLink()
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","bibliolink.html", true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}


function Biblio(pagina)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","Biblio.php?pagina="+pagina, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}


function Link(pagina)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","Link.php?pagina="+pagina, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}


function ListaCineConflitti(anno)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaCineConflitti.php?anno="+anno, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}



function ListaReport(anno)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaReport.php?anno="+anno, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}



function ListaRecensioni(anno)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaRecensioni.php?anno="+anno, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}


function ListaFotoConflitti(id)
{
	 httpObject = getHTTPObject();
     if (httpObject != null) 
     {
        httpObject.open("GET","ListaFotoConflitti.php?pagina="+id, true);
		httpObject.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
        httpObject.send(null);
        httpObject.onreadystatechange = Outputredazione;
     }
	 
}



