

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 changeIMG(obj){
	theName = obj.src

	if(theName.indexOf("_c")>0){
		theName = theName.replace("_c.jpg",".jpg");
		theName = theName.replace("_c.gif",".gif");
	}else{
		theName = theName.replace(".jpg","_c.jpg");
		theName = theName.replace(".gif","_c.gif");
	}
	obj.src = theName
	return true;
}
function openDetail(percorso){
	document.location = percorso+lastOpened;
}
function popupOpen(theUrl,theDida){
	parametro="?url="+escape(theUrl)+"&dida="+theDida;
	window.open('popUp.jsp'+parametro,'edtWin','width=600,height=550,scrollbars=yes,resizable=yes')

}
function popupOpenBig(theUrl,theDida){
	parametro="?url="+escape(theUrl)+"&dida="+theDida;
	window.open('popUp.jsp'+parametro,'edtWin','width=600,height=550,scrollbars=yes,resizable=yes')

}
