function showError(e,d,b,a){var g="..";if($defined(document.getElementById("magnoliaContextPathID"))){g=document.getElementById("magnoliaContextPathID").value;}var f=g+"/error/error.jsp?bundleKey="+e+"&value1="+d+"&value2="+b+"&value3="+a;MOOdalBox.open(f,"","594 306");}function showWarning(f,d,b,a){var g="..";
if($defined(document.getElementById("magnoliaContextPathID"))){g=document.getElementById("magnoliaContextPathID").value;}var e=g+"/error/warning.jsp?bundleKey="+f+"&value1="+d+"&value2="+b+"&value3="+a+"&twoWay=false&twoButton=true";MOOdalBox.open(e,"","594 306");}function showWarningTwoWay(f,d,b,a){var g="..";
if($defined(document.getElementById("magnoliaContextPathID"))){g=document.getElementById("magnoliaContextPathID").value;}var e=g+"/error/warning.jsp?bundleKey="+f+"&value1="+d+"&value2="+b+"&value3="+a+"&twoWay=true";MOOdalBox.open(e,"","594 306");}function showWarningOneButton(f,d,b,a){var g="..";if($defined(document.getElementById("magnoliaContextPathID"))){g=document.getElementById("magnoliaContextPathID").value;
}var e=g+"/error/warning.jsp?bundleKey="+f+"&value1="+d+"&value2="+b+"&value3="+a+"&twoWay=false&twoButton=false";MOOdalBox.open(e,"","594 306");}function checkDateNotAfterToday(f,a,b){if($(b).value!=null&&$(b).value!=""&&$(a).value!=null&&$(a).value!=""&&$(f).value!=null&&$(f).value!=""){var e=$(b).get("value")+"/"+$(a).get("value")+"/"+$(f).get("value");
var d=new Date(Date.parse(e));var j=new Date();if(d>j){var k=j.getDate();if(k<10){k="0"+k;}var g=j.getMonth()+1;if(g<10){g="0"+g;}var h=j.getFullYear();if(h<1900){h=1900+h;}$(f).value=k;$(a).value=g;$(b).value=h;}}}function checkBirthDate(g,f,h,e){var b=true;var a=new Date(Date.parse(h+"/"+f+"/"+g));
var d=new Date();d.setHours(0);d.setMinutes(0);d.setSeconds(0);d.setMilliseconds(0);d.setFullYear(d.getFullYear()-e);if(a>d){b=false;}return b;}function checkBirthDateBefore(g,f,h,e){var b=true;var a=new Date(Date.parse(h+"/"+f+"/"+g));var d=new Date();d.setHours(0);d.setMinutes(0);d.setSeconds(0);d.setMilliseconds(0);
d.setFullYear(d.getFullYear()-e);if(a<=d){b=false;}return b;}function checkBirthDateRange(f,a,e,h,k){var d=true;var j=new Date(Date.parse(e+"/"+a+"/"+f));var b=new Date();var g=new Date();b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);b.setFullYear(b.getFullYear()-h);g.setHours(0);
g.setMinutes(0);g.setSeconds(0);g.setMilliseconds(0);g.setFullYear(g.getFullYear()-k-1);if(j>b||j<=g){d=false;}return d;}function checkDateString(b,a,f){var d=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/;if(!d.test(b)){$(a).style.display="inline";changeDateStyle(a,f);return 1;}else{anno=parseInt(b.substr(6),10);
mese=parseInt(b.substr(3,2),10);giorno=parseInt(b.substr(0,2),10);var e=new Date(anno,mese-1,giorno);if(e.getFullYear()==anno&&e.getMonth()+1==mese&&e.getDate()==giorno){return 0;}else{$(a).style.display="inline";changeDateStyle(a,f);return 1;}}}function checkTimeString(g,a,f){var d=/^\d{1,2}:\d{2}$/;
if(!d.test(g)){$(a).style.display="inline";changeDateStyle(a,f);return 1;}else{var b=g.split(":");ora=parseInt(b[0],10);if(ora=="24"){ora="00";}if(ora=="0"){ora="24";}minuti=parseInt(b[1],10);var e=new Date(1970,0,1,ora,minuti,"00");if(e&&e.getHours()==ora&&e.getMinutes()==minuti){return 0;}else{$(a).style.display="inline";
changeDateStyle(a,f);return 1;}}}function checkDateRange(e,n,f,k,o){var d=true;var l=new Date(Date.parse(f+"/"+n+"/"+e));var m=parseInt(k/12);var j=k%12;var g=parseInt(o/12);var b=o%12;var h=new Date();h.setHours(0);h.setMinutes(0);h.setSeconds(0);h.setMilliseconds(0);h.setFullYear(h.getFullYear()+m);
h.setMonth(h.getMonth()+j);var a=new Date();a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);a.setFullYear(a.getFullYear()+g);a.setMonth(a.getMonth()+b);if(l>a||l<h){d=false;}return d;}function checkDateAfter(e,k,f,h){var d=false;var j=new Date(Date.parse(f+"/"+k+"/"+e));var g=parseInt(h/12);
var b=h%12;var a=new Date();a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);a.setFullYear(a.getFullYear()+g);a.setMonth(a.getMonth()+b);if(j>a){d=true;}return d;}function checkDateBefore(b,k,d,e){var a=false;var h=new Date(Date.parse(d+"/"+k+"/"+b));var j=parseInt(e/12);var g=e%12;
var f=new Date();f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0);f.setFullYear(f.getFullYear()+j);f.setMonth(f.getMonth()+g);if(h<f){a=true;}return a;}function isDateAfter(d,b){var a=false;var e=string2date(d);var f=string2date(b);if(e!=null&&f!=null){if(e>f){a=true;}}return a;}function string2date(b){try{var d=null;
var f=b.split("/");if(f.length==3){var j=f[0].toInt();var a=f[1].toInt();var g=f[2].toInt();d=new Date();d.setFullYear(g);d.setMonth(a-1);d.setDate(j);}}catch(h){}return d;}function highlightError(a,b){$(a).style.display="inline";highlightField(a);changeSelectStyle(a,b);changeTextStyle(a,b);}function highlightTextError(a,b){if(b==null){b=true;
}$(a).style.display="inline";highlightField(a);changeTextStyle(a,b);}function hideError(a){$(a).style.display="none";}function toggleRadio(a,e,d,b){if(!a.getElementsByTagName("input")[0].checked){if(d){if(b!=null){$(b).style.display="inline";}e.slideIn();}else{e.slideOut();}return void (0);}}function Netscape2(){return((self.navigator.appName=="Netscape")&&(parseInt(self.navigator.appVersion,10)<3));
}function Explorer2(){return((self.navigator.appName=="Explorer")&&(parseInt(self.navigator.appVersion,10)<3));}function sendInfoPage(e,b,d,a){if((Netscape2())||(Explorer2())){return;}popWindow_=window.open(e,b,"toolbar= no,status=yes,scrollbars=yes,alwaysLowered=0,alwaysRaised=1,directories=no,resizable=yes,resize=yes,menubar=no,height="+a+",width="+d);
popWindow_.focus();}function popUp(a){sealWin=window.open(a,"win","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450");self.name="mainWin";}function checkData(a){var b=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/;if(!b.test(a)){return false;}else{anno=parseInt(a.substr(6),10);
mese=parseInt(a.substr(3,2),10);giorno=parseInt(a.substr(0,2),10);var d=new Date(anno,mese-1,giorno);if(d.getFullYear()==anno&&d.getMonth()+1==mese&&d.getDate()==giorno){return true;}else{return false;}}}function highlightField(d){var a=$(d).parentNode.getElementsByTagName("input");for(var b=0;b<a.length;
b++){a[b].className+=" error_inp";}}function highlightRadio(b){var d=$(b).parentNode.getElementsByTagName("label");for(var a=0;a<d.length;a++){d[a].className+=" error_radio";}}function isMandatory(h,d,f,e){if(f==null){f=true;}if(e==null){e="";}var b=0;var g=0;var a=0;if($type(h)!="array"){$(d).style.display="none";
if($(h).value==e){$(d).style.display="inline";b++;highlightField(d);if($(h).type=="select-one"){changeSelectStyle(d,f);}else{if($(h).type=="text"){changeTextStyle(d,f);}}}}else{b++;$(d).style.display="none";for(a=0;a<h.length;a++){if($(h[a]).checked==true){g=1;}}b-=g;if(b>0){$(d).style.display="inline";
highlightRadio(d);}}return b;}function isDateMandatory(a,h,b,o,n,d,k,e){if(e==null){e=true;}var l=0;if(a==null||a==""||h==null||h==""||b==null||b==""){l++;changeDateStyle(o,e);$(o).style.display="inline";}if(l==0){var j=new Date();var g=j.getFullYear();var m=g-100;var f=g+100;if(b.length<4||b<m||b>f){l++;
changeDateStyle(n,e);$(n).style.display="inline";}}if(l==0){if(d!=null&&k!=null){if(!checkDateRange(a,h,b,d,k)){l++;changeDateStyle(n,e);$(n).style.display="inline";}}else{if(d!=null){if(checkDateBefore(a,h,b,d)){l++;changeDateStyle(n,e);$(n).style.display="inline";}}else{if(k!=null){if(checkDateAfter(a,h,b,k)){l++;
changeDateStyle(n,e);$(n).style.display="inline";}}}}}return l;}function changeDateStyle(d,f){var a=$(d).parentNode.getElementsByTagName("select");var e=$(d).parentNode.getElementsByTagName("input");for(var b=0;b<a.length;b++){a[b].className+=" error_select";if(f){a[b].onchange=function(){removeClass("error_select",this);
document.getElementById(d).style.display="none";for(var g=0;g<a.length;g++){removeClass("error_select",a[g]);a[g].onchange=null;}for(var g=0;g<e.length;g++){removeClass("error_inp",e[g]);e[g].onchange=null;}};}}for(var b=0;b<e.length;b++){e[b].className+=" error_inp";if(f){e[b].onchange=function(){removeClass("error_inp",this);
document.getElementById(d).style.display="none";for(var g=0;g<a.length;g++){removeClass("error_select",a[g]);a[g].onchange=null;}for(var g=0;g<e.length;g++){removeClass("error_inp",e[g]);e[g].onchange=null;}};}}}function isAlphabetic(a,b){$(b).style.display="none";if(!(/^[a-zA-Z' ]*$/.test($(a).value))){$(b).style.display="inline";
highlightField(b);return 1;}else{return 0;}}function isAlphabeticWithAccents(a,b){$(b).style.display="none";if(!(/^[a-zA-Zàòèéùì' ,.-]+$/.test($(a).value))){$(b).style.display="inline";highlightField(b);return 1;}else{return 0;}}function isAlphaNumeric(a,b){$(b).style.display="none";if(!(/^[a-zA-Z0-9]*$/.test($(a).value))){$(b).style.display="inline";
highlightField(b);return 1;}else{return 0;}}function isAlphaNumericWithAccents(a,b){$(b).style.display="none";if(!(/^[a-zA-Z0-9àòèéùì' ,.-]*$/.test($(a).value))){$(b).style.display="inline";highlightField(b);return 1;}else{return 0;}}function isAlphaNumericWithAccentsRagioneSoc(a,b){$(b).style.display="none";
if(!(/^[a-zA-Zàòèéùì0-9&' ,.-]*$/.test($(a).value))){$(b).style.display="inline";highlightField(b);return 1;}else{return 0;}}function isNumeric(a,b){$(b).style.display="none";if(!(/^[0-9]*$/.test($(a).value))){$(b).style.display="inline";highlightField(b);return 1;}else{return 0;}}function isEmail(a,b){$(b).style.display="none";
if($(a).value!=""&&!(/^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/.test($(a).value))){$(b).style.display="inline";highlightField(b);return 1;}else{return 0;}}function lengthConstraints(e,f,d,a){var b=0;if($(e).value!=""&&(d!=-1)&&($(e).value.length<d)){$(f).style.display="inline";
highlightField(f);b=1;}if($(e).value!=""&&(a!=-1)&&($(e).value.length>a)){$(f).style.display="inline";highlightField(f);b=1;}return b;}function changeSelectStyle(d,e){var a=$(d).parentNode.getElementsByTagName("select");for(var b=0;b<a.length;b++){a[b].className+=" error_select";if(e){a[b].onchange=function(){normalStyle(d);
};}}}function changeTextStyle(a,b){var d=$(a).parentNode.getElementsByTagName("input");if(b){d[0].addEvent("change",function(){normalStyle(a);});}}function normalStyle(d,b){$(d).style.display="none";if(b!=null){$(b).style.display="none";}var a=$(d).parentNode.getElementsByTagName("select");var f=$(d).parentNode.getElementsByTagName("input");
for(var e=0;e<a.length;e++){removeClass("error_select",a[e]);}for(var e=0;e<f.length;e++){removeClass("error_inp",f[e]);}}var validi=new Array("1","2","3","4","5","6","7","8","9","0");function isNum(e){for(var b=0;b<e.length;b++){var f=e.charAt(b);var d=false;for(var a=0;a<validi.length&&!d;a++){if(validi[a]==f){d=true;
}}if(!d){return false;}}return true;}function isWord(e){for(var b=0;b<e.length;b++){var f=e.charAt(b);var d=false;for(var a=0;a<validi.length&&!d;a++){if(validi[a]==f){return false;}}return true;}}var sla;function locValid(b,g,a,h){if(a==null){a="";}var e=500;var f;var d=$("loc").length;sla=$("sel_loc");
if(f){clearTimeout(f);}if(h==null||h==""){h="L";}d=b.length;if(isNum(b)){if(b.length==5){if(/^\d{2}[01589]\d{2}$/.test(b)){document.getElementById("loading").style.visibility="visible";f=setTimeout('loadLoc("'+b+'", "cap","'+g+'","'+a+'","'+h+'")',e);}else{$("loading").style.visibility="hidden";$("sel_loc").disabled="disabled";
f=setTimeout("hideLoc()",500);}}else{$("loading").style.visibility="hidden";$("sel_loc").disabled="disabled";f=setTimeout("hideLoc()",500);}}else{if(isWord(b)){$("loading").style.visibility="visible";f=setTimeout('loadLoc("'+b+'", "loc","'+g+'","'+a+'","'+h+'")',e);$("loading").style.visibility="visible";
$("sel_loc").disabled="disabled";}else{$("loading").style.visibility="hidden";$("sel_loc").disabled="disabled";f=setTimeout("hideLoc()",500);}}}function displayLoc(){removeClass("error_select",$("sel_loc"));$("loc").removeProperty("disabled");$("loc").addClass("text");$("comboLocalitaError").setStyle("display","none");
$("loading").setStyle("visibility","hidden");$("sel_loc").removeProperty("disabled");}function hideLoc(){$("loading").style.visibility="hidden";if($("sel_loc").value==null||$("sel_loc").value=="-1"||$("sel_loc").value==""){$("sel_loc").disabled="disabled";}}var indMap={set:function(a,b){this[a]=b;},get:function(a){return this[a];
},isEmpty:function(){c=0;for(var a in this){c++;}if(c>3){return false;}return true;}};function loadLoc(a,f,e,b,h){if(f=="cap"){var g="jsonFactory.searchLocalityByZipCode";}else{var g="jsonFactory.searchLocalityByDescription";}sla.empty();var d=new Request.JSON({url:host,data:JSON.encode({"id":2,"method":g,"params":[a,e,h]}),onRequest:function(){$("loading").setStyle("visibility","visible");
$("loc").setProperty("disabled","disabled");},onLoading:function(){$("loading").setStyle("visibility","visible");$("loc").setProperty("disabled","disabled");},onComplete:function(l){var k=0;sla.empty();jsonLoc=JSON.decode(l.result.locs);var m=new Element("option",{"value":""}).set("html",selLocalita).inject(sla,"top");
jsonLoc.each(function(o){var n=new Element("option");if(f=="loc"){if(o.capVis){n.set("html",o.loc+", "+o.capVis);}else{n.set("html",o.loc);}}else{if(o.capVis){n.set("html",o.capVis+", "+o.loc);}else{n.set("html",o.loc);}}n.setProperty("value",o.loc);valoreOpt=o.loc+", "+o.cap+", "+o.pr+", "+o.codLoc+", "+o.key;
indMap.set(o.loc,valoreOpt);if(b==n.value){n.setProperty("selected","selected");}n.inject(sla);k++;});if(!k){sla.empty();var j=new Element("option",{"value":""}).set("html",locNotFound).inject(sla);$("loading").setStyle("visibility","hidden");$("sel_loc").setProperty("disabled","disabled");$("loc").removeProperty("disabled");
$("loc").addClass("text");}else{if(k==1){m.dispose();}}displayLoc();}}).send();}var charCount,oldCharCount,newCharCount;function checkPasteFF(a,b){newCharCount=a;oldCharCount=charCount;charCount=newCharCount;if(newCharCount!=oldCharCount){setTimeout(b,1);}}function pasteEvent(a){if(navigator.userAgent.match("MSIE")){setTimeout(a,1);
}}function ricercaProfessioni(a,g,d,b){var e=500;var f;if(f){clearTimeout(f);}if(a.length>2){if(b==null){b="";}f=setTimeout('loadProfessioni("'+a+'", "'+g+'", "'+d+'", "'+b+'")',e);}}function loadProfessioni(f,e,d,a){var b=new Request.JSON({url:host,data:JSON.encode({"id":2,"method":"jsonFactory.searchProfessioni","params":[f,e]}),onRequest:function(){$(d).style.visibility="visible";
$("professione").disabled="true";},onLoading:function(){$("professione").disabled="true";},onComplete:function(j){$(d).style.visibility="hidden";$("professione").innerHTML="";objson=(JSON.decode(j.result.jobs));objson.each(function(n){var m=document.createElement("option");m.value=n.codProfess+"#"+n.descrProfess+"#"+n.codGruppoProfess;
m.innerHTML=n.descrProfess;if(m.value==a){m.selected="selected";}$("professione").appendChild(m);$("professione").disabled=null;});if($("professione").options.length==0){var k=document.createElement("option");k.value="";k.innerHTML="Nessun risultato trovato";$("professione").appendChild(k);$("professione").disabled="disabled";
}else{var l=document.createElement("option");l.value="";l.text="Seleziona";var h=$("professione").options[0];try{$("professione").add(l,h);}catch(g){$("professione").add(l,0);}$("professione").disabled="";$("professione").value=a;}}}).send();}var oldCivicNumber;function getAddress(a,b,e){if(oldCivicNumber!=a.value){oldCivicNumber=a.value;
$("inpCap").value="";if(b==null){b="";}var f;var d=$("address").value;var h=$("loadingAddress");if(a.value.length>0&&d.length>0){locVL=d.length;locV=d;locAdv.slideIn();showLoading();(f)?clearTimeout(f):void (0);var g=$("placeType");$$("#selLocAdvanced option").each(function(j){if(j.value!=0&&j.value!=-1){j.parentNode.removeChild(j);
}});f=setTimeout('searchAddress("", "'+d+'", "'+search_provincia+'", "'+search_cap+'", "'+search_descloc+'", "'+search_codloc+'", "'+session_id+'", "'+h+'", "'+b+'", "'+e+'")',500);}else{if(d.length<=1){return false;}}}}function showLocs(){$("loadingAddress").fade("out");$("locAdvanced").fade("in");}function showLoading(){$("loadingAddress").fade("in");
$("locAdvanced").fade("out");locAdv.slideIn();}function searchAddress(e,g,b,a,l,d,f,m,j,k){var h=new Request.JSON({url:host,async:false,data:JSON.encode({"id":2,"method":"jsonFactory.searchAddress","params":[e,g,b,a,l,d,f]}),onRequest:function(){showLoading();},onLoading:function(){showLoading();},onComplete:function(n){$("selLocAdvanced").innerHTML="";
var p=document.createElement("option");p.value="0";p.innerHTML=selAddress;$("selLocAdvanced").appendChild(p);var o=document.createElement("option");o.value="-1";o.innerHTML=addrNotFound;$("selLocAdvanced").appendChild(o);objson=(JSON.decode(n.result.indirizzi));if(objson!=null&&objson!=""){objson.each(function(s){var r=document.createElement("option");
r.value=s.address+"#"+s.addressSpec+"#"+s.addressZipCode;r.innerHTML=s.addressSpecDesc+" "+s.address+" "+s.addressZipCode+" "+s.positionDesc;$("selLocAdvanced").appendChild(r);$("selLocAdvanced").disabled=null;showLocs();if(j!=""){var t=$("selLocAdvanced").options;for(var q=0;q<t.length;q++){if(t[q].value&&j&&t[q].value.toUpperCase()==j.toUpperCase()){t[q].setAttribute("selected",true);
}}if(t.value==""){for(var q=0;q<t.length;q++){if(t[q].value=="-1"){t[q].setAttribute("selected",true);}}}}if(k=="1"&&s.selected=="1"){r.setAttribute("selected",true);}setTimeout('checkCap($("selLocAdvanced"))',1);});}else{$("selLocAdvanced").disabled=null;showLocs();}}}).send();}(function(){function b(e,f,g,d){e=$(e);
f.type=f.type||"LOC";return new Request.JSON({url:host,data:JSON.encode({id:2,method:g||"jsonFactory.searchAddress",params:f.data}),onRequest:function(){var h=new Element("option",{value:(f.type=="CAP")?"":"0"}).set("html",(f.type=="CAP")?selLocalita:selAddress);e.empty().adopt([h]).setProperty("disabled","disabled");
e._info_address=h;$("loading_"+e.id).setStyle("visibility","visible");},onCancel:function(){$("loading_"+e.id).setStyle("visibility","hidden");},onFailure:function(){$("loading_"+e.id).setStyle("visibility","hidden");},onComplete:function(k){var j="";if(k.result.removeOrInsertSuperClass){j=k.result.removeOrInsertSuperClass;
}if(j!=""){manageSuperClass(j);}var l=JSON.decode(k.result.indirizzi||k.result.locs);e.erase("disabled");if(l.length){if(f.type=="LOC"){var h=new Element("option",{value:"-1",selected:true}).set("html",addrNotFound);e.adopt(h)._no_address=h;}l.each(function(n){var m=new Element("option",{});switch(f.type){case"CAP":m.set({value:[n.loc,n.cap,n.pr,"#",n.key].join(","),html:n.capVis?n.capVis+", "+n.loc:n.loc}).inject(e);
break;case"LOC":m.set({value:[n.address,n.addressSpec,n.addressZipCode].join("#"),html:[n.addressSpecDesc,n.address,n.addressZipCode,n.positionDesc].join(" ")}).inject(e);break;}});}else{var h=new Element("option",{value:"-1",selected:true}).set("html",(f.type=="CAP")?locNotFound:addrNotFound);e.adopt(h)._no_address=h;
if(f.type!=="LOC"){e._info_address.dispose();}}(d||function(){})(l,this);$("loading_"+e.id).setStyle("visibility","hidden");}}).send();}function a(f,g,d,e){f=$(f);$clear(f._timer);f._timer=(function(){if(f._ajax){f._ajax.cancel();}f._ajax=b(f,g,g.method,function(j,l){try{delete f._ajax;}catch(k){f._ajax=undefined;
}d=d||"0";var h=f.getElements("option").some(function(o,n,m){if(d.toLowerCase()===o.value.toLowerCase()){f.selectedIndex=n;return !!o.set("selected",true);}return false;});if((e||function(){})(j,l)===false){return;}});}).delay(100);}window.localities_by_zipcode=function(f,h,g,d,e){f=$(f)||f;f=f.value||f;
h=$(h);if(/^\d{2}[01589]\d{2}$/.test(f)){a(h,{method:"jsonFactory.searchLocalityByZipCode",data:[f,"",g],type:"CAP"},d,function(j,k){if(h.getElements("option").length==2){h._info_address.dispose();}(e||function(){})(j,k);});}else{h.set("disabled","disabled");}return true;};window.localities_by_address=function(d,k,j,m,g,e,l,f,h){k=$(k)||k;
k=k.value||k;d=$(d);if(!$(l).value){return;}if(k){a(d,{data:["",k,j,m,g,e,""],type:"LOC"},f,function(n,o){(h||function(){})(n,o);});}};window.select_address=function(k,h,d,g,f){k=$(k);h=$(h);d=$(d);g=$(g);var j=k.options[k.selectedIndex];if(j.value&&(j!==k._no_address)&&(j.value!=="0")){var e=j.value.split("#");
d.value=e[0];h.getElements("option").some(function(l){if(l.value==e[1]){return !!l.set("selected",true);}return false;});g.value=e[2];}(f||function(){})(j.value&&(j!==k._no_address),j);};})();function updateSelectList(a){for(i=0;i<a.length;i++){if($(a[i])!=null&&$(a[i]).value!=""){$$("#"+a[i]+" option").each(function(b){if(b.value==""){b.parentNode.removeChild(b);
}});}}}function isNumberKey(b){var a=(b.which)?b.which:b.keyCode;return isNumberKeyBase(a);}function isNumberKeyBase(a){if(a>31&&(a<48||a>57)&&a!=46&&a!=37&&a!=39){return false;}return true;}CustomSlide=new Class({Extends:Fx.Slide,onComplete:function(){if(this.wrapper.offsetHeight!=0){this.wrapper.setStyle("height","auto");
}},slideIn:function(a){this.element.style.display="inline";this.open=true;return this.start("in",a);},slideOut:function(a){this.open=false;return this.start("out",a);},show:function(a){this.element.style.display="inline";this[a||this.options.mode]();this.open=true;return this.set([0,this.offset]);}});
function cleanErrorInPage(){var f=$$(".error");var g=new Array("error_select","error_inp","error_radio");for(var d=0;d<f.length;d++){f[d].style.display="none";}for(var a=0;a<g.length;a++){var b=g[a];var e=$$("."+b);for(var d=0;d<e.length;d++){removeClass(b,e[d]);}}}var checkZonato=false;function checkCapZonato(b,d){var a=new Request.JSON({url:host,async:false,data:JSON.encode({"id":2,"method":"jsonFactory.isCapZonato","params":[b,d]}),onRequest:function(){},onLoading:function(){},onComplete:function(e){objson=(JSON.decode(e.result.isZon));
objson.each(function(f){checkZonato=f.isZonato;});}}).send();}var validPIVA;function checkPartitaIVA(d,b){var a=new Request.JSON({url:host,async:false,data:JSON.encode({"id":2,"method":"jsonFactory.isValidPIVA","params":[d,b]}),onRequest:function(){},onLoading:function(){},onComplete:function(e){objson=(JSON.decode(e.result.risultato));
objson.each(function(f){validPIVA=f.isValidIVA;});}}).send();}var validPresso;function checkPresso(b){var a=new Request.JSON({url:host,async:false,data:JSON.encode({"id":2,"method":"jsonFactory.checkPresso","params":[b]}),onRequest:function(){},onLoading:function(){},onComplete:function(d){objson=(JSON.decode(d.result.risultato));
objson.each(function(e){validPresso=e.isValidPresso;});}}).send();}var validCF;function checkCF(b,d,h,g,j,a,e){var k="jsonFactory.checkCF";var f=new Request.JSON({url:host,async:false,data:JSON.encode({"id":2,"method":k,"params":[b,d,h,g,j,a,e]}),onRequest:function(){},onLoading:function(){},onComplete:function(l){objson=(JSON.decode(l.result.risultato));
objson.each(function(m){validCF=m.isValidCF;});}}).send();}function disableControls(b){var a=($(document.body).getElement("div.container")||document.body).offsetHeight;if(!a||a==""||a==0){a="200%";}else{a=a+"px";}var d=new Element("div",{"styles":{"position":"absolute","top":"0px","left":"0px","background":"#ffffff","z-index":"99999","height":a,"width":"100%"},id:"mod"}).injectInside($(document.body));
if(Explorer()){d.setStyle("opacity",0.1);}else{d.setStyle("background-color","transparent");}}function Explorer(){return(self.navigator.appName.contains("Explorer"," "));}function traccia(b,d,a){if(b.tagName=="LABEL"){pageTracker._trackEvent(d,b.getElementsByTagName("input")[0].name+"_"+b.getElementsByTagName("input")[0].value,a);
}else{if(b.value!=""){pageTracker._trackEvent(d,b.name+"_riempito",a);}else{pageTracker._trackEvent(d,b.name+"_vuoto",a);}}}function checkTarga(a){var b=a.value;var b=b.toLowerCase();if(b.slice(0,3)=="rsm"){var b="RSM"+b.substr(3);document.getElementById("targa1").value=b;document.getElementById("targa1").disabled=false;
return true;}else{if(b.slice(0,3)=="scv"){var b="SCV"+b.substr(3);a.value=b;a.disabled=false;return true;}else{if(b.slice(0,4)=="roma"){var b="RM"+b.substr(4);a.value=b;a.disabled=false;return true;}}}var e=/[a-zA-Z]{2} *\d{6}|[a-zA-Z]{2} *\d{3} *[a-zA-Z]{2}|[a-zA-Z]{2}[a-zA-Z]{2}[0-9]{6}|[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{5}|[a-zA-Z]{2}[a-zA-Z]{1}[0-9]{5}|[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{1}[0-9]{4}|[a-zA-Z]{2}[0-9]{5}[a-zA-Z]{1}|[a-zA-Z]{2}[0-9]{2}[a-zA-Z]{1}[0-9]{3}/;
if(e.test(b)==false){function d(){this.value="";this.onfocus=null;this.removeClass("error_msg");this.style.textTransform="uppercase";}a.style.textTransform="none";a.value="errore targa";a.addClass("error_msg");a.onfocus=d;return false;}else{a.value=b;a.disabled=false;}}function formatTarga(a){if(a.value.length<=2){a.value=a.value.replace(/\d/,"");
}}function checkMassimale(b,a){if(b==garanziaRCTest&&a.value==valoreMassimaleTest&&versioneCondizioni>verCondizioniTest){MOOdalBox.open("../error/massimale.jsp","","moodalbox 594 306");}}function validateEmailDomain(d,e){var b="jsonFactory.validateEmailDomain";var a=new Request.JSON({url:host,data:JSON.encode({"id":1,"method":b,"params":[d.value]}),onRequest:function(){$(e).style.display="none";
this.disabled="true";},onLoading:function(){$(e).style.display="none";this.disabled="true";},onComplete:function(f){this.disabled="";if(!f){return this;}objson=JSON.decode(f.result.esito);if(objson==false){$(e).style.display="inline";}}}).send();}function validatePhoneNumber(j,e,a,g,h,f,d){var b=0;if((($(j).value!=null&&$(j).value!="")&&($(g).value==null||$(g).value==""))||(($(j).value==null||$(j).value=="")&&($(g).value!=null&&$(g).value!=""))){$(d).style.display="inline";
highlightField(d);b++;}else{if($(j).value!=null&&$(j).value!=""&&$(g).value!=null&&$(g).value!=""){b+=isNumeric(j,d);if(b==0){b+=isNumeric(g,d);}if(b==0){b+=lengthConstraints(j,d,e,a);b+=lengthConstraints(g,d,h,f);}}}return b;}
