 function apriDettagliScheda(name) {
	//	setCookie("scheda",name,1);
   	// 	Mediabox.open('schedaNegozio.php', 'title', '550 323');
   var w = 565;
   var h = 385;
   var l = Math.floor((screen.width-w)/2);
   var t = Math.floor((screen.height-h)/2);
      window.open("schedaNegozio.php?tipo=" + name,"","scrollbars=1,resizable=false,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);

	}
	
	function checkcodice(field) 
{

   codice = document.getElementById("categoria1q").value;
   if (codice.length < 13) 
  {
    alert('Attenzione! La lunghezza del codice deve essere di 13 cifre')
  return false;
  } 
}

function verifica_form_utente() {

		 
		 email = document.getElementById("contatto").value;
		 		
		 nome = document.getElementById("nome").value;

		 cognome = document.getElementById("cognome").value;
		privacy2= document.getElementById('privacy2').checked
		 
		
		 if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto').focus();
					return false;
				
				}	
				
		 		if (nome=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('nome').focus();
					return false;
				
				}
				if (cognome=='') {
					alert('Attenzione! Inserire il cognome');
					document.getElementById('cognome').focus();
					return false;
				
				}
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2').focus();
					return false;
				
				}
				
}			

function verifica_form_recupera() {

		 
		 email = document.getElementById("contatto").value;
		 		
		
		 if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					return false;
				
				}	
				
		 		
				
}		

function verifica_form_lavora() {

		 
		 email = document.getElementById("contatto").value;
		 		
		 nome = document.getElementById("nome").value;

		 cognome = document.getElementById("cognome").value;
		 cell = document.getElementById("cell").value;
		  richiesta = document.getElementById("richiesta").value;
		privacy2= document.getElementById('privacy2').checked
		 
		
		 if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto').focus();
					return false;
				
				}	
				
		 		if (nome=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('nome').focus();
					return false;
				
				}
				if (cognome=='') {
					alert('Attenzione! Inserire il cognome');
					document.getElementById('cognome').focus();
					return false;
				
				}
				if (cell=='') {
					alert('Attenzione! Inserire il numero di cellulare');
					document.getElementById('cell').focus();
					return false;
				
				}
				if (richiesta=='') {
					alert('Attenzione! Inserire le esperienze lavorative');
					document.getElementById('richiesta').focus();
					return false;
				
				}	
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2').focus();
					return false;
				
				}
				
}		
function verifica_form_newsletter() {

		 
		 email = document.getElementById("contatto").value;
		 		
		 nome = document.getElementById("nome").value;

		 cognome = document.getElementById("cognome").value;
		
privacy2= document.getElementById('privacy2').checked
		 
		
		 
				
		 		if (nome=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('nome').focus();
					return false;
				
				}
				if (cognome=='') {
					alert('Attenzione! Inserire il cognome');
					document.getElementById('cognome').focus();
					return false;
				
				}
				if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto').focus();
					return false;
				
				}	
				
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2').focus();
					return false;
				
				}
}

function cancella_form_newsletter() {

		 
		 email = document.getElementById("new2").value;
		 		

		 
				
				if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('new2').focus();
					return false;
				
				}	
			
}

function verifica_form_contatti() {

		 
		 email = document.getElementById("contatto").value;
		 		
		 nome = document.getElementById("nome").value;
		cell = document.getElementById("cell").value;
		 cognome = document.getElementById("cognome").value;
		 richiesta = document.getElementById("richiesta").value;
privacy2= document.getElementById('privacy2').checked
		 
		
		 
				
		 		if (nome=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('nome').focus();
					return false;
				
				}
				if (cognome=='') {
					alert('Attenzione! Inserire il cognome');
					document.getElementById('cognome').focus();
					return false;
				
				}
				if (cell=='') {
					alert('Attenzione! Inserire il telefono mobile');
					document.getElementById('cell').focus();
					return false;
				
				}	
				if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto').focus();
					return false;
				
				}	
				if (richiesta=='') {
					alert('Attenzione! Inserire la richiesta');
					document.getElementById('richiesta').focus();
					return false;
				
				}	
				
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2').focus();
					return false;
				
				}
}


function verifica_form_spazi() {

		 
		 email = document.getElementById("contatto").value;
		 		
		 Azienda = document.getElementById("Azienda").value;
		 
		 CAP = document.getElementById("CAP").value;
		 Telefono = document.getElementById("Telefono").value;
		 Fax = document.getElementById("Fax").value;
		 
		 Referente = document.getElementById("Referente").value;
		 
		 Attivit = document.getElementById("Attivit").value;
		 
		 Categoria = document.getElementById("Categoria").value;

		 Indirizzo = document.getElementById("Indirizzo").value;
		 richiesta = document.getElementById("richiesta").value;
privacy2= document.getElementById('privacy2').checked;
	 
				
		 		if (Azienda=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('Azienda').focus();
					return false;
				
				}
				if (Indirizzo=='') {
					alert('Attenzione! Inserire l\'indirizzo');
					document.getElementById('Indirizzo').focus();
					return false;
				
				}
				if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto').focus();
					return false;
				
				}	
					if (CAP=='') {
					alert('Attenzione! Inserire il Cap');
					document.getElementById('CAP').focus();
					return false;
				
				}	
				
				if (Referente=='') {
					alert('Attenzione! Inserire il Referente');
					document.getElementById('Referente').focus();
					return false;
				
				}	
				if (Telefono=='') {
					alert('Attenzione! Inserire il Telefono');
					document.getElementById('Telefono').focus();
					return false;
				
				}	
				
				
				if (Fax=='') {
					alert('Attenzione! Inserire il Fax');
					document.getElementById('Fax').focus();
					return false;
				
				}	
				if (Attivit=='') {
					alert('Attenzione! Inserire l\'attivita');
					document.getElementById('Attivit').focus();
					return false;
				
				}	
				if (Categoria=='') {
					alert('Attenzione! Inserire la Categoria');
					document.getElementById('Categoria').focus();
					return false;
				
				}	
				if (richiesta=='') {
					alert('Attenzione! Inserire la richiesta');
					document.getElementById('richiesta').focus();
					return false;
				
				}	
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2').focus();
					return false;
				
				}
}


function verifica_form_notizie() {

		 
		 titolo = document.getElementById("titolo").value;
		 		
		 testo = document.getElementById("testo").value;


		 		if (titolo=='') {
					alert('Attenzione! Inserire il titolo');
					document.getElementById('titolo').focus();
					return false;
				
				}
				if (testo=='') {
					alert('Attenzione! Inserire il testo');
					document.getElementById('testo').focus();
					return false;
				
				
}			
}

function verifica_form_offerta() {

		 
		 titolo = document.getElementById("titolo").value;
		 		
		 codice = document.getElementById("codice").value;
		 
		  confezione = document.getElementById("confezione").value;
		 		
		 prezzo = document.getElementById("prezzo").value;


		 		if (titolo=='') {
					alert('Attenzione! Inserire il titolo');
					document.getElementById('titolo').focus();
					return false;
				
				}
				if (codice=='') {
					alert('Attenzione! Inserire il codice');
					document.getElementById('codice').focus();
					return false;
					}
					if (confezione=='') {
					alert('Attenzione! Inserire il tipo di confezione');
					document.getElementById('confezione').focus();
					return false;
				
				}
				if (prezzo=='') {
					alert('Attenzione! Inserire il prezzo');
					document.getElementById('prezzo').focus();
					return false;
				
				
}			
}

			
function verifica_form_accesso() {

		 
		 user = document.getElementById("nome_utente").value;
		 		
		 pass = document.getElementById("password").value;


		 		if (user=='') {
					alert('Attenzione! Inserire l\'username');
					document.getElementById('nome_utente').focus();
					return false;
				
				}
				if (pass=='') {
					alert('Attenzione! Inserire la password');
					document.getElementById('password').focus();
					return false;
				
				
}			
}

// controlla se un campo contiene solo numeri
function controllaCampoIntero(field){
	var err1 = 'Attenzione! Inserire solo numeri nei campi richiesti';
	if ((field.value) == '') {
		//field.focus();
		return false;
	}

	RE = /^\d*$/
  if (!RE.test(field.value)){ 
    alert('inserire un numero intero nel campo'); 
    field.value=""; 
    field.focus;
    return false; 
  } 
else {
		field.value = field.value;
		return true;
	}
}


