SOWIN=(navigator.userAgent.toLowerCase().indexOf("win")>-1)?1:0;SOMAC=(navigator.userAgent.toLowerCase().indexOf("mac")>-1)?1:0;SOLIN=(navigator.userAgent.toLowerCase().indexOf("linux")>-1)?1:0;SOALT=(!SOWIN&&!SOMAC&&!SOLIN)?1:0;OP=((ind1=navigator.userAgent.indexOf("Opera"))>-1)?1:0;punto=(OP)?navigator.userAgent.indexOf(".",ind1):0;OP5=(OP&&parseInt(navigator.userAgent.substr(punto-1))==5)?1:0;OP6=(OP&&parseInt(navigator.userAgent.substr(punto-1))==6)?1:0;IE=((ind2=navigator.appVersion.indexOf("MSIE"))>-1&&!OP)?1:0;IE4=(IE&&parseInt(navigator.appVersion.substr(ind2+5))==4)?1:0;IE5=(IE&&parseInt(navigator.appVersion.substr(ind2+5))==5)?1:0;IE6=(IE&&parseInt(navigator.appVersion.substr(ind2+5))==6)?1:0;NN=(navigator.appName.indexOf("Netscape")>-1)?1:0;NN4=(NN&&parseInt(navigator.appVersion)==4)?1:0;NN6=(NN&&parseInt(navigator.appVersion)>4)?1:0;GE=(navigator.userAgent.toLowerCase().indexOf("gecko")>-1)?1:0;var lingua="ita";String.prototype.equalsIgnoreCase=matchIgnoreCase;function matchIgnoreCase(c){var b=this.toLowerCase();c=c.toLowerCase();if(b==c){return true}else{return false}}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d<c.length&&(b=c[d])&&b.oSrc;d++){b.src=b.oSrc}}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var e,c=f.MM_p.length,b=MM_preloadImages.arguments;for(e=0;e<b.length;e++){if(b[e].indexOf("#")!=0){f.MM_p[c]=new Image;f.MM_p[c++].src=b[e]}}}}function MM_findObj(g,f){var e,c,b;if(!f){f=document}if((e=g.indexOf("?"))>0&&parent.frames.length){f=parent.frames[g.substring(e+1)].document;g=g.substring(0,e)}if(!(b=f[g])&&f.all){b=f.all[g]}for(c=0;!b&&c<f.forms.length;c++){b=f.forms[c][g]}for(c=0;!b&&f.layers&&c<f.layers.length;c++){b=MM_findObj(g,f.layers[c].document)}if(!b&&f.getElementById){b=f.getElementById(g)}return b}function MM_swapImage(){var e,d=0,b,c=MM_swapImage.arguments;document.MM_sr=new Array;for(e=0;e<(c.length-2);e+=3){if((b=MM_findObj(c[e]))!=null){document.MM_sr[d++]=b;if(!b.oSrc){b.oSrc=b.src}b.src=c[e+2]}}}function JWM_swapImage(){a=JWM_swapImage.arguments;document.JWM_tmp=new Array;j=0;for(i=0;i<(a.length-1);i+=2){x=document.getElementById(a[i]);document.JWM_tmp[j++]=x;if(!x.oSrc){x.oSrc=x.src}x.src=a[i+1]}}function JWM_swapImgRestore(){a=document.JWM_tmp;for(i=0;a&&i<a.length&&a[i].oSrc;i++){a[i].src=a[i].oSrc}}function addParameter(c,k){for(var g=0;g<document.links.length;g++){var h=document.links[g].href.indexOf("http://");var d=document.links[g].href.indexOf("#");var e=document.links[g].href.indexOf("javascript:");var f=document.links[g].href.indexOf("http://");var b=(document.links[g].href.indexOf(".jsp")!=-1)?true:false;var m=(document.links[g].href.indexOf("?")!=-1)?"&":"?";if(d==-1&&e==-1&&f!=-1&&b){document.links[g].href+=m+c+"="+k}}}function getParameter(b){var c=window.location.href;var f=c.indexOf("?");if(f!=-1){var e=c.substr(f+1);var d=e.indexOf(b);if(d!=-1){paramToEnd=e.substr(d+b.length+1);var g=paramToEnd.indexOf("&");if(g==-1){return paramToEnd}else{return paramToEnd.substr(0,g)}}}}function getParameters(){var h=new Array();var d=window.location.href;var g=d.indexOf("?");var c=true;if(g!=-1){var f=d.substr(g+1);var h=f.split("&");for(var e=0;e<h.length;e++){var b=h[e].split("=");if(b.length==2){h[b[0]]=b[1]}}return h}}function getAttributo(el,attr,isselect){retval=document.getElementById(el);if(retval){if(isselect){return eval("retval.options[retval.selectedIndex]."+attr)}else{return eval("retval."+attr)}}}function vai(b,c){if(b&&b!=""){if(c){document.location.replace(b)}else{document.location=b}}}function cerca(c,d,b){if(trimString(document.getElementById(d).value)==""){alert(b)}else{document.forms[c].submit()}}function trimString(b){b=b.replace(/^\s+/g,"");return b.replace(/\s+$/g,"")}function printUltimaModifica(e){var h=new Date(document.lastModified);var f=h.getDate();var d=new String(f);d=d.length==1?"0"+f:f;var c=h.getMonth();var k=new String(c);k=k.length==1?"0"+(c+1):(c+1);var b=h.getFullYear();if(e=="eng"){document.write(k+"/"+d+"/"+b)}else{document.write(d+"/"+k+"/"+b)}}function hideLayers(){a=hideLayers.arguments;for(i=0;i<a.length;i++){if(document.getElementById(a[i])){document.getElementById(a[i]).style.display="none"}}}function showLayers(){a=showLayers.arguments;for(i=0;i<a.length;i++){if(document.getElementById(a[i])){document.getElementById(a[i]).style.display="block"}}}function nobox(b){document.getElementById(b).style.display="none"}function box(b){document.getElementById(b).style.display="block"}function cercaEv(e){var b=document.getElementById("ev_tema");document.getElementById("n_tema").value=b.options[b.selectedIndex].text;var c=document.getElementById("ev_dest");document.getElementById("n_dest").value=c.options[c.selectedIndex].text;var d=document.getElementById("ev_mese");document.getElementById("n_mese").value=d.options[d.selectedIndex].text;document.forms[e].submit()}function isdefined(b){return(typeof(window[b])=="undefined")?false:true}function validateForm(_form){var reqfields=document.getElementById("requiredfields");var reqfieldsmsg=document.getElementById("requiredfieldsmsg");try{if(reqfields&&reqfields.value.trim().length>0){var rf=reqfields.value;var re=new RegExp(",","gi");rf=rf.replace(re,"&&");re=new RegExp("s","gi");var rf2=rf.split(/[\s&&\(\)||]/gi);for(var i=0;i<rf2.length;i++){var token=rf2[i].trim();if(token.length>0){var valcampo=false;if(isFilled(_form,token)){valcampo=true}rf=rf.replace(token,valcampo)}}re=null;rf2=null;var err=false;eval("if(!("+rf+")) err=true");if(err){alert(reqfieldsmsg&&reqfieldsmsg.value!=""?reqfieldsmsg.value:"Per proseguire è necessario compilare tutti i campi obbligatori");return false}else{return true}}return true}catch(e){alert(e.message);return false}}function isFilled(e,g){var f=false;for(var d=0;e.elements[d];d++){var c=e.elements[d];if(c&&c.name==g){switch(c.type){case"select-one":if(c.selectedIndex!=-1&&c.options[c.selectedIndex].value!=""){f=true}break;case"select-multiple":for(var b=0;b<c.length;b++){if(c[b].selected==true){f=true;break}}break;case"radio":if(c.checked){return true}break;case"checkbox":if(c.checked){return true}break;default:if(c.value.trim()!=""){f=true}break}}}return f}function finestra(f,c,e,b,d){if(b==""){b="no"}if(d==""){d="yes"}window.open(f,"","width="+c+",height="+e+",scrollbars="+b+",resizable="+d)}function piccolo(){if(document.getElementById("txt")){document.getElementById("txt").style.fontSize="1.15em"}else{}}function normale(){if(document.getElementById("txt")){document.getElementById("txt").style.fontSize="1.3em"}else{}}function grande(){if(document.getElementById("txt")){document.getElementById("txt").style.fontSize="1.7em"}else{}}var tgs=new Array("div","td","tr");var szs=new Array("xx-small","x-small","small","medium","large","x-large","xx-large");var startSz=2;function ts(c,k){if(!document.getElementById){return}var l=document,g=null,h=startSz,f,e,b;h+=k;if(h<0){h=0}if(h>6){h=6}startSz=h;if(!(g=l.getElementById(c))){g=l.getElementsByTagName(c)[0]}g.style.fontSize=szs[h];for(f=0;f<tgs.length;f++){b=g.getElementsByTagName(tgs[f]);for(e=0;e<b.length;e++){b[e].style.fontSize=szs[h]}}}function bookmarkSite(d,b){if(window.sidebar){window.sidebar.addPanel(d,b,"")}else{if(window.opera&&window.print){var c=document.createElement("a");c.setAttribute("href",b);c.setAttribute("title",d);c.setAttribute("rel","sidebar");c.click()}else{if(document.all){window.external.AddFavorite(b,d)}}}}function taCut(b,c){if(b.value.length>c){alert("Il numero massimo di caratteri permesso per questo campo è "+c);b.value=b.value.substring(0,c)}}function taLimit(b,c){if(b.value.length>=c){return false}return true}function taCount(b,e,d){var c=b.value;if(c.length>d){c=c.substring(0,d)}if(e){if(NN){e.value=d-c.length}else{e.value=d-c.length}}return true}function createCookie(d,e,f){if(f){var c=new Date();c.setTime(c.getTime()+(f*24*60*60*1000));var b="; expires="+c.toGMTString()}else{b=""}document.cookie=d+"="+e+b+"; path=/"}function readCookie(d){var b=d+"=";var c=document.cookie.split(";");for(var f=0;f<c.length;f++){var e=c[f];while(e.charAt(0)==" "){e=e.substring(1,e.length)}if(e.indexOf(b)==0){return e.substring(b.length,e.length)}}}function deleteCookie(c){var d=new Date();expYear=d.getYear();d.setYear(expYear);var b="; expires="+d.toGMTString();document.cookie=c+"=deleted"+b+"; path=/"}function alreadyVoted(d,c){var b=readCookie("FORM_"+d);if((b==undefined||b=="deleted")||c){return true}else{alert("Hai già votato per questo sondaggio.");return false}}function checkEmail(c){var b=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;var e=c.value;var d=e.search(b);if(d==-1&&e!=""){if(lingua=="ita"){alert("Email non valida")}else{if(lingua=="eng"){alert("Non-valid email")}else{alert("Email non valida")}}c.value="";c.focus()}}function checkDate(b){var e;if(lingua=="ita"){e=/^((3[01])|([12][0-9])|(0[1-9]))[\/]((1[0-2])|(0[1-9]))[\/]((19|20)\d{2})$/}else{if(lingua=="eng"){e=/^((1[0-2])|(0[1-9]))[\/]((3[01])|([12][0-9])|(0[1-9]))[\/]((19|20)\d{2})$/}else{e=/^((1[0-2])|(0[1-9]))[\/]((3[01])|([12][0-9])|(0[1-9]))[\/]((19|20)\d{2})$/}}var f=0;if(b.value!=""){var d;var c;if(lingua=="ita"){d=b.value.substr(0,2);c=b.value.substr(3,2)-1}else{if(lingua=="eng"){c=b.value.substr(0,2)-1;d=b.value.substr(3,2)}else{d=b.value.substr(0,2);c=b.value.substr(3,2)-1}}var h=b.value.substr(6,4);var g=b.value.search(e);if(g==-1){f=1}else{var k=c.toString();if(k.substr(0,1)==0){k=k.substr(1,1)}gm=new Array(31,28,31,30,31,30,31,31,30,31,30,31);if(((h%4==0)&&(h%100!=0))||(h%400==0)){gm[1]=29}if(d>gm[k]){f=1}}}if(f==1){if(lingua=="ita"){alert("Formato data non valido (gg/mm/aaaa)")}else{if(lingua=="eng"){alert("Non-valid date format (mm/dd/yyyy)")}else{alert("Formato data non valido (gg/mm/aaaa)")}}b.value=""}}function resetForm(b){var c=document.forms[0];if(b!=undefined){c=document.forms[b]}c.reset()}function checkForm(g){var f=/^(required)[0-9]*$/gi;var d=0;var k=document.forms[0];if(g!=undefined){k=document.forms[g]}var e=k.elements;var h=k.length;var b="\n";for(i=0;i<h;i++){campo=e[i];idcampo=campo.id;tipocampo=campo.type;if(campo){if((tipocampo!="hidden")&&(idcampo.search(f)!=-1)){switch(tipocampo){case"checkbox":if(k.elements[campo.name].length){var c=false;for(j=0;j<k.elements[campo.name].length;j++){if(k.elements[campo.name][j].checked){c=true}}if(!c){d=1;b+=(campo.name+"\n")}}else{if(!k.elements[campo.name].checked){d=1;b+=(campo.name+"\n")}}break;case"select-one":if((campo.selectedIndex==-1)||(campo.options[campo.selectedIndex].value=="")){d=1;b+=(campo.name+"\n")}break;case"select-multiple":if((campo.selectedIndex==-1)||(campo.options[campo.selectedIndex].value=="")){d=1;b+=(campo.name+"\n")}break;case"file":if(campo.value==""){d=1;b+=(campo.name+"\n")}break;case"text":if(campo.value==""){d=1;b+=(campo.name+"\n")}break;case"textarea":if(campo.value==""){d=1;b+=(campo.name+"\n")}break;case"radio":var c=false;for(j=0;j<k.elements[campo.name].length;j++){if(k.elements[campo.name][j].checked){c=true}}if(!c){d=1;b+=(campo.name+"\n")}break;default:}}}}if(d==1){if(lingua=="ita"){alert("ATTENZIONE: Per procedere e' necessario compilare tutti i campi obbligatori")}else{alert("ATTENTION: Fill all required fields")}}else{k.submit()}}function isNumber(b){if(isNaN(b.value)&&b.value!=""){if(lingua=="ita"){alert("valore numerico !!")}else{if(lingua=="eng"){alert("numeric value !!")}else{alert("valore numerico !!")}}b.value=""}}function AJAXPageCall(d){var b=AJAXPageCall.arguments;var f=b.length;var c=1;if(f>=c){if((f-c)%2==0){var e=new Object();for(i=c;i<f;i++){if(i%2==(c%2)){e[b[i]]=b[i+1]}}AjaxRequest.get({url:d,parameters:e,onSuccess:function(g){},onError:function(g){}})}}}function AjaxRequest(){var b=new Object();b.timeout=null;b.generateUniqueUrl=true;b.url=window.location.href;b.method="GET";b.async=true;b.username=null;b.password=null;b.parameters=new Object();b.requestIndex=AjaxRequest.numAjaxRequests++;b.responseReceived=false;b.groupName=null;b.queryString="";b.responseText=null;b.responseXML=null;b.status=null;b.statusText=null;b.aborted=false;b.xmlHttpRequest=null;b.onTimeout=null;b.onLoading=null;b.onLoaded=null;b.onInteractive=null;b.onComplete=null;b.onSuccess=null;b.onError=null;b.onGroupBegin=null;b.onGroupEnd=null;b.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(b.xmlHttpRequest==null){return null}b.xmlHttpRequest.onreadystatechange=function(){if(b==null||b.xmlHttpRequest==null){return}if(b.xmlHttpRequest.readyState==1){b.onLoadingInternal(b)}if(b.xmlHttpRequest.readyState==2){b.onLoadedInternal(b)}if(b.xmlHttpRequest.readyState==3){b.onInteractiveInternal(b)}if(b.xmlHttpRequest.readyState==4){b.onCompleteInternal(b)}};b.onLoadingInternalHandled=false;b.onLoadedInternalHandled=false;b.onInteractiveInternalHandled=false;b.onCompleteInternalHandled=false;b.onLoadingInternal=function(){if(b.onLoadingInternalHandled){return}AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof(window.AjaxRequestBegin)=="function"){AjaxRequestBegin()}if(b.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[b.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[b.groupName]=0}AjaxRequest.numActiveAjaxGroupRequests[b.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[b.groupName]==1&&typeof(b.onGroupBegin)=="function"){b.onGroupBegin(b.groupName)}}if(typeof(b.onLoading)=="function"){b.onLoading(b)}b.onLoadingInternalHandled=true};b.onLoadedInternal=function(){if(b.onLoadedInternalHandled){return}if(typeof(b.onLoaded)=="function"){b.onLoaded(b)}b.onLoadedInternalHandled=true};b.onInteractiveInternal=function(){if(b.onInteractiveInternalHandled){return}if(typeof(b.onInteractive)=="function"){b.onInteractive(b)}b.onInteractiveInternalHandled=true};b.onCompleteInternal=function(){if(b.onCompleteInternalHandled||b.aborted){return}b.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(b.groupName)}if(b.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[b.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[b.groupName]==0&&typeof(b.onGroupEnd)=="function"){b.onGroupEnd(b.groupName)}}b.responseReceived=true;b.status=b.xmlHttpRequest.status;b.statusText=b.xmlHttpRequest.statusText;b.responseText=b.xmlHttpRequest.responseText;b.responseXML=b.xmlHttpRequest.responseXML;if(typeof(b.onComplete)=="function"){b.onComplete(b)}if(b.xmlHttpRequest.status==200&&typeof(b.onSuccess)=="function"){b.onSuccess(b)}else{if(typeof(b.onError)=="function"){b.onError(b)}}delete b.xmlHttpRequest.onreadystatechange;b.xmlHttpRequest=null};b.onTimeoutInternal=function(){if(b!=null&&b.xmlHttpRequest!=null&&!b.onCompleteInternalHandled){b.aborted=true;b.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof(window.AjaxRequestEnd)=="function"){AjaxRequestEnd(b.groupName)}if(b.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[b.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[b.groupName]==0&&typeof(b.onGroupEnd)=="function"){b.onGroupEnd(b.groupName)}}if(typeof(b.onTimeout)=="function"){b.onTimeout(b)}delete b.xmlHttpRequest.onreadystatechange;b.xmlHttpRequest=null}};b.process=function(){if(b.xmlHttpRequest!=null){if(b.generateUniqueUrl&&b.method=="GET"){b.parameters.AjaxRequestUniqueId=new Date().getTime()+""+b.requestIndex}var d=null;for(var c in b.parameters){if(b.queryString.length>0){b.queryString+="&"}b.queryString+=encodeURIComponent(c)+"="+encodeURIComponent(b.parameters[c])}if(b.method=="GET"){if(b.queryString.length>0){b.url+=((b.url.indexOf("?")>-1)?"&":"?")+b.queryString}}b.xmlHttpRequest.open(b.method,b.url,b.async,b.username,b.password);if(b.method=="POST"){if(typeof(b.xmlHttpRequest.setRequestHeader)!="undefined"){b.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded")}d=b.queryString}if(b.timeout>0){setTimeout(b.onTimeoutInternal,b.timeout)}b.xmlHttpRequest.send(d)}};b.handleArguments=function(c){for(var d in c){if(typeof(b[d])=="undefined"){b.parameters[d]=c[d]}else{b[d]=c[d]}}};b.getAllResponseHeaders=function(){if(b.xmlHttpRequest!=null){if(b.responseReceived){return b.xmlHttpRequest.getAllResponseHeaders()}alert("Cannot getAllResponseHeaders because a response has not yet been received")}};b.getResponseHeader=function(c){if(b.xmlHttpRequest!=null){if(b.responseReceived){return b.xmlHttpRequest.getResponseHeader(c)}alert("Cannot getResponseHeader because a response has not yet been received")}};return b}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				return null;
			}
		}
		@end @*/
}else{return null}}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0)};AjaxRequest.get=function(b){AjaxRequest.doRequest("GET",b)};AjaxRequest.post=function(b){AjaxRequest.doRequest("POST",b)};AjaxRequest.doRequest=function(d,b){if(typeof(b)!="undefined"&&b!=null){var c=new AjaxRequest();c.method=d;c.handleArguments(b);c.process()}};AjaxRequest.submit=function(b,c){var e=new AjaxRequest();if(e==null){return false}var d=AjaxRequest.serializeForm(b);e.method=b.method.toUpperCase();e.url=b.action;e.handleArguments(c);e.queryString=d;e.process();return true};AjaxRequest.serializeForm=function(c){var f=c.elements;var b=f.length;var h="";this.addField=function(k,l){if(h.length>0){h+="&"}h+=encodeURIComponent(k)+"="+encodeURIComponent(l)};for(var e=0;e<b;e++){var g=f[e];if(!g.disabled){switch(g.type){case"text":case"password":case"hidden":case"textarea":this.addField(g.name,g.value);break;case"select-one":if(g.selectedIndex>=0){this.addField(g.name,g.options[g.selectedIndex].value)}break;case"select-multiple":for(var d=0;d<g.options.length;d++){if(g.options[d].selected){this.addField(g.name,g.options[d].value)}}break;case"checkbox":case"radio":if(g.checked){this.addField(g.name,g.value)}break}}}return h};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;
