function showTools() { 
		var toolsObj = document.getElementById('toolsOpen');
		var anim = new YAHOO.util.Anim('toolsOpen', { width: {to: 150} },0.2, YAHOO.util.Easing.easeOut);
		toolsObj.style.visibility = 'visible';
		if (toolsObj.style.display == 'none') toolsObj.style.display = 'block';
		anim.animate();
	} 
	
	function hideTools(){
		var toolsObj = document.getElementById('toolsOpen');
		var anim = new YAHOO.util.Anim('toolsOpen', { width: {to: 80} },0.2, YAHOO.util.Easing.easeOut);
		anim.animate();
		toolsObj.style.visibility = 'hidden';
		if (toolsObj.style.display == 'block') toolsObj.style.display = 'none';
	}
	//YAHOO.widget.init();
	
	function changeImage(id,image1,image2) {
		if (document.getElementById(id)) { 
			var imgSrc=document.getElementById(id).src;
			if (imgSrc.indexOf(image2)>-1) {
				document.getElementById(id).src = image1; 
				hideTools();
				}
				else{
				document.getElementById(id).src = image2;
				showTools();
			}
		}
 	}
	
	function updateImage(id,image) {
  		if (document.getElementById(id))
   		document.getElementById(id).src = image;
 	}
	
var ControlloCAP;
	function Codices(){
		A = new Request({
			url: 'js/CK_capcha.cfm',
			method: 'post',
			async: false,
			data: {
				Codice: document.frmInfo.Codice.value
			},
			onSuccess: function(testo){
								DD = testo.substr(0, testo.indexOf('<!--FINE-->') - 11);
								eval(DD);
							
								ControlloCAP = A;
								
								}
		}).send();
		
					}	
function InviaFormInfo(){
		Codices();
	if (document.frmInfo.nome.value == "") alert("Inserire nome");
	else if (document.frmInfo.cognome.value == "") alert("Inserire cognome");
	//else if (document.frmInfo.via.value == "") alert("Inserire via");
	//else if (document.frmInfo.citta.value == "") alert("Inserire citta'");
	//else if (document.frmInfo.cap.value == "") alert("Inserire cap");
	else if (document.frmInfo.stato.value == "") alert("Inserire stato");
	else if (document.frmInfo.email.value == "") alert("Inserire email");
	else if (document.frmInfo.email.value.indexOf("@") == -1 || document.frmInfo.email.value.indexOf(".") == -1) alert("Inserire email valido");
	else if (document.frmInfo.argomento.value == "") alert("Selezionare l'argomento");
	else if(document.frmInfo.Codice.value == '') alert('Inserire Codice')
	else if(ControlloCAP == false)alert('Codice non coretto.')	
	//else if (document.frmInfo.richiesta.value == "") alert("Inserire la richiesta");
	else document.frmInfo.submit();
}	