sessionActive=!1;var numFotos=2; function echeck(a){var c=a.indexOf("@"),b=a.length;a.indexOf(".");if(a.indexOf("@")==-1)return alert(emailValidoJS),!1;if(a.indexOf("@")==-1||a.indexOf("@")==0||a.indexOf("@")==b)return alert(emailValidoJS),!1;if(a.indexOf(".")==-1||a.indexOf(".")==0||a.indexOf(".")==b)return alert(emailValidoJS),!1;if(a.indexOf("@",c+1)!=-1)return alert(emailValidoJS),!1;if(a.substring(c-1,c)=="."||a.substring(c+1,c+2)==".")return alert(emailValidoJS),!1;if(a.indexOf(".",c+2)==-1)return alert(emailValidoJS),!1;if(a.indexOf(" ")!= -1)return alert(emailValidoJS),!1;return!0}function controllaLogin(a){var c=a.nickName;if(c.value==null||c.value=="")return alert(usernameVaildaJS),c.focus(),!1;a=a.userPassword;if(a.value==null||a.value=="")return alert(passwordValidaJS),a.focus(),!1} function controllaRegistrazione(a,c,b,d){var e=a.nickName,f=a.userPassword,g=a.userPassword2,k=!0;if(d!="mioAccount")if(e.value==null||e.value=="")return alert(usernameVaildaRegJS),e.focus(),unBlockElement("#TooltipContainer"),!1;else{string=e.value;for(var h=0;h<string.length;h++)if("_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(string.charAt(h))<0)return alert(usernameVaildaRegJS),e.focus(),unBlockElement("#TooltipContainer"),!1}d=="mioAccount"&&f!=null&&g!=null&&(k=f.value== ""||g.value==""?!1:!0);e=a.email;if(e.value==null||e.value=="")return alert(emailValidaRegJS),e.focus(),unBlockElement("#TooltipContainer"),!1;if(echeck(e.value,c)==!1)return e.value="",e.focus(),unBlockElement("#TooltipContainer"),!1;c=a.azione.value;if(d=="mioAccount"&&f!=null&&g!=null&&k&&(f.value==null||f.value==""||f.value!=userPassword2ID.value))return alert(passwordnoncorrispondeRegJS),f.value="",userPassword2ID.value="",f.focus(),unBlockElement("#TooltipContainer"),!1;if(c!="modify"&&a.lettoPrivacy.checked== !1)return alert(accettareprivacyRegJS),unBlockElement("#TooltipContainer"),!1;if(b=="13")return unBlockElement("#TooltipContainer"),!1;blockElement("#TooltipContainer");return!0}function rateProdotto(a){document.getElementById("ratedStar").value=a} function controllaComment(a,c,b,d,e,f){if(c){if(d==2)a=document.getElementById("postCommentTopic"),a.nomeAnonimo.value=e,a.idAnonimo.value=f;c=a.comment;b=a.oggetto;if(c.value==null||c.value=="")return alert(inserireannuncioocommentoJS),c.focus(),!1;else if(b.value==null||b.value=="")return alert(inserireoggettoJS),b.focus(),!1;a.submit()}else ajaxInner(1,"toolTip","postCommentTopic",b)} function controllaInviopassword(a,c){var b=a.email;if(b.value==null||b.value=="")return alert(inserireMailValidaJS),b.focus(),!1;if(echeck(b.value,c)==!1)return b.value="",b.focus(),!1;blockElement("#TooltipContainer");return!0} function controllaInviaAmico(a,c){var b=[],b=["emailFrom","emailTo"];for(i=0;i<a.elements.length;i++)for(j=0;j<b.length;j++)if(a.elements[i].name==b[j]&&echeck(a.elements[i].value,c)==!1)return b[j]=="emailFrom"?alert(indirizzotuoemailvalidoJS):alert(inserireMailValidaJS),a.elements[i].focus(),!1;blockElement("#TooltipContainer");a.submit()} function controllaRispondiAnnuncio(a,c){var b=[],b=["emailFrom"];for(i=0;i<a.elements.length;i++)for(j=0;j<b.length;j++)if(a.elements[i].name==b[j]&&echeck(a.elements[i].value,c)==!1)return a.elements[i].focus(),!1;blockElement("#TooltipContainer");return!0} function controllaAnnuncio(a,c,b){var d=[],d=["catSelect","title","comment"];for(i=0;i<a.elements.length;i++)for(j=0;j<d.length;j++)if(a.elements[i].name==d[j]&&(a.elements[i].value=="0"||a.elements[i].value==""||a.elements[i].value==null))return c=d[j],c=="catSelect"?alert(sceglisottocategoriaJS):c=="title"?alert(indicatitoloappropriatoJS):alert(descriviannuncioJS),a.elements[i].focus(),!1;if(c!=1)return ajaxInner(1,"toolTip","postComment",b),!1;blockElement("#TooltipContainer");a.submit()} function controllaConsiglio(a,c,b){var d=[],d=["catSelect","title","comment"];for(i=0;i<a.elements.length;i++)for(j=0;j<d.length;j++)if(a.elements[i].name==d[j]&&(a.elements[i].value=="0"||a.elements[i].value==""||a.elements[i].value==null))return c=d[j],c=="catSelect"?alert(sceglisottocategoriaConJS):c=="title"?alert(titoloappropriatoConsJS):alert(descriviconsiglioJS),a.elements[i].focus(),!1;if(c!=1)return ajaxInner(1,"toolTip","postComment",b),!1;a.submit()} function controllaSaveProduct(a,c,b){if(c!=1)return ajaxInner(1,"toolTip","postComment",b),!1;a.submit()} function addRowToTable(a){if(numFotos>3)return alert("Max 3 pictures!"),!0;var a=document.getElementById(a),c=a.rows.length,b=a.insertRow(c),d=b.insertCell(0);d.innerHTML="<div>Pic "+numFotos+":</div>";b=b.insertCell(1);d=document.createElement("input");d.type="file";d.name="foto["+numFotos+"]";d.size=20;b.appendChild(d);b=a.insertRow(c+1);d=b.insertCell(0);d.innerHTML="<div>Text "+numFotos+":</div>";b=b.insertCell(1);d=document.createElement("input");d.type="text";d.name="didascalia["+numFotos+"]"; d.size=50;b.appendChild(d);numFotos++} function voteFunction(a,c,b){var d=getCookie("votati"),d=d==null?"":d;if(d.indexOf("|"+a+"|")>-1)return!1;setCookie("votati",d+"|"+a+"|",365);pv=document.getElementById("posVotes").innerHTML;pv=pv.replace("(","");pv=pv.replace(")","");nv=document.getElementById("negVotes").innerHTML;nv=nv.replace("(","");nv=nv.replace(")","");pv*=1;nv*=1;c=="up"?(pv++,document.getElementById("posVotes").innerHTML="("+pv+")"):(nv++,document.getElementById("negVotes").innerHTML="("+nv+")");document.getElementById("percVotes").innerHTML= Math.round(pv/(pv+nv)*100);ajaxInner(22,"suggestionVote",a,c,b)}function removeSavedOffer(a,c,b){divId="slice-"+a+"-"+c;ajaxInner(23,divId,a,c,b)} function openWindow(a,c,b,d){if(d=="noPop")window.location.href=b;else{if(typeof b=="undefined"||b=="")b="scrollbars=yes,toolbar=yes,location=yes,directories=yes,menubar=yes,resizable=yes,status=yes";d=screen.width*0.8;d<780&&(d=780);var e=screen.height*0.8;e<420&&(e=420);b+=",top=0,left=0,width="+d+",height="+e;d=="travel"?(win=window.open(a,"",b),win!=null&&win!="null"&&win!="undefined"&&setTimeout(function(){win.focus()},1E3)):window.open(a,c,b)}} function accentsTidy(a){a=a.replace(RegExp("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]","g"),"a");a=a.replace(RegExp("\u00e6","g"),"ae");a=a.replace(RegExp("\u00e7","g"),"c");a=a.replace(RegExp("[\u00e8\u00e9\u00ea\u00eb]","g"),"e");a=a.replace(RegExp("[\u00ec\u00ed\u00ee\u00ef]","g"),"i");a=a.replace(RegExp("\u00f1","g"),"n");a=a.replace(RegExp("[\u00f2\u00f3\u00f4\u00f5\u00f6]","g"),"o");a=a.replace(RegExp("\u0153","g"),"oe");a=a.replace(RegExp("[\u00f9\u00fa\u00fb\u00fc]","g"),"u");a=a.replace(RegExp("[\u00fd\u00ff]", "g"),"y");a=a.replace(RegExp("[ '&]","g"),"-");return a=a.replace(RegExp("[()]","g"),"")}function blockElement(a){a==""||a==void 0?$.blockUI():$(a).block()}function unBlockElement(a){a==""||a==void 0||$(a).unblock()}function cambiaCaptcha(){ajaxInner(25,"imgCaptcha")}function segnalaAbuso(a,c){ajaxInner(26,"toolTip",a,c)} function cambiaStatoForum(a,c){var b=document.getElementById("stato_"+c).value;xmlhttp.open("GET",a+b+"?noRed=1",!0);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){b=document.getElementById("stato_"+c).value;var a=b==1?"/images/flagOn.gif":"/images/flagOff.gif",e=b==0?1:0;document.getElementById(c).src=a;document.getElementById("stato_"+c).value=e}};xmlhttp.send(null)} function searchCity(a){$().ready(function(){$("#city").autocomplete("http://"+document.location.hostname+"/searchTools.php",{width:265,extraParams:{lang:a},formatItem:function(a){return a[0].replace(/<span>(.+?)<\/span>/gi,'<span><img title="$1" alt="$1" src="http://www.weboost.it/inc/images/flags/$1.gif"></span>')},selectFirst:!0,formatResult:function(a){return a[0].replace(/<span>(.+?)<\/span>/gi,"")}})})} function cambiaImpostazioni(a){xmlhttp.open("GET","/spendiFunctions.php?tipo=27&var1="+a.value,!0);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){var a=xmlhttp.responseText.split("[#]");document.getElementById("divChangeTarghetta").innerHTML=a[0];document.getElementById("divChangeTitle").innerHTML=a[1]}};xmlhttp.send(null)}function writeReview(a,c){if(c!=1)return ajaxInner(1,"toolTip","postReview","IT"),!1;else location.href=a} function sendReview(a,c){if(c!=1)return!1;else{var b=a.titleReview.value.split(" "),d=a.review.value.split(" "),b=b.length-1,d=d.length-1;if(a.titleReview.value==""||b>15||a.titleReview.value.length<3)return alert(titoloMassimoParoleJS),!1;if(d<20)return alert(reviewMinimoParoleJS),!1}return!0};