//controllo email
var good;

function checkEmailAddress(field) 
{
  var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (field.value != '')
  {
  if (goodEmail)
  {
    good = true
  } 
  else 
  {
    alert('Inserisci un indirizzo e-mail valido.')
	field.focus();
    good = false
  }
  }
}

function sendOff()
{
  nmcheck = document.TheForm.nm.value 
  if (nmcheck.length < 1) 
  {
    alert('Please enter your name.')
  return
  } 
  good = false
  checkEmailAddress(document.TheForm.em)
  if ((document.TheForm.em.value == document.TheForm.emx.value) && (good))
  {
    alert('Name and email address fields verified good.')
  } 
  if ((document.TheForm.em.value != document.TheForm.emx.value) && (good))
  {
    alert('Both e-mail address entries must match.')
  }
}


function testo(field)
{
var espressione = /^\./;
var espressione2 = /^\_/;
var espressione3 = /\.$/;
var espressione4 = /\_$/;
var espressione5 = /[ ]/;

if (espressione.test(field.value) || espressione2.test(field.value) || espressione3.test(field.value) || espressione4.test(field.value) || espressione5.test(field.value))
{
    alert("Attenzione! Inserire un username valido.");
    field.focus();
    uno.style.color = "black";
					due.style.color = "black";
					tre.style.color = "black";
					quattro.style.color = "black";
					cinque.style.color = "black";
					sei.style.color = "black";
					sette.style.color = "black";
					otto.style.color = "black";
					nove.style.color = "red";
					dieci.style.color = "black";
					undici.style.color = "black";
    return true;
}

}


//var espressione3 = /$./;
//var espressione4 = /$_/;

	

function checkEmailAddress2(field) 
{
  var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (field.value != '')
  {
  if (goodEmail)
  {
    good = true
  } 
  else 
  {
    alert('Inserisci un indirizzo e-mail valido.')
	field.focus();
	uno.style.color = "black";
					due.style.color = "black";
					tre.style.color = "black";
					quattro.style.color = "black";
					cinque.style.color = "black";
					sei.style.color = "black";
					sette.style.color = "red";
    good = false
  }
  }
}

//"#222266";


function view(value,titolo, sottocategoria) {
	if(document.getElementById(value).style.display == "block"){
  		document.getElementById(value).style.display = "none";
		//document.getElementById(titolo).style.color = "#000050";
		//document.getElementById(sottocategoria).style.color = "#000050";
  	}else{
  		document.getElementById(value).style.display = "block";
		//document.getElementById(titolo).style.color = "#0000FF";
		//document.getElementById(sottocategoria).style.color = "#0000FF";
	}
}


function abilita_1(value) {
	if(document.getElementById('prova').style.display == "block")
	{
  document.getElementById('prova').style.display = "none";
  }else{
  document.getElementById('prova').style.display = "block";
	}
}

function abilita_2(value) {
	if(document.getElementById('prova2').style.display == "block")
	{
  document.getElementById('prova2').style.display = "none";
  }else{
  document.getElementById('prova2').style.display = "block";
	}
}

function abilita_3(value) {
	if(document.getElementById('prova3').style.display == "block")
	{
  document.getElementById('prova3').style.display = "none";
  }else{
  document.getElementById('prova3').style.display = "block";
	}
}

function abilita_4(value) {
	if(document.getElementById('prova4').style.display == "block")
	{
  document.getElementById('prova4').style.display = "none";
  }else{
  document.getElementById('prova4').style.display = "block";
	}
}

function abilita_5(value) {
	if(document.getElementById('prova5').style.display == "block")
	{
  document.getElementById('prova5').style.display = "none";
  }else{
  document.getElementById('prova5').style.display = "block";
	}
}

function abilita_6(value) {
	if(document.getElementById('prova6').style.display == "block")
	{
  document.getElementById('prova6').style.display = "none";
  }else{
  document.getElementById('prova6').style.display = "block";
	}
}

function abilita_7(value) {
	if(document.getElementById('prova7').style.display == "block")
	{
  document.getElementById('prova7').style.display = "none";
  }else{
  document.getElementById('prova7').style.display = "block";
	}
}

function abilita_8(value) {
	if(document.getElementById('prova8').style.display == "block")
	{
  document.getElementById('prova8').style.display = "none";
  }else{
  document.getElementById('prova8').style.display = "block";
	}
}

function abilita_9(value) {
	if(document.getElementById('prova9').style.display == "block")
	{
  document.getElementById('prova9').style.display = "none";
  }else{
  document.getElementById('prova9').style.display = "block";
	}
}

function abilita_10(value) {
	if(document.getElementById('prova10').style.display == "block")
	{
  document.getElementById('prova10').style.display = "none";
  }else{
  document.getElementById('prova10').style.display = "block";
	}
}

function abilita_11(value) {
	if(document.getElementById('prova11').style.display == "block")
	{
  document.getElementById('prova11').style.display = "none";
  }else{
  document.getElementById('prova11').style.display = "block";
	}
}

function abilita_12(value) {
	if(document.getElementById('prova12').style.display == "block")
	{
  document.getElementById('prova12').style.display = "none";
  }else{
  document.getElementById('prova12').style.display = "block";
	}
}

function abilita_13(value) {
	if(document.getElementById('prova13').style.display == "block")
	{
  document.getElementById('prova13').style.display = "none";
  }else{
  document.getElementById('prova13').style.display = "block";
	}
}



function dw_scroller(id, w, h, num, axis, bMouse) {
    this.id=id; this.el = document.getElementById? document.getElementById(id): null; 
    if (!this.el) return; this.css = this.el.style; 
    this.css.left = this.x = 0; this.css.top = this.y = 0;
    this.w=w; this.h=h; this.num=num; this.axis=axis||"v"; 
    this.ctr=0; // pause onload (for large doc's, may want to set this to 1)
    this.pause=5000; this.speed=60; // defaults
    if (bMouse) dw_scrollers.setMouseEvents(this.el);
    this.lastTime = new Date().getTime(); this.check = 0;
    this.index = dw_scrollers.ar.length;  dw_scrollers.ar[this.index] = this;
    this.active = true;
}

dw_scroller.prototype.setTiming = function(speed, pause) {
    this.speed = speed; this.pause = pause;
}

dw_scroller.prototype.controlScroll = function() {
    if (this.ctr > this.num-1) {
        this.shiftTo(0, 0); this.ctr = 1;
    } else {
        switch (this.axis) {
            case "v" :
                if (this.y > -this.h * this.ctr) { 
                    var ny = this.y + -1 * this.elapsed/1000 * this.speed;
                    ny = Math.max(ny, -this.h * this.ctr);
                    this.shiftTo(0, ny);	
                } else this.doPause();
                break;
            case "h" :
                if (this.x > -this.w * this.ctr) { 
                    var nx = this.x + -1 * this.elapsed/1000 * this.speed;
                    nx = Math.max(nx, -this.w * this.ctr);
                    this.shiftTo(nx, 0);	
                } else this.doPause();
            break;
        }
    }
}

dw_scroller.prototype.doPause = function() {
    this.check += this.elapsed;
    if (this.check >= this.pause) { this.ctr++; this.check = 0; }
}

dw_scroller.prototype.shiftTo = function(x, y) {
    this.css.left = (this.x = x) + "px";
    this.css.top = (this.y = y) + "px";
}

////////////////////////////////////////////////////////////////////////////
// common to all scrollers (pausing or continuous, vertical or horizontal)
dw_scrollers = {};  
dw_scrollers.ar = []; // global access to all scroller instances

dw_scrollers.setMouseEvents = function(obj) {
    obj.onmouseover = dw_scrollers.halt;
    obj.onmouseout = dw_scrollers.resume;
}

dw_scrollers.halt = function() {
    var curObj;
    for (var i=0; curObj = dw_scrollers.ar[i]; i++) 
        if ( curObj.id == this.id ) { curObj.active = false; return; }
}

dw_scrollers.resume = function(e) {
    var curObj;
    for (var i=0; curObj = dw_scrollers.ar[i]; i++) {
        if ( curObj.id == this.id ) {
            e = e? e: window.event;
            var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
            if ( this != toEl && !dw_contained(toEl, this) ) { 
                var now = new Date().getTime();
                curObj.elapsed = now - curObj.lastTime;
                curObj.lastTime = now; curObj.active = true; return; 
            }
        }
    }
}

// Handle all instances with one timer - idea from youngpup.net
dw_scrollers.timer = window.setInterval("dw_scrollers.control()", 10);
dw_scrollers.control = function() {
    var curObj;
    for (var i=0; curObj = dw_scrollers.ar[i]; i++) {
        if ( curObj.active ) {
            var now = new Date().getTime();
            curObj.elapsed = now - curObj.lastTime;
            curObj.lastTime = now; curObj.controlScroll();
        }
    }
}

// remove layers from table for ns6+/mozilla (needed for scrollers inside tables)
// pass id's of scrollers (i.e., div's that contain content that scrolls, usually wn, or wn1, ...)
dw_scrollers.GeckoTableFix = function() {
    var ua = navigator.userAgent;
    if ( ua.indexOf("Gecko") > -1 && ua.indexOf("Firefox") == -1 
        && ua.toLowerCase().indexOf("like gecko") == -1 ) {
        dw_scrollers.hold = []; // holds id's of wndo (i.e., 'the scroller') and its container
        for (var i=0; arguments[i]; i++) {
            var wndo = document.getElementById( arguments[i] );
            var holderId = wndo.parentNode.id;
            var holder = document.getElementById(holderId);
            document.body.appendChild( holder.removeChild(wndo) );
            wndo.style.zIndex = 1000;
            var pos = getPageOffsets(holder);
            wndo.style.left = pos.x + "px"; wndo.style.top = pos.y + "px";
            dw_scrollers.hold[i] = [ arguments[i], holderId ];
        }
        window.addEventListener("resize", dw_scrollers.rePosition, true);
    }
}

// ns6+/mozilla need to reposition layers onresize when scrollers inside tables.
dw_scrollers.rePosition = function() {
    if (dw_scrollers.hold) {
        for (var i=0; dw_scrollers.hold[i]; i++) {
            var wndo = document.getElementById( dw_scrollers.hold[i][0] );
            var holder = document.getElementById( dw_scrollers.hold[i][1] );
            var pos = getPageOffsets(holder);
            wndo.style.left = pos.x + "px"; wndo.style.top = pos.y + "px";
        }
    }
}

function getPageOffsets(el) {
    var left = el.offsetLeft;
    var top = el.offsetTop;
    if ( el.offsetParent && el.offsetParent.clientLeft || el.offsetParent.clientTop ) {
        left += el.offsetParent.clientLeft;
        top += el.offsetParent.clientTop;
    }
    while ( el = el.offsetParent ) {
        left += el.offsetLeft;
        top += el.offsetTop;
    }
    return { x:left, y:top };
}

// returns true if oNode is contained by oCont (container)
function dw_contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}

// avoid memory leak in ie
dw_scrollers.unHook = function() {
  var i, curObj;
  for (i=0; curObj = dw_scrollers.ar[i]; i++) {
    if ( curObj.el ) { 
      curObj.el.onmouseover = null;
      curObj.el.onmouseout = null;
      curObj.el = null;
    }
  }
}

if ( window.addEventListener ) window.addEventListener( "unload", dw_scrollers.unHook, true);
else if ( window.attachEvent ) window.attachEvent( "onunload", dw_scrollers.unHook );
function initScroller(val) {

  // arguments: id of layer that scrolls, width and height of scroller (of wn), 

  // number of items (including repeated 1st item), axis ("v" or "h")

  // set up pause/resume onmouseover/out? (true or false)

  var scr1 = new dw_scroller('cnt', 150, 160, val, "v", true);

  scr1.setTiming(50, 3000);

}

function contatore(val) {
max=242
if (val.testo.value.length > max) {
val.testo.value = val.testo.value.substring(0,max)
rest = 0
} 
else {
rest = max - val.testo.value.length
}
val.num.value = rest
}

