function xdom()
{
if (window.XMLHttpRequest)
  {
   var xhttp=new XMLHttpRequest();
  }
else
  {
   var xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return xhttp;
}


function menu_ho(colors,zcolors,id)
{

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/homepage.xml", true);
xhttp.setRequestHeader("Content-Type", "text/xml");


xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

     if(xhttp.status === "OK")
          // operazione avvenuta con successo
          document.getElementById("homeless").innerHTML=xhttp.responseText;

        else {
          // errore di caricamento
          document.getElementById("homeless").innerHTML = "Impossibile effettuare l'operazione richiesta.<br />";
          document.getElementById("homeless").innerHTML += "Errore riscontrato: " + xhttp.status;
        }




	var docxml = xhttp.responseXML;

	    //alert(xhttp.responseXML);
		try
		{
		//alert(xhttp.responseXML.getElementById("homeless")[0].childNodes[0].nodeValue);
	    }
		catch(e)
		{
		//alert(e);
		}
		//alert(xhttp.responseText);

	if(xhttp.status == 200) {

    if (xhttp.responseXML) {

        var xmldoc=xhttp.responseXML;

        //alert(xmldoc.nodeType);
		//alert(xmldoc.nodeName);


		//alert(xmldoc.root);


		//document.getElementById("homeless").childNodes[0].nodeValue=node.nodeType;


		//items=xmldoc.getElementsByTagName("homeless");
        //items=xmldoc.getElementById('homeless').firstChild.nodeValue;

		//alert(items.length);



	}
   }
  }

}

xhttp.send();



elem = document.getElementById("home");

elem.style.color = colors;

headtitle_ho();

}


function menu_as3(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/associazione3.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("ascz");

elem.style.color = colors;


//ascz


}


function menu_as2(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/associazione2.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("ascz");

elem.style.color = colors;


//ascz


}


function menu_as1(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/associazione1.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("ascz");

elem.style.color = colors;


//ascz


}



function menu_as(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/associazione.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("ascz");

elem.style.color = colors;


//ascz

headtitle_as();

}


function menu_or(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/organizzazione.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("organ");

elem.style.color = colors;


//ascz

headtitle_or();

}

function menu_or1(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/organizzazione1.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("organ");

elem.style.color = colors;


//ascz


}

function menu_or2(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/organizzazione2.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("organ");

elem.style.color = colors;


//ascz


}


function headtitle_as()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/associazione.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Associazione";


//ascz


}


function headtitle_or()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/organizzazione.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Organizzazione";


//ascz


}


function headtitle_ho()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/homepage.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Benvenuti Nel Sito Del CMG Italia";


//ascz


}


function menu_ca(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/comeassociarsi.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cass");

elem.style.color = colors;


//ascz

headtitle_ca();

}

function headtitle_ca()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/comeassociarsi.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Come Associarsi";


//ascz


}



function menu_co(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/contatti.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cont");

elem.style.color = colors;


//ascz

headtitle_co();

}

function headtitle_co()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/contatti.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Contatti";


//ascz


}

/////////////////////LDP
function menu_ldp(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/ldp.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("ldp");

elem.style.color = colors;


//ascz

headtitle_ldp();

}

function headtitle_ldp()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/ldp.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "News";


//ascz


}
////////////////////




/////////////////////CMVT
function menu_cmvt(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/cmvt.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cmvt");

elem.style.color = colors;


//ascz

headtitle_cmvt();

}



function menu_cmvti(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/iscrizione.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cmvt");

elem.style.color = colors;


//ascz


}


function menu_cacei(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/iscrizionexxivcmg.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cace");

elem.style.color = colors;


//ascz


}




function menu_caceiban(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/iscrizionexxivcmg.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cace");

elem.style.color = colors;


elemib = document.getElementById("headtitle");

elemib.innerHTML = "Eventi CMG-Italia nel 2010";



//headtitle_cace();

//ascz


}



function menu_cmvtsend(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("POST", "http://www.epvtech.com/script/iscrizione.php", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cmvt");

elem.style.color = colors;


//ascz


}

function menu_cmvtok(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/iscrizioneok.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cmvt");

elem.style.color = colors;


//ascz


}


function headtitle_cmvt()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/cmvt.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Eventi CMG-Italia nel 2010";


//ascz


}
////////////////////




/////////////////////CACE
function menu_cace(colors,zcolors,id)
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/cace.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("cace");

elem.style.color = colors;


//ascz

headtitle_cace();

}

function headtitle_cace()
{

//par();

var xhttp = xdom();

xhttp.open("GET", "http://www.cmgitalia.it/xml/cace.xml", true);

xhttp.onreadystatechange = function() {

	if (xhttp.readyState == 4) {

		document.getElementById("homeless").innerHTML=xhttp.responseText;

	}

}

xhttp.send(null);

elem = document.getElementById("headtitle");

elem.innerHTML = "Eventi CMG-Italia nel 2010";


//ascz


}
////////////////////

function rcolor(zcolorsa,ids)
{

if (ids == this.ids)
{

}
else
{
 document.getElementsByTagName('A').item(ids).style.color=zcolorsa;
}

}


function ridef(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

rcolor(clr,idt);

}

function ridefomo(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

}

function ridefomou(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

}

function refonc(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

}

function boldchange(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

//rcolor(clr,idt);

}

function boldchangeup(idt,clr)
{

elem = document.getElementById(idt);

elem.style.color = clr;

//rcolor(clr,idt);

}


function par()
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")

xmlDoc.async="false";

xmlDoc.load("associazione.xml");

var par=xmlDoc.getElementsByTagName('homeless')[0].childNodes[0].nodeValue;

document.getElementById("homeless").innerText=par;

}


function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}



function load(uri)
{
//alert(uri);
return(uri);

}





function fmck() {
     // Variabili associate ai campi del modulo
     var nome = document.iscrizione.nome.value;
     var cognome = document.iscrizione.cognome.value;
     var azienda = document.iscrizione.azienda.value;
     var evento = document.iscrizione.evento.value;
     var email = document.iscrizione.email.value;

	 // Espressione regolare dell'email
     var emailre = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Il campo Nome è obbligatorio.");
           document.iscrizione.nome.focus();
           return false;
        }

        //Effettua il controllo sul campo COGNOME
        else if ((cognome == "") || (cognome == "undefined")) {
           alert("Il campo Cognome è obbligatorio.");
           document.iscrizione.cognome.focus();
           return false;
        }

        //Effettua il controllo sul campo AZIENDA
        else if ((azienda == "") || (azienda == "undefined")) {
           alert("Il campo Azienda è obbligatorio.");
           document.iscrizione.azienda.focus();
           return false;
        }

       //Effettua il controllo sul campo EVENTO || (evento.indexOf("Inserisci l'evento!") != (-1))
        else if ((evento == "") || (evento == "undefined")) {
           alert("Il campo Evento è obbligatorio");
           document.iscrizione.evento.focus();
           return false;
        }

        else if (!emailre.test(email) || (email == "") || (email == "undefined")) {
           alert("Inserire un indirizzo email corretto.");
           document.iscrizione.email.select();
           return false;
        }

        //INVIA IL MODULO
        else {
           document.iscrizione.action = "http://www.epvtech.com/script/iscrizione.php";
           document.iscrizione.submit();
        }
  }
