 

function edt(action,dove,cosa){
	if(dove=='home'){
		if(action == 'elimina'){
			parametro="?where=home&xpath="+escape(cosa);
			if(confirm('ATTENZIONE:\neliminare la sezione???\n... l\'azione č IRREVERSIBILE!'))
				window.open('elimina.jsp'+parametro,'eliminaWin','width=5,height=5')
		}else{
			if(action == 'modifica'){
				parametro="?action=ins&where=homeSezione&xprefix="+escape(cosa);
				window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
			}else{
				if(action=='fotoSx'){
					parametro="?action=fotoSx&where=homeSezione&xprefix="+escape(cosa);
					window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
				}
			}
		}
	}else{
		if(dove=='conf'){
			if(action == 'banner' || action == 'links'){
					parametro="?action="+action+"&where=conf&xprefix="+escape(cosa);
					window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
			}
		}else{
			if(action == 'elimina'){
				parametro="?where="+dove+"&xpath="+escape(cosa);
				if(confirm('ATTENZIONE:\neliminare la sezione???\n... l\'azione č IRREVERSIBILE!'))
					if(confirm('SICURO???'))
						window.open('elimina.jsp'+parametro,'eliminaWin','width=5,height=5')
			}else if(action == 'eliminaComm'){
				parametro="?action=eliminaComm&where="+dove+"&xpath="+escape(cosa);
				if(confirm('ATTENZIONE:\neliminare la sezione???\n... l\'azione č IRREVERSIBILE!'))
					if(confirm('SICURO???'))
						window.open('elimina.jsp'+parametro,'eliminaWin','width=5,height=5')
			}
		}


	}
}

function insGeneric(where,xpath){
	parametro="?action=ins&where="+where+"&xprefix="+escape(xpath);
	window.open('edt/insNode.jsp'+parametro,'','width=10,height=10,scrollbars=no,resizable=no')
}

function edtGeneric(filePath,xml,xpath){
	parametro="?action=thbGeneric&where="+xml+"&filePath="+escape(filePath)+"&xprefix="+escape(xpath);
	window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
}
function edtThb(filePath,xml,xpath){
	parametro="?action=thb&where="+xml+"&filePath="+escape(filePath)+"&xprefix="+escape(xpath);
	window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
}

function edtDida(filePath,xml,xpath){
	parametro="?action=dida&where="+xml+"&filePath="+escape(filePath)+"&xprefix="+escape(xpath);
	window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
}

function edtSezione(xpath,xml){
	parametro="?action=sezione&where="+xml+"&xprefix="+escape(xpath);
	window.open('edt.jsp'+parametro,'edtWin','width=530,height=500,scrollbars=yes,resizable=yes')
}
lastOpened = 0;
function fotoOpen(obj,theSrc,theDida,theTitleText,divId,titleContainer,ilFotoContainer,didaContainer,ilCopyContaniner,copyValue,theLast,videoPlug){
	lastOpened = theLast;
	theFotoId = document.getElementById(divId)
	theDidaId = document.getElementById(didaContainer)
	theTitleId=null
	theTitleId = document.getElementById(titleContainer)
	theCopyId = document.getElementById(ilCopyContaniner)
	if(theCopyId!=null){
		if(copyValue == 'left' || copyValue == ''){
		 theCopyId.getElementsByTagName('DIV')[0].style.display = ''
		 theCopyId.getElementsByTagName('DIV')[1].style.display = 'none'
	 	}else{
		if(copyValue == 'right'){
		 theCopyId.getElementsByTagName('DIV')[1].style.display = ''
		 theCopyId.getElementsByTagName('DIV')[0].style.display = 'none'
	 	}			}

	}

//alert(videoPlug)
	if(videoPlug!=''){
		theFotoId.parentNode.innerHTML = "<span id=\""+theFotoId.id+"\">"+videoPlug+"</span>"
	}
	else{
	if(theFotoId!=null){
			theFotoId.src = theSrc
		}

	}


	if(theDidaId!=null){
		theDidaId.innerHTML=theDida
	}
	if(theTitleId!=null){
		theTitleId.innerHTML=theTitleText
	}
	theImgDivId = document.getElementById(ilFotoContainer)
	if(theImgDivId!=null){
		divArray = theImgDivId.getElementsByTagName('SPAN');
		for(i=0;i<divArray.length;i++){
			divArray[i].className="imgUnsel";
		}

	}
	obj = obj.parentNode ;
	obj.className = "imgSel";
	return true;
}

function detailView(divId){
		theFotoId = document.getElementById(divId)
		theSrc = theFotoId.src
		theSrc.replaceAll("/low/","/high/")
		theCopyId.getElementById('detailViewLayer').style.display = '';

}

function openDetail(percorso){
	document.location = percorso+lastOpened;
}









function MM_swapImgRestore() { //v3.0
			  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
			}
			
			function MM_findObj(n, d) { //v4.01
			  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			  if(!x && d.getElementById) x=d.getElementById(n); return x;
			}
			
			function risposta(nome,risposta) { //v1.0
			   //alert(nome+': '+risposta)
			   ilLayer = 'domanda'+nome
			   
			   if(testaDomanda(ilLayer,risposta))
			   {
			   	nome++
			   	ilLayer = 'domanda'+nome
				hideAll()
			   	MM_showHideLayers(ilLayer,'','show')
			   }
			}
			
			function hideAll(nome,risposta) { //v1.0
			MM_showHideLayers('domanda1','','hide','domanda2','','hide','domanda3','','hide','domanda4','','hide','domanda5','','hide','domanda6','','hide','domanda7','','hide','domanda08','','hide','domanda09','','hide')
			
			}
			function testaDomanda(ilLayer,risposta)
			{
			   if(ilLayer == 'domanda1' || ilLayer == 'domanda2')
				{
					if(risposta=='0')
			   		{
						alert('su questo rifletterei meglio prima di proseguire...')
						return false
					}
					else
						return true
				}
			   if(ilLayer == 'domanda3')
			   	{
					if(risposta=='0')
			   		{	
						alert('esci immediatamente da questo test:\nuna collaborazione con te sarebbe solo tempo sprecato.')
						//document.location.reload()
						return false
					}
					else
					{
						alert('vai pure avanti\n(ma non montarti la testa)')
						return true
					}
				}
				if(ilLayer == 'domanda4')
			   	{	
						alert('Cosė poco? Mi spiace, niente da fare.\nSe questa č la cifra che puoi offrire esci immediatamente da questo test.')
						return true
				}
				if(ilLayer == 'domanda5')
			   	{	
				
						if(risposta < document.getElementById('input04').value)
							{
								alert('che fai mi prendi in giro?\ndi pių, non di meno!')
								return false
							}
						else
						{	if(risposta == document.getElementById('input04').value)
								{
									alert('Ho detto: di pių!')
									return false
								}			
							else	
								return true				
						}
				}
			   if(ilLayer == 'domanda6')
			   	{
					if(risposta=='0')
			   		{	
						alert('Non hai superato il test.\nVai a farti fare battute dal tuo maestro di tennis.')
						//document.location.reload()
						return false
					}
					else
					{
						alert('Complimenti, hai superato il test!\nTi do il numero del mio maestro di tennis, fa delle battute ottime')
						return true
					}
				}	
				
				if(ilLayer == 'domanda7')
					return true
				
			}
			function MM_showHideLayers() { //v6.0
			  var i,p,v,obj,args=MM_showHideLayers.arguments;
			  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
			    obj.visibility=v; }
			}
			



