var xmlhttp=false;
// http connection
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
// fine http connection

function aggiorna(chi){
	a=document.getElementById('id');
	//alert(a.value);
	if(a.value!='nulla'){
		registra='id='+a.value;
		lnk='selnom.php';
		xmlhttp.open("POST",lnk,true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4){
				retu=xmlhttp.responseText;
				if(retu){
					ins=document.getElementById('inv');
					ins.innerHTML='Nome per l\'inglese: <strong>'+retu+'</strong>';
					cmp=document.getElementById('nome_e');
					cmp.value=retu;
					campo=document.getElementById('vis');
					campo.style.display='none';
				}
				else{
					ins=document.getElementById('inv');
					ins.innerHTML='';
					cmp=document.getElementById('nome_e');
					cmp.value='';
					campo=document.getElementById('vis');
					campo.style.display='inline';
				}
			}
		}
		xmlhttp.send(registra);
		return false;
	}else{
		ins=document.getElementById('inv');
		ins.innerHTML='';
		cmp=document.getElementById('nome_e');
		cmp.value='';
		campo=document.getElementById('vis');
		campo.style.display='inline';
	}
}

function modi(chi,dove){
	switch(dove){
		case 'gra':
		window.location='modgraf.php?id='+chi;
		break;
		case 'ill':
		window.location='modillu.php?id='+chi;
		break;
		case 'mul':
		window.location='modmult.php?id='+chi;
		break;
		case 'eve':
		window.location='modeven.php?id='+chi;
		break;
		case 'nws':
		window.location='modnws.php?id='+chi;
		break;
		case 'mus':
		window.location='modmusi.php?id='+chi;
		break;
		case 'fot':
		window.location='modfoto.php?id='+chi;
		break;
		case 'cli':
		window.location='srchcli.php?id='+chi;
		break;
		case 'gen':
		window.location='srchgen.php?id='+chi;
		break;
		case 'amet':
		window.location='mod_ame.php?id='+chi;
		break;
	}
}
function modiImg(chi,dove){
	switch(dove){
		case 'gra':
		window.location='mod_img_grf.php?id='+chi;
		break;
		case 'ill':
		window.location='mod_img_ill.php?id='+chi;
		break;
		case 'mul':
		window.location='mod_img_mul.php?id='+chi;
		break;
		case 'eve':
		window.location='mod_img_eve.php?id='+chi;
		break;
		case 'fot':
		window.location='mod_img_fot.php?id='+chi;
		break;
	}
}
function cance(chi,dove){
	if(!confirm('confermi la cancellazione della scheda?'))return false;
	switch(dove){
		case 'gra':
		window.location='del_grf.php?id='+chi;
		break;
		case 'ill':
		window.location='del_ill.php?id='+chi;
		break;
		case 'mul':
		window.location='del_mul.php?id='+chi;
		break;
		case 'eve':
		window.location='del_eve.php?id='+chi;
		break;
		case 'nws':
		window.location='del_nws.php?id='+chi;
		break;
		case 'mus':
		window.location='del_mus.php?id='+chi;
		break;
		case 'fot':
		window.location='del_fot.php?id='+chi;
		break;
		case 'ame':
		window.location='del_ame.php?id='+chi;
		break;
		case 'amet':
		window.location='srchame.php?id='+chi;
		break;
	}
}