window.addEvent("domready",function(){setFs("getFromCookie");styleInputs();styleRadios();styleChecks();$$("ul.secondLevel li:first-child a").each(function(a){a.addClass("firstChild");});$$(".areaPersonaleBtn").addEvent("click",function(){$$("#datiAreaPersonale").tween("visibility",["hidden","visible"]);
});$$(".btn_login_close").addEvent("click",function(){$$("#datiAreaPersonale").tween("visibility",["visible","hidden"]);});});function autoBlur(){$$("a").each(function(a){a.addEvent("focus",function(){this.blur();});});}function getElementsByClassName(b,f,a){var e=(f=="*"&&b.all)?b.all:b.getElementsByTagName(f);
var h=new Array();a=a.replace(/\-/g,"\\-");var g=new RegExp("(^|\\s)"+a+"(\\s|$)");var d;for(var c=0;c<e.length;c++){d=e[c];if(g.test(d.className)){h.push(d);}}return(h);}var fs={"min":"12px","mid":"13px","max":"14px"};function styleInputs(){allTextInps=$$(".text");for(var a=0;a<allTextInps.length;a++){allTextInps[a].addEvent("focus",function(){this.className+=" focused";
if(this.className.match("error_inp")){removeClass("error_inp",this);var c=$$(".errorbox")[0];if(c){c.style.display="none";var b="error"+(c.id.substr(c.id.length-1));$(b).style.display="none";}}});allTextInps[a].addEvent("blur",function(){removeClass("focused",this);});}allSubInps=document.getElementsByTagName("input");
for(var a=0;a<allSubInps.length;a++){if(allSubInps[a].type=="submit"){allSubInps[a].onmouseover=function(){this.className+=" active";};allSubInps[a].onmouseout=function(){removeClass("active",this);};}}}function styleRadios(){allRadioInps=$$(".radio");var b="..";if($defined(document.getElementById("magnoliaContextPathID"))){b=document.getElementById("magnoliaContextPathID").value;
}for(var a=0;a<allRadioInps.length;a++){allRadioInps[a].parentNode.style.background="url("+b+"/genialloyd/img/radio_noBack.gif) no-repeat top left";allRadioInps[a].parentNode.style.paddingLeft=35+"px";if(allRadioInps[a].parentNode.tagName=="LABEL"){if(navigator.userAgent.match("MSIE")!=null){allRadioInps[a].parentNode.onmousedown=function(d){d=d||event;
if(d["srcElement"]&&d["srcElement"].tagName!="A"){allLabels=this.parentNode.getElementsByTagName("label");for(var c=0;c<allLabels.length;c++){allLabels[c].className="normal";}this.className="selected";var f=getElementsByClassName(this.parentNode,"div","error")[0];if(f){f.style.display="none";}}};}else{allRadioInps[a].parentNode.onmousedown=function(d){if(d&&d.target.tagName!="A"){allLabels=this.parentNode.getElementsByTagName("label");
for(var c=0;c<allLabels.length;c++){allLabels[c].className="normal";}this.className="selected";var e=getElementsByClassName(this.parentNode,"div","error")[0];if(e){e.style.display="none";}}};}allRadioInps[a].parentNode.onmouseover=function(){if(!this.getElementsByTagName("input")[0].checked){if(!this.className.match("error")){this.className+=" hover";
}else{this.className+=" err_hover";}}};allRadioInps[a].parentNode.onmouseout=function(){if(!this.getElementsByTagName("input")[0].checked){if(!this.className.match("error")&&!this.className.match("selected")){removeClass("hover",this);}else{removeClass("err_hover",this);}}};if(allRadioInps[a].checked){allRadioInps[a].parentNode.className="selected";
}}}}function styleChecks(){$$("label.check").each(function(a){removeClass("check",a);a.className+=" styledCheck";(a.getElementsByTagName("input")[0].checked)?a.className+=" labChecked":void (0);a.addEvent("click",function(){if(!(this.className.contains("labDisabled"))){if(this.getElementsByTagName("input")[0].checked){removeClass("labChecked",this);
this.getElementsByTagName("input")[0].checked=null;}else{this.className+=" labChecked";this.getElementsByTagName("input")[0].checked=true;}}return false;});});}function setFs(c){var b=0;if(c=="getFromCookie"){if(Cookie.read("genialloyd_font_size")){b=Cookie.read("genialloyd_font_size");document.body.style.fontSize=fs[b];
($$("."+b)[0])?$$("."+b)[0].style.textDecoration="none":void (0);}else{($$(".min")[0])?$$(".min")[0].style.textDecoration="none":void (0);}}else{if(c.className){$$(".charResize a").each(function(a){a.style.textDecoration="underline";});c.blur();c.style.textDecoration="none";b=fs[c.className];document.body.style.fontSize=b;
Cookie.write("genialloyd_font_size",c.className,{duration:365});}}return false;}function removeClass(c,b){var a=new RegExp("(\\b|^)"+c+"(\\b|$)","gi");if(a.test(b.className)){b.className=b.className.replace(a,"");return true;}return false;}function replaceClass(d,a,c){var b=new RegExp("(\\b|^)"+d+"(\\b|$)","gi");
if(b.test(c.className)){c.className=c.className.replace(b,a);return true;}return false;}function accordionPage(e){var a;try{e.contains(1);a=e;}catch(er){a=new Array();a.push(e);}$$(".accordionContent").each(function(e,i){e.id="accordion_"+i;if(a.contains(i)){eval("_acc_"+i+" = new Fx.Slide('accordion_"+i+"');");
}else{eval("_acc_"+i+" = new Fx.Slide('accordion_"+i+"').hide();");}});$$(".exp").each(function(e,i){if(a.contains(i)){e.className="coll";}e.id="trig_"+i;e.addEvent("focus",function(){this.blur();});e.addEvent("click",function(){if(this.className=="exp"){this.className="coll";eval("_acc_"+this.id.split("trig_")[1]+".cancel();");
eval("_acc_"+this.id.split("trig_")[1]+".slideIn();");}else{this.className="exp";eval("_acc_"+this.id.split("trig_")[1]+".cancel();");eval("_acc_"+this.id.split("trig_")[1]+".slideOut();");}if($$("a.coll").length==0&&$$(".btn_collExp")[0]){replaceClass("collAll","expAll",$$(".btn_collExp")[0]);$$(".btn_collExp")[0].innerHTML=btn_collExp_expand;
$$(".btn_collExp")[0].title=btn_collExp_expand;}else{if($$("a.coll").length==$$(".accordionContent").length&&$$(".btn_collExp")[0]){replaceClass("expAll","collAll",$$(".btn_collExp")[0]);$$(".btn_collExp")[0].innerHTML=btn_collExp_collapse;$$(".btn_collExp")[0].title=btn_collExp_collapse;}}});});$$(".accordionContent").each(function(e,i){e.parentNode.className="mooDiv";
});$$(".btn_collExp").addEvent("focus",function(){this.blur();});$$(".btn_collExp").addEvent("click",function(){if(this.className.match("expAll")){replaceClass("expAll","collAll",this);$$(".btn_collExp")[0].innerHTML=btn_collExp_collapse;$$(".btn_collExp")[0].title=btn_collExp_collapse;$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".cancel();");
});$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".slideIn();");});$$(".exp").each(function(e,i){replaceClass("exp","coll",e);});}else{replaceClass("collAll","expAll",this);$$(".btn_collExp")[0].innerHTML=btn_collExp_expand;$$(".btn_collExp")[0].title=btn_collExp_expand;$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".cancel();");
});$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".slideOut();");});$$(".coll").each(function(e,i){replaceClass("coll","exp",e);});}return false;});}function expandAll(){replaceClass("expAll","collAll",$$(".btn_collExp"));$$(".btn_collExp")[0].innerHTML=btn_collExp_collapse;$$(".btn_collExp")[0].title=btn_collExp_collapse;
$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".cancel();");});$$(".accordionContent").each(function(e,i){eval("_acc_"+i+".slideIn();");});$$(".exp").each(function(e,i){replaceClass("exp","coll",e);});}function promoSlider(){$$(".promoBoxStatic").each(function(e,i){window.addEvent("domready",function(){replaceClass("promoBoxStatic","promoBox",e);
eval("var pInd"+i+" = 1;");eval("var _slid"+i+" = createSlider('promoWrapper'+"+i+");");$$("#promoBox"+i+" .controlBox a").addEvent("click",function(){this.blur();eval("_slid"+i+".toElement('promo"+i+"_'+this.innerHTML);");eval("pInd"+i+" = parseInt(this.innerHTML);");$$("#promoBox"+i+" .controlBox a").each(function(e){removeClass("selected",e);
});this.className+=" selected";return false;});$$("#promoBox"+i+" a.trigger").each(function(e){e.addEvent("focus",function(){this.blur();});});$$("#promoBox"+i+" .controlBox a").each(function(e){e.addEvent("focus",function(){this.blur();});});$$("#promoBox"+i+" a.trigger").addEvent("click",function(){if(this.getElementsByTagName("img")[0].title=="Successivo"&&eval("pInd"+i)<3){eval("pInd"+i+"++;");
$$("#promoBox"+i+" .controlBox a").each(function(e){removeClass("selected",e);});$$("#promoBox"+i+" .controlBox a")[eval("pInd"+i+"-1")].className+=" selected";eval("_slid"+i).toElement(eval("'promo"+i+"_'+"+"pInd"+i));}else{if(this.getElementsByTagName("img")[0].title=="Precedente"&&eval("pInd"+i)>1){eval("pInd"+i+"--;");
$$("#promoBox"+i+" .controlBox a").each(function(e){removeClass("selected",e);});$$("#promoBox"+i+" .controlBox a")[eval("pInd"+i+"-1")].className+=" selected";eval("_slid"+i).toElement(eval("'promo"+i+"_'+"+"pInd"+i));}}return false;});});function createSlider(e){var _slider=new Fx.Scroll(e,{offset:{"x":0,"y":0},wait:false,duration:800,wheelStops:false,onStart:function(a){var pd=a.id.charAt(a.id.length-1);
$$(".controlBox")[pd].set("tween",{duration:150});$$(".controlBox")[pd].fade("out");},onComplete:function(a){var pd=a.id.charAt(a.id.length-1);$$(".controlBox")[pd].set("tween",{duration:150});$$(".controlBox")[pd].fade("in");}});return _slider;}});}function setTabsInPage(){$$("div.tabCont").each(function(a){removeClass("noJS",a);
});$$("div.tabHeadCont a").each(function(a){a.addEvent("focus",function(){this.blur();});a.addEvent("click",function(){var d=this;var c;this.parentNode.parentNode.parentNode.parentNode.getElements("a").each(function(f,e){if(f==d){c=e;}removeClass("currentTab",f);});this.className="currentTab";var b=this.parentNode.parentNode.parentNode.parentNode;
b.getElements("div.innerTabCont").each(function(f,e){removeClass("showTab",f);if(c==e){f.addClass("showTab");}if(f.style.direction=="ltr"){f.style.direction="";f.style.direction="ltr";}else{f.style.direction="ltr";}});if(navigator.userAgent.match("MSIE")){$$(".showTab a.exp",".showTab a.coll").each(function(e){if(e.style.direction=="ltr"){e.style.direction="";
e.style.direction="ltr";}else{e.style.direction="ltr";}});}});});}Request.HTML.implement({processHTML:function(c){var b=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d="<root>"+c+"</root>",g;if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM");
g.async=false;g.loadXML(d);}else{g=new DOMParser().parseFromString(d,"text/xhtml");}d=g.getElementsByTagName("root")[0];for(var f=0,e=d.childNodes.length;f<e;f++){var h=Element.clone(d.childNodes[f],true,true);if(h){a.grab(h);}}return a;})||a.set("html",c);}});