function conferma() {
	if(confirm("Eliminare definitivamente la news?"))
	return true;
	else
	return false;
}



function abilita_colore() {
	
  document.getElementById('orari_aperture').style.display = "none";
  
}


function verifica_form_talent() {

		 
		  email = document.getElementById("contatto1q").value;
		 	
		 nome = document.getElementById("nome1q").value;
		 
		 cell = document.getElementById("cell1q").value;
		 
		 contatto = document.getElementById("contatto1q").value;
		 
		 categoria = document.getElementById("categoria1q").value;
		 
		 citta = document.getElementById("citta1q").value;

		 cognome = document.getElementById("cognome1q").value;
privacy2= document.getElementById('privacy2q').checked
privacy21= document.getElementById('privacyy21q').checked
		 

		 
				
		 		if (nome=='') {
					alert('Attenzione! Inserire il nome');
					document.getElementById('nome1q').focus();
					return false;
				
				}
				if (cognome=='') {
					alert('Attenzione! Inserire il cognome');
					document.getElementById('cognome1q').focus();
					return false;
				
				}
				if (cell=='') {
					alert('Attenzione! Inserire il cellulare');
					document.getElementById('cell1q').focus();
					return false;
				
				}
				if (email=='') {
					alert('Attenzione! Inserire l\'indirizzo e-mail');
					document.getElementById('contatto1q').focus();
					return false;
				
				}	
				
				if (citta=='') {
					alert('Attenzione! Inserire la citta\'');
					document.getElementById('contatto1q').focus();
					return false;
				
				}	
				
				if (categoria=='') {
					alert('Attenzione! Inserire il codice');
					document.getElementById('contatto1q').focus();
					return false;
				
				}	
				
				if (privacy2==true) {
					alert('Attenzione! E\' necessario il consenso al trattamento dei dati personali');
					document.getElementById('privacy2q').focus();
					return false;
				
				}
				
				if (privacy21==true) {
					alert('Attenzione! E\' necessario il accettare il regolamento');
					document.getElementById('privacy2q').focus();
					return false;
				
				}
				
				GetAction1q("email="+email+"&nome="+nome+"&cognome="+cognome+"&cell="+cell+"&contatto="+contatto+"&categoria="+categoria+"&citta="+citta);
				
}	

function GetAction1q(data)
{
  // istanza dell'oggetto XMLHttpRequest
  if (window.XMLHttpRequest)
  {
    req = new XMLHttpRequest();
    req.onreadystatechange = ProcessRequest1q;
    req.open('POST', url1q, true);
    req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    req.send(data);
  }
  // controllo sulla versione ActiveX
  else if (window.ActiveXObject)
  {
    req = new ActiveXObject('Microsoft.XMLHTTP')
    if (req)
    {
      req.onreadystatechange = ProcessRequest1q;
      req.open('POST', url1q, true);
      req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
      req.send(data);
    }
  }
}
	function ProcessRequest1q()
{
  // stato della ricerca inviata
  if (req.readyState == 4)
  {
    // stato della ricerca accolta
    if (req.status == 200)
    {
      eval(what1q);
    }else{
      alert('Problema nella gestione dei dati: ' + req.responseText);
    }
  }
}
var url1q = "commenti_talent.php";
var what1q = "LoginStatus1q(req.responseText)";
function LoginStatus1q(Status)
{
  if(Status == 0) {
  alert("Problemi nell'invio dei dati, riprovare piu' tardi.");
  return false;
  }
  else if(Status == 2){
	  alert("Il codice inserito e\' inesistente.");
  return false;
  }else if(Status == 3){
	  alert("Il codice risulta gia\' inserito! Per eventuali segnalazioni info@visions-multimedia.com.");
  return false;
  }else{
  alert("Richiesta inviata correttamente!");
  document.getElementById("contatto1q").value='';
		 
	document.getElementById("citta1q").value='';
		 		
	 document.getElementById("nome1q").value='';
		
	 document.getElementById("cognome1q").value='';
	 
	 document.getElementById("cell1q").value='';
	 
	 document.getElementById("cell1q").value='';
	 
	 document.getElementById("categoria1q").value='';
		  
  }
}
