
function NewWindow(mypage,myname,w,h,scroll){var winl=(screen.width-w)/2;var wint=(screen.height-h)/2;winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win=window.open(mypage,myname,winprops)
if(parseInt(navigator.appVersion)>=4){win.window.focus();}}
function MM_openBrWindow(theURL,winName,features){neo=window.open(theURL,winName,features);if(neo.window.focus){neo.window.focus();}}
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore)selObj.selectedIndex=0;}
function submit_form(){document.forms["form_contatti"].submit();}
function check_form(theform){rtn=Validatore_Form(theform);if(rtn==false){return(rtn);}else{showElement('#waitMessage');disable_it();}}
function preload_i(image){image1=new Image();image1.src="js/ajaxtabs/"+image;}
function disable_it(){document.getElementById("p_send").disabled=true;}
function showElement(what){$(what).show();}
function hideElement(what){$(what).hide();}
function flagSH(what,f){if($(what).is(":hidden")){$(what).slideDown();}else{$(what).slideUp();}}
function showBox(what){arrForms=new Array();arrForms[0]="form1";arrForms[1]="form2";arrForms[2]="form3";arrForms[3]="form4";arrForms[4]="form5";arrForms[5]="form6";arrForms[6]="form7";for(a=0;a<=arrForms.length-1;a++){var step=a+1;if(what!=arrForms[a])
document.getElementById(arrForms[a]).style.display='none';else{document.getElementById(arrForms[a]).style.display='inline';document.getElementById("step").className='step'+step;}}
window.scrollTo(0,0);}
function box_logged_show(what,f){if($(what).is(":hidden")){$(what).slideDown();setCookie('box_logged','1','7');}else{$(what).slideUp();setCookie('box_logged','0','7');}}
function form_newsletter_show(what,f){if($(what).is(":hidden")){$(what).slideDown();$('#form_newsletter_show').html('Nascondi il form');setCookie('form_newsletter','1','7');}else{$(what).slideUp();$('#form_newsletter_show').html('Mostra il form');setCookie('form_newsletter','0','7');}}
function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+
((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name){if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function _getContentToPrint(what){var htmlStr=$(what).html();return htmlStr;}
function login(uname,pwd,tip){if(uname&&pwd&&tip){$("#waitMessage").show();$.post("index.php",{mod:"ariservata",smod:"login",username:uname,password:pwd,tipologia:tip},function(rtn){doResponse(rtn,redir);});}}
function doResponse(rtn,redir){t=setTimeout(" hideElement('#waitMessage')",2000);if(!rtn){$("#serverResponseLogin").show();t=setTimeout(" hideElement('#serverResponseLogin')",2000);return;}
else{francyclose();var _l=redir;document.location=_l}}
function login_iscrizione(uname,pwd,tip,idp,redir){if(uname&&pwd&&tip){$("#waitMessage").show();$.post("index.php",{mod:"ariservata",smod:"login",username:uname,password:pwd,tipologia:tip,idp:idp},function(rtn){doResponse_iscrizione(rtn,redir);});}}
function doResponse_iscrizione(rtn,redir){t=setTimeout(" hideElement('#waitMessage')",2000);if(!rtn){$("#serverResponseLogin").show();t=setTimeout(" hideElement('#serverResponseLogin')",2000);return;}
else{setCookie('box_logged','1','7');$('div#box_logged').slideDown();$('#login_form').html(rtn);var _l=redir;document.location=_l}}
function checkIsLogged(noDisplaySpinner){if(!noDisplaySpinner){$("#box_logged").html("");$("#login_spinner").show();}
$.post("index.php",{mod:"ariservata",smod:"is_logged",op:"getHtml"},function(rtn){$("#box_logged").html(rtn);if(!noDisplaySpinner)
$("#login_spinner").hide();});$.post("index.php",{mod:"ariservata",smod:"is_logged"},function(rtn){if(rtn)
if(location.search=="?mod=registra_utente"){var _l="index.php?mod=cart";document.location=_l}});}
function iscrizione_brochure(nome,cognome,citta,tipologia,email,file1){if(nome&&cognome&&citta&&tipologia&&email){$("#waitMessage").show();$.post("index.php",{mod:"scarica_brochure",op:"iscrivi",nome:nome,cognome:cognome,citta:citta,tipologia:tipologia,email:email,file1:file1},function(rtn){doResponse_brochure(rtn);});}}
function doResponse_brochure(rtn){t=setTimeout(" hideElement('#waitMessage')",2000);if(!rtn){$("#serverResponseLogin").show();t=setTimeout(" hideElement('#serverResponseLogin')",2000);return;}
else{$('#brochure_form').html(rtn);var _l=redir;}}