var debug=false;var session_control=null;var upload_control=null;var progress_bar=null;var Vola={version:"1.0.0",typesent:"now",send_date:"",send_time:"",notify:"yes"};var User={username:"",nome:"",cognome:"",rag_soc:"",email:"",cell:"",categoria:"",indirizzo:"",citta:"",cap:"",provincia:"",cf:"",piva:"",tel:"",fax:"",contratto:"",privacy:"",pref:"",msisdn:"",mitt:"",pswd:"",fl_mitt_valid:"",conf_email:"",conf_pswd:"",spam_verify:""};var differiti_pag=new Array();var contatti_pag=new Array();var todel_pag=new Array();var testo_tmp="";var dests_tmp="";var hdests=-1;var myGlobalHandlers={onCreate:function(){Element.hide("progress_activity");var d=$("progress_activity");d.style.display="inline";document.body.style.cursor="wait"},onComplete:function(){Element.hide("progress_activity");document.body.style.cursor="default"},onException:function(resp){Element.hide("progress_activity");document.body.style.cursor="default";myAlert("connection_error",null);if(progress_bar!=null){progress_bar.stop();progress_bar.poller.stop();progress_bar=null;if($("ModalBG")){$("ModalBG").style.display="none"}if($("btnInvia")){$("btnInvia").disabled=false}}}};Ajax.Responders.register(myGlobalHandlers);Ajax.AutocompleterGTN=Class.create(Ajax.Autocompleter,{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.updateElement=this.updateElement.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url;this.sep_fields=this.options.sep_fields||null},updateElement:function(selectedItem){var value=Element.collectTextNodesIgnoreClass(selectedItem,"informal");var bounds=this.getTokenBounds();if(bounds[0]!=-1){var newValue=this.element.value.substr(0,bounds[0]);var whitespace=this.element.value.substr(bounds[0]).match(/^\s+/);if(whitespace){newValue+=whitespace[0]}if(this.sep_fields==null){this.element.value=newValue+value+this.element.value.substr(bounds[1])}else{this.element.value=newValue+value+this.element.value.substr(bounds[1])+this.sep_fields}}else{if(this.sep_fields==null){this.element.value=value}else{this.element.value=value+this.sep_fields}}this.oldElementValue=this.element.value;this.element.focus()}});function DialogBox(name){if(name=="login"){if($("msg")){testo_tmp=$F("msg")}if($("destinatari")){dests_tmp=$F("destinatari")}if($("hdests")){hdests=$F("hdests")}}Vola.modal_layer=name;var url="/vola-sms/get_layer.php";var params="type="+name;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function DialogBoxConfirm(name){Vola.modal_layer=name;var url="/vola-sms/get_layer.php";var params="type="+name;try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function CloseDialogBox(){if(upload_control){upload_control.stop()}var d=$("ModalBG");var p=$("DialogWindow");if(d){d.style.display="none";p.style.display="none"}}function CloseDialogBoxConfirm(){if(upload_control){upload_control.stop()}var d=$("ModalBGConfirm");var p=$("DialogWindowConfirm");if(d){d.style.display="none";p.style.display="none"}else{ShowError()}}function setTypeSent(t){if(t=="now"){$("now").checked=true;Element.hide("row_date");Element.hide("row_time")}else{$("late").checked=true;Element.show("row_date");Element.show("row_time")}}function doSincroVola4(){var button=$("btn_avanti");button.disabled=true;var url="/vola-sms/sincronizza_volaweb.php";var params="step=2";try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function mngHomepageVola(){var url="/vola-sms/get_jlayer.php";var params="type=set_homepage";var hp=0;if($("mnghomepage")&&$("mnghomepage").checked){hp=1}params+="&value="+hp;_callAjax(url,params)}function setupTypeSent(){var url="/vola-sms/get_layer.php";var params="type=tipoinvio";Vola.modal_layer="tipoinvio";if(Vola.typesent=="late"){params+="&date="+Vola.send_date+"&time="+Vola.send_time}try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function confirmTypeSent(){if($("now").checked){Vola.typesent="now";$("title_type_sent").innerHTML="immediato";$("type_sent").value="now"}else{Vola.typesent="late";Vola.send_date=$F("dt_yy")+"-"+$F("dt_mm")+"-"+$F("dt_gg");Vola.send_time=$F("tm_hh")+":"+$F("tm_mm");var dataora=$F("dt_gg")+"-"+$F("dt_mm")+"-"+$F("dt_yy")+" "+$F("tm_hh")+":"+$F("tm_mm");$("title_type_sent").innerHTML="differito ["+dataora+"]";$("type_sent").value=dataora}CloseDialogBox()}function setSender(t){if(t=="current"){$("sender_current").checked=true}else{$("sender_always").checked=true}if($("sms_sender")){var e=$A($("sms_sender").getElementsByTagName("option"));var o=e.find(function(elem){var v="";if($("sender")){v=$("sender").value}return(elem.value==v)});if(o){o.selected=true}}}function confirmSender(){var s=$F("sms_sender");var stype=0;if($("sender_always")&&$("sender_always").checked){stype=1}if($("sender_always").checked){var url="/vola-sms/save_profile.php";var params="type=sender&sender="+s+"&stype="+stype;var myAjax=new Ajax.Request(url,{parameters:params})}var tmp=new Array();tmp[0]=s;var x=convalidaDestinatari(tmp);x[0]=x[0].replace("<","");x[0]=x[0].replace(">","");$("title_sender").innerHTML=x[0];$("sender").value=s;CloseDialogBox()}function setNotify(t){if($("notify")){if($F("notify")=="N"){$("notify_no").checked=true}else{$("notify_yes").checked=true}}else{$("notify_yes").checked=true}}function confirmNotify(){if($("notify_yes").checked){Vola.notify="yes";$("title_notify").innerHTML="SI";$("notify").value="S"}else{if($("notify_always").checked){var url="/vola-sms/save_profile.php";var params="type=notify&notify=S";var myAjax=new Ajax.Request(url,{parameters:params});Vola.notify="always";$("title_notify").innerHTML="SI";$("notify").value="S"}else{var url="/vola-sms/save_profile.php";var params="type=notify&notify=N";var myAjax=new Ajax.Request(url,{parameters:params});Vola.notify="no";$("title_notify").innerHTML="NO";$("notify").value="N"}}CloseDialogBox()}function ShowLayer(request){var d=$("ModalBG");var p=$("DialogWindow");if(d){if(Vola.modal_layer=="tipoinvio"){setTypeSent(Vola.typesent)}if(Vola.modal_layer=="sender"){setSender("current")}if(Vola.modal_layer=="notifica"){setNotify(Vola.notify)}offset=Position.realOffset(p);pos=p.getDimensions();if(pos.height>document.body.clientHeight){altez=offset[1]+20}else{altez=offset[1]+(document.body.clientHeight-pos.height)/2}if(pos.width>document.body.clientWidth){larg=offset[0]+20}else{larg=offset[0]+(document.body.clientWidth-pos.width)/2}p.style.left=larg+"px";p.style.top=altez+"px";d.style.display="inline";p.style.display="inline";if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){Position.absolutize("DialogWindow")}new Draggable("DialogWindow",{scroll:window,handle:"dw_header",starteffect:function(){},endeffect:function(){}})}else{ShowError()}}function ShowLayerConfirm(request){var d=$("ModalBGConfirm");var p=$("DialogWindowConfirm");if(d){offset=Position.realOffset(p);pos=p.getDimensions();if(pos.height>document.body.clientHeight){altez=offset[1]+20}else{altez=offset[1]+(document.body.clientHeight-pos.height)/2}if(pos.width>document.body.clientWidth){larg=offset[0]+20}else{larg=offset[0]+(document.body.clientWidth-pos.width)/2}p.style.left=larg+"px";p.style.top=altez+"px";d.style.display="inline";p.style.display="inline";if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){Position.absolutize("DialogWindowConfirm")}new Draggable("DialogWindowConfirm",{scroll:window,handle:"dw_header",starteffect:function(){},endeffect:function(){}})}else{ShowError()}}function ShowError(request){Element.hide("progress_activity");document.body.style.cursor="default";myAlert("connection_error",null)}function Login(frm){var params=Form.serialize(frm);params+="&t="+escape(testo_tmp)+"&d="+escape(dests_tmp)+"&h="+escape(hdests);_callAjax("/vola-sms/login.php",params)}function SaveContact(frm){var cell,d,msgerror;if($("Cellulare")){cell=$F("Cellulare")}else{cell=""}if(cell==""){d=$("msg_contact");if(d){msgerror="<br>Il campo cellulare e' obbligatorio<br><br>";Element.update(d,msgerror)}return}var email=$F("Email");if(email!=""){var regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if(!regexp.test(email)){d=$("msg_contact");if(d){msgerror="<br>Inserire un indirizzo email valido<br><br>";Element.update(d,msgerror)}return}}var IDC,ctrl_ope,Cellulare,Nome,Cognome,Email,Telefono;var ragsoc,dt_Day,dt_Month,dt_Year,categorie,hd_categorie,close_after_insert;if($("IDC")){IDC=encodeURIComponent($F("IDC"))}if($("ctrl_ope")){ctrl_ope=encodeURIComponent($F("ctrl_ope"))}if($("Cellulare")){Cellulare=encodeURIComponent($F("Cellulare"))}if($("Nome")){Nome=encodeURIComponent($F("Nome"))}if($("Cognome")){Cognome=encodeURIComponent($F("Cognome"))}if($("Email")){Email=encodeURIComponent($F("Email"))}if($("Telefono")){Telefono=encodeURIComponent($F("Telefono"))}if($("ragsoc")){ragsoc=encodeURIComponent($F("ragsoc"))}if($("dt_gg")){dt_Day=encodeURIComponent($F("dt_gg"))}if($("dt_mm")){dt_Month=encodeURIComponent($F("dt_mm"))}if($("dt_yy")){dt_Year=encodeURIComponent($F("dt_yy"))}if($("categorie")){categorie=encodeURIComponent($F("categorie"))}if($("hd_categorie")){hd_categorie=encodeURIComponent($F("hd_categorie"))}if($("close_after_insert")){close_after_insert=encodeURIComponent($F("close_after_insert"))}var params="IDC="+IDC+"&ctrl_ope="+ctrl_ope+"&Cellulare="+Cellulare+"&Nome="+Nome+"&Cognome="+Cognome+"&Email="+Email+"&Telefono="+Telefono+"&ragsoc="+ragsoc+"&dt_Day="+dt_Day+"&dt_Month="+dt_Month+"&dt_Year="+dt_Year+"&categorie="+categorie+"&hd_categorie="+hd_categorie+"&close_after_insert="+close_after_insert;_callAjax("/vola-sms/save_contact.php",params)}function LoadPageJ(pagename){if(pagename=="traffico_search"){todel_pag=new Array()}var params="type="+pagename;_callAjax("/vola-sms/get_jlayer.php",params)}function _callAjax(url,params){try{var myAjax=new Ajax.Request(url,{parameters:params,onFailure:ShowError,onComplete:_processResponse})}catch(e){myAlert("connection_error",null)}}function LoadPage(pagename){var url="/vola-sms/get_layer.php";var params="type="+pagename;_updateSectionPage(url,"",params)}function LoadPageContenuti(pagename){if(pagename=="differiti"){differiti_pag=new Array()}var url="/vola-sms/get_layer.php";var params="type="+pagename;_updateSectionPage(url,"areacontenuti",params)}function _updateSectionPage(url,container,params){try{if(container==""){container="contenitorecentro"}var myAjax=new Ajax.Request(url,{parameters:params,evalScripts:true,onFailure:ShowError,onComplete:function(request){var resp="";if(typeof(SymOnLoad)!="undefined"){resp=nortonClean(request.responseText)}else{resp=request.responseText}if(resp==""){ShowError()}else{var d=$(container);if(d){Element.update(d,resp)}else{ShowError()}}}})}catch(e){myAlert("connection_error",null)}}function cleanDiv(div){var d=$(div);string="";if(div=="msg_contact"){string+="<input type='hidden' id='ctrl_ope' name='ctrl_ope' value='1'>"}Element.update(d,string);return}function nortonClean(tmp){var idx_start_top=tmp.indexOf("<script");var idx_end_top=tmp.indexOf("<\/script>");if(idx_start_top>0&&idx_end_top>0){tmp=tmp.substring(0,idx_start_top-1)+tmp.substring(idx_end_top+9)}var idx_start_bottom=tmp.lastIndexOf("<script");var idx_end_bottom=tmp.lastIndexOf("<\/script>");if(idx_start_bottom>0&&idx_end_bottom>0){tmp=tmp.substring(0,idx_start_bottom-1)+tmp.substring(idx_end_bottom+9)}return tmp.gsub(String.fromCharCode(10),"")}function _processResponse(request){var resp=null;if(typeof(SymOnLoad)!="undefined"){var tmp=request.responseText;resp=nortonClean(tmp)}else{resp=request.responseText}var d;var obj=null;try{obj=resp.evalJSON()}catch(e){if(debug){alert(resp)}obj=null}if(obj!=null){obj.each(function(elem){if(elem.descr){elem.descr.each(function(descr){if(descr.section!=""){d=$(descr.section);Element.update(d,descr.html)}})}else{if(elem.section!=""){d=$(elem.section);Element.update(d,elem.html)}}switch(elem.action){case"command_error":if(progress_bar!=null){progress_bar.stop();progress_bar.poller.stop();progress_bar=null}CloseDialogBox();myAlert("connection_error",null);break;case"sub_lic_add_err":case"credsms+_no_credit":case"credsms-_credit_err":case"credmms-_credit_err":case"credmms+_no_credit":myAlert(elem.action,null);break;case"sub_err_maxnum":case"sub_send_data_ko":case"sub_send_data_ok":CloseDialogBox();myAlert(elem.action,null);break;case"sub_crea_ok":var myparams=new Array();myparams[0]=elem.html;CloseDialogBox();myAlert(elem.action,myparams);LoadPageContenuti("subaccount");break;case"sub_del_ok":case"sub_mod_ok":case"credsms+_ok":case"credmms+_ok":case"credsms-_ok":case"credmms-_ok":CloseDialogBox();myAlert(elem.action,null);LoadPageContenuti("subaccount");break;case"pt_ko_subaccount":myAlert(elem.action,null);break;case"pt_ok":case"pt_ok_silver":profiloTariffario();myAlert(elem.action,null);break;case"pt_ko_diff":var myparams=elem.html.split("*");myAlert("pt_ko_diff",myparams);break;case"view_cmp_step3":CloseDialogBox();loadJson("inviosms_3");break;case"view_cmp_diff":CloseDialogBox();loadJson("cmp_sms_programmati");break;case"view_cmp_rep":CloseDialogBox();loadJson("cmp_report_invio");break;case"viewamico":window.location="/vola-sms/reg_invito.php?VIEW_AMICO";break;case"show_banner_amico":Effect.Grow(d,{delay:2,duration:3,afterFinish:function(){Effect.Shrink(d,{delay:2,duration:3})}});break;case"res_invito":chiudiAnteprimaInvito();myAlert("conf_invito",null);break;case"wlcip_daily_block":if($("btnInvia")){$("btnInvia").disabled=false}if(progress_bar!=null){progress_bar.stop();progress_bar.poller.stop();progress_bar=null;if($("ModalBG")){$("ModalBG").style.display="none"}}myAlert("wlcip_daily_block",null);break;case"pupdater_error":session_control.stop();break;case"sms_sent_error":if($("btnInvia")){$("btnInvia").disabled=false}if($("ModalBG")){$("ModalBG").style.display="none"}break;case"invia_sms_res_opt":Vola.send_date="";Vola.send_time="";Vola.type_sent="now";CloseDialogBoxConfirm();ShowLayer(null);if(progress_bar!=null){progress_bar.stop()}break;case"invia_sms_res":Vola.send_date="";Vola.send_time="";Vola.type_sent="now";ShowLayer(null);break;case"all_contacts":case"get_pswd":case"login_error":case"invia_sms_wlcip":case"mod_contact":case"pupdater_ok":case"registrazione_error":case"sub_err_uname_corta":case"sub_err_uname_lunga":case"sub_err_uname_ripetuta":case"sub_err_uname_nonvalida":case"sub_err_pwd_corta":case"sub_err_pwd_lunga":case"sub_err_pwd_username":case"sub_err_pwd_num":case"sub_err_pwd_nonvalida":case"sub_err_no_credito":case"sub_err_cred_sms":case"sub_err_cred_mms":case"sub_err_uname_esiste":case"profilotariffario":case"sub_lic_num_err":case"sub_lic_del_err":break;case"login_ok":case"login_ok_wlcip":case"invia_sms":case"nuovo_contatto":case"modifica_contatto":case"impostazioni":CloseDialogBox();break;case"save_contact":myFormReset("frm_contact");if($("close_after_insert")){if($F("close_after_insert")=="1"){backContatti()}}break;case"registrazione":ShowLayer(null);valorizzaFormUtente();break;case"wlcip_pincode_ko":ShowLayerConfirm(null);break;case"info_contrattuali":case"registrazione_wlcip":case"mng_lic_subaccount":case"auth_error":ShowLayer(null);break;case"rubrica":processCheckboxPaging("form_rubrica","selc",contatti_pag);break;case"sms_add_selection":destinatariKeyPress();break;case"canc_diff":differiti_pag=new Array();LoadPageContenuti("differiti");myAlert("canc_diff",null);break;case"goto_traffico":dettaglioTrafficoSMS("day",elem.extra);myAlert("canc_traffico");break;case"goto_ricerca":if($("formtype")){trafficoSearch($F("formtype"))}else{LoadPageJ("traffico_search")}myAlert("canc_traffico");break;case"conf_invio_estero":if($("btnInvia")){$("btnInvia").disabled=false}myConfirm("conf_invio_estero",null);break;case"sub_no_del":var myparams=elem.html.split("*");myAlert("sub_no_del",myparams);break;case"sub_can_del":myConfirm("delsubaccount",elem.html);break}})}else{myAlert("connection_error",null)}}function OpenPage(name){if(name=="inviomms"){window.open("/areaclienti/volammsweb.php","_parent","copyhistory=no, width=800, height=600, resizable=yes")}else{if(name=="registrazione"){window.open("/areaclienti/registrazione.php","_blank","copyhistory=no, width=800, height=600, resizable=yes")}else{if(name=="get_password"){window.open("/areaclienti/password.php","_blank","copyhistory=no, width=800, height=600, resizable=yes")}}}}function checkFormatSender(elem){elem.innerHTML+=","}function resChars(control,length){var text=$F(control);var len=text.length;var num=0;for(i=0;i<text.length;i++){if(text.charAt(i)=="\u005B"||text.charAt(i)=="\u005D"||text.charAt(i)=="\u20AC"||text.charAt(i)=="\u007B"||text.charAt(i)=="\u007D"||text.charAt(i)=="\u005E"||text.charAt(i)=="\u007C"||text.charAt(i)=="\u007E"||text.charAt(i)=="\u005C"){num++}}len+=num;if(len>length){$(control).style.color="FF0000"}else{$(control).style.color="000000"}$("chars").value=length-len}function sendSMS(form){var button=$("btnInvia");button.disabled=true;var msg=$F("msg");var msgerror="";Vola.modal_layer="none";d=$("msg_invio");if(msg==""){msgerror="<span class='txt10bred'>Testo SMS vuoto</span>";Element.update(d,msgerror);button.disabled=false;return}var num=0;for(i=0;i<msg.length;i++){if(msg.charAt(i)=="\u005B"||msg.charAt(i)=="\u005D"||msg.charAt(i)=="\u20AC"||msg.charAt(i)=="\u007B"||msg.charAt(i)=="\u007D"||msg.charAt(i)=="\u005E"||msg.charAt(i)=="\u007C"||msg.charAt(i)=="\u007E"||msg.charAt(i)=="\u005C"){num++}num++}if(num>160){msgerror="<span class='txt10bred'>Il testo dell'SMS supera i 160 caratteri</span>";Element.update(d,msgerror);button.disabled=false;return}var num_invii=0;var strdests,hdests,arstrDests,strResult,elemDests;if($F("dest_mode")=="dest_single"){strdests=$F("destinatari");hdests=$F("hdests");if(strdests==""||hdests==-1){msgerror="<span class='txt10bred'>Specificare almeno un destinatario</span>";Element.update(d,msgerror);button.disabled=false;return}arstrDests=dests2array(strdests);strResult=convalidaDestinatari(arstrDests);elemDests=$("destinatari");elemDests.value=strResult[0];if(strResult[2]>0){msgerror="<b>I seguenti destinatari non sono validi: </b><br>"+strResult[3];Element.update(d,msgerror);button.disabled=false;return}num_invii=strResult[1]}else{if($("totdest")){num_invii=$F("totdest");if(num_invii==0){msgerror="<span class='txt10bred'>Specificare almeno un destinatario</span>";Element.update(d,msgerror);button.disabled=false;return}}}if(num_invii>20){var myparams=new Array();myparams[0]=num_invii;myparams[1]=form;myConfirm("confirm_send_sms",myparams)}else{do_send_sms(form)}}function sendoptPUpdater(){try{sendopt_control=new Ajax.PeriodicalExecuter(readFileProgress,1)}catch(e){}}function readFileProgress(){var url="sendopt_progress_bar.php";_callAjax(url,"")}function forzaInvioEstero(form){if($("btnInvia")){$("btnInvia").disabled=true}var params=Form.serialize(form)+"&estero=1";var url="/vola-sms/sendSms.php";_callAjax(url,params)}function do_send_sms(form){var params=Form.serialize(form);var url="/vola-sms/sendSms.php";_callAjax(url,params)}function dests2array(dests){var archarDests=dests.toArray();var idx=0;var arstrDests=new Array();var strCurrent="";var chCurrent;while(idx<=archarDests.length){chCurrent=archarDests[idx];if(chCurrent!=","&&chCurrent!=";"&&chCurrent!="\r"&&idx<archarDests.length){strCurrent+=chCurrent}else{arstrDests.push(strCurrent);strCurrent=""}idx++}return arstrDests}function getItalianPrefix(){var a_italiaPref=new Array("311","313","320","323","327","328","329","330","331","333","334","335","336","337","338","339","340","343","345","346","347","348","349","360","363","366","368","370","373","377","380","388","389","390","391","392","393");return a_italiaPref}function convalidaDestinatari(dests){var p_autocomplete=/.*<\+\(\d{1,3}\)\s\d{3}\s\d{4}\s\d{1,3}>.*/;var p_autocomplete_est=/.*<\+\(\d{1,3}\)\s\d{3}\s\d{4}\s\d{0,3}>.*/;var p_generic=/[^0-9]+/;var ok=0;var ko=0;var lstOk=new Array();var lstKo=new Array();var strNewDests="";var destsko="";for(i=0;i<dests.length;i++){var current=dests[i];if(current.substr(0,2)=="00"){current="+"+current.substring(2)}if(current.substr(0,1)=="0"){current=current.substring(1)}if(current.length>0){resmatch=current.search(p_autocomplete);if(resmatch!=-1){if(strNewDests==""){strNewDests+=current}else{strNewDests+=","+current}ok++}else{resmatch=current.search(p_autocomplete_est);if(resmatch!=-1){if(strNewDests==""){strNewDests+=current}else{strNewDests+=","+current}ok++}else{current=current.strip();var check=false;if(current.substring(0,1)=="+"){current=current.replace("+","")}else{check=true}result=p_generic.exec(current);if(result==null&&current.length>=9&&current.length<=16){tmp=current;formatok="<+(";if(check){formatok+="39) ";if(current.substring(0,2)=="39"&&current.length>10){idxstart=2}else{idxstart=0}}else{intprefix=tmp.substr(0,2);formatok+=intprefix+") ";idxstart=2}opeprefix=tmp.substr(idxstart,3);formatok+=opeprefix+" ";idxstart+=3;numgr1=tmp.substr(idxstart,4);formatok+=numgr1+" ";idxstart+=4;numgr2=tmp.substr(idxstart);formatok+=numgr2+">";if(strNewDests==""){strNewDests+=formatok}else{strNewDests+=","+formatok}ok++}else{if(strNewDests==""){strNewDests+=current}else{strNewDests+=","+current}if(destsko==""){destsko+=current}else{destsko+=","+current}ko++}}}}}var result=new Array();result[0]=strNewDests;result[1]=ok;result[2]=ko;result[3]=destsko;return result}function addKey(){var chiave="";var elem=null;var ele_parole=null;var IDC=0;if($("aggiungi")){chiave=$F("aggiungi");elem=$("aggiungi")}if($("IDC")){IDC=$F("IDC")}if(chiave==""){msgerror="<br>Inserire la parola chiave da associare al contatto<br><br>";Element.update(d,msgerror);return}if(IDC==0){return}var url="/vola-sms/mng_categorie.php";var params="chiave="+chiave+"&cdm=add&IDC="+IDC;var myAjax=new Ajax.Request(url,{parameters:params,evalScripts:true,onFailure:ShowError,onComplete:function(request){var el_parole=$("Parole");var i=0;while(i<el_parole.options.length){if(el_parole.options[i].value==chiave){return true}i++}el_parole.options[el_parole.options.length]=new Option(chiave,chiave);var lst_parole;if($("lst_parole")){lst_parole=$("lst_parole");if(lst_parole.value!=""){lst_parole.value+=","+chiave}else{lst_parole.value+=chiave}}else{lst_parole=""}if($("msg_contatto")){var d=$("msg_contatto");msgerror="";Element.update(d,msgerror)}$("aggiungi").value="";return}})}function delKeys(){var elem=null;var IDC=0;opts=new Array();if($("Parole")){elem=$("Parole")}if($("IDC")){IDC=$F("IDC")}if(elem==null){return}if(IDC==0){return}var pos=0;var idcat=0;for(i=0;i<elem.options.length;i++){if(!elem.options[i].selected){opts[pos]=elem.options[i].value;pos++}else{idcat=elem.options[i].value}}if(idcat==0){return}var url="/vola-sms/mng_categorie.php";var params="idcat="+idcat+"&cdm=del&IDC="+IDC;var myAjax=new Ajax.Request(url,{parameters:params,evalScripts:true,onFailure:ShowError,onComplete:function(request){var lst_parole="";elem.options.length=0;for(i=0;i<opts.length;i++){elem.options[i]=new Option(opts[i],opts[i]);if(lst_parole!=""){lst_parole+=","+opts[i]}else{lst_parole+=opts[i]}}elem_lst_parole=$("lst_parole");elem_lst_parole.value=lst_parole}})}function _delKeys(){var elem=$("Parole");opts=new Array();var pos=0;for(i=0;i<elem.options.length;i++){if(!elem.options[i].selected){opts[pos]=elem.options[i].value;pos++}}lst_parole="";elem.options.length=0;for(i=0;i<opts.length;i++){elem.options[i]=new Option(opts[i],opts[i]);if(lst_parole!=""){lst_parole+=","+opts[i]}else{lst_parole+=opts[i]}}elem_lst_parole=$("lst_parole");elem_lst_parole.value=lst_parole}function setupChiavi(){var lstChiavi=$F("lst_parole");var arrChiavi=lstChiavi.split(",");var elem_parole=$("Parole");var data_tmp="";for(i=0;i<arrChiavi.length;i++){data_tmp=arrChiavi[i].split(";");elem_parole.options[i]=new Option(data_tmp[1],data_tmp[0])}}function insRubrica(cell){Vola.modal_layer="scheda_contatto";var url="/vola-sms/get_layer.php";var params="type=scheda_contatto&cell="+cell;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function schedaContatto(idc){Vola.modal_layer="scheda_contatto";var url="/vola-sms/get_layer.php";var params="type=scheda_contatto&IDC="+idc;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function setCheckboxPaging(form,listname,name){if($(form)){var objCheckBoxes=document.forms[form].elements[name];if(objCheckBoxes==undefined){objCheckBoxes=new Array();objCheckBoxes.push(document.getElementById(name))}for(i=0;i<objCheckBoxes.length;i++){trovato=false;j=0;while(!trovato&&j<listname.length){if(listname[j]==objCheckBoxes[i].value){objCheckBoxes[i].checked=true;trovato=true}j++}}}}function checkboxSelectionManager(form,name,status){if(!document.forms[form]){return}var objCheckBoxes=document.forms[form].elements[name];if(!objCheckBoxes){return}var countCheckBoxes=objCheckBoxes.length;if(!countCheckBoxes){objCheckBoxes.checked=status}else{for(i=0;i<countCheckBoxes;i++){objCheckBoxes[i].checked=status}}}function eliminaContattoCorrente(){if($("IDC")){var myparams=new Array();myparams[0]=$F("IDC");myConfirm("canc_contatto_corrente",myparams)}}function doEliminaContattoCorrente(IDC){var string="("+IDC+")";var url="eliminacontatto.php";var params="list="+string;try{var myAjax=new Ajax.Request(url,{parameters:params,onFailure:ShowError,onSuccess:backContatti})}catch(e){}}function inviaSmsSingoloContatto(){var idc=$F("IDC");var string="("+idc+")";var url="/vola-sms/sms_add_selection.php";var params="list="+string;_callAjax(url,params);CloseDialogBox()}function createStringSelector(array){var string="(";for(i=0;i<array.length;i++){if(i==0){string+=array[i]}else{string+=","+array[i]}}string+=")";return string}function doEliminaContatti(){var temp=saveSelection("form_rubrica","selc",contatti_pag);var string=createStringSelector(temp);var url="/vola-sms/eliminacontatto.php";var params="list="+string;_callAjax(url,params)}function eliminaContatti(){temp=saveSelection("form_rubrica","selc",contatti_pag);if(temp.length==0){myAlert("del_no_contacts_select",null);return true}myConfirm("do_del_contacts",null)}function confirmCancellaTrafficoSMS(type){var temp=saveSelection("frm_smsdel","sms_todel",todel_pag);if(temp.length==0){myAlert("del_sms_empty");return}myConfirm("confirm_del_sms",type)}function doCancellaTrafficoSMS(type){if($("btnok")){$("btnok").disabled=true}if($("btnannulla")){$("btnannulla").disabled=true}var string=createStringSelector(temp);var url="/vola-sms/elimina_sms.php";var params="action="+type+"&list="+string;if(type=="traffico"){if($("giorno")){params+="&giorno="+$F("giorno")}if($("mese")){params+="&mese="+$F("mese")}if($("anno")){params+="&anno="+$F("anno")}}_callAjax(url,params)}function eliminaDifferiti(){temp=saveSelection("frm_differiti","idcanc",differiti_pag);if(temp.length==0){myAlert("del_diff_empty",null);return true}myConfirm("do_del_differiti",null)}function doEliminaDifferiti(){if($("btnok")){$("btnok").disabled=true}if($("btnannulla")){$("btnannulla").disabled=true}var temp=saveSelection("frm_differiti","idcanc",differiti_pag);var string=createStringSelector(temp);var type=null;if($("fieldcanc")){type=$F("fieldcanc")}var url="/vola-sms/eliminadifferiti.php";var params="list="+encodeURIComponent(string)+"&type="+encodeURIComponent(type);_callAjax(url,params)}function applicaFiltroContatti(type){var filtro="";if($("Cerca")){filtro=$F("Cerca")}else{if($("categorie")){filtro=$F("categorie")}}var url="/vola-sms/rubrica.php";var params="filtro="+encodeURIComponent(filtro)+"&type="+type;_callAjax(url,params)}function smsContacts(){var temp=saveSelection("form_rubrica","selc",contatti_pag);var string=createStringSelector(temp);if(temp.length==0||string==""){myAlert("sms_no_dests",null);return true}var url="/vola-sms/sms_add_selection.php";var params="list="+string;_callAjax(url,params)}function saveSelection(form,name,sel_prec){temp=new Array();if(!document.forms[form]){return}var page_elements=document.forms[form].elements[name];if(page_elements.length){for(i=0;i<page_elements.length;i++){if(page_elements[i].checked){temp.push(page_elements[i].value)}}for(i=0;i<sel_prec.length;i++){j=0;trovato=false;while(!trovato&&j<page_elements.length){if(page_elements[j].value==sel_prec[i]){if(page_elements[j].checked){temp.push(sel_prec[i])}trovato=true}j++}if(!trovato){temp.push(sel_prec[i])}}}else{if(page_elements.checked){temp.push(page_elements.value)}for(i=0;i<sel_prec.length;i++){if(page_elements.value!=sel_prec[i]){temp.push(sel_prec[i])}}}return temp}function changePage(cpage,type){var npage;if(type=="+"){npage=cpage+1}else{npage=cpage-1}temp=saveSelection("form_rubrica","selc",contatti_pag);contatti_pag=temp;var filtro="";if($("Cerca")){filtro=$F("Cerca")}var params="pageID="+npage+"&type=contatti&filtro="+escape(filtro);var url="/vola-sms/rubrica.php";_callAjax(url,params)}function myFormReset(frm){if($(frm)){Form.reset(frm);if($("Parole")){$("Parole").options.length=0}}}function backContatti(){CloseDialogBox();applicaFiltroContatti("contatti")}function CloseSchedaContatto(){if($("ctrl_ope")){if($F("ctrl_ope")==1){myConfirm("close_contatto",null);return}}CloseDialogBox();applicaFiltroContatti("contatti")}function vaBeneConLAlfabeto(obj,CaratteriValidi){var Stringa=obj.value;var StringaOk="";var valida;var i,j;for(i=0;i<Stringa.length;i++){valida=false;for(j=0;j<CaratteriValidi.length;j++){if(Stringa.charAt(i)==CaratteriValidi.charAt(j)){StringaOk+=Stringa.charAt(i);break}}}obj.value=StringaOk;return true}function regWlcip(step){var params="";var d=$("msg_reg");if(step==2){var pswd=document.frmRegistrazione.pswd.value;var conf_pswd=document.frmRegistrazione.conf_pswd.value;var nome=document.frmRegistrazione.nome.value;var cognome=document.frmRegistrazione.cognome.value;var email=document.frmRegistrazione.email.value;var conf_email=document.frmRegistrazione.conf_email.value;var contratto=document.frmRegistrazione.contratto.checked;var condizioni=document.frmRegistrazione.condizioni.checked;var pref=document.frmRegistrazione.pref.value;var msisdn=document.frmRegistrazione.msisdn.value;var cellulare="0039"+pref+msisdn;if(email==""){msgerror="Attenzione: il campo email &egrave; obbligatorio";Element.update(d,msgerror);return false}reg=/^[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}$/;if(email.search(reg)==-1){msgerror="Attenzione: inserire un indirizzo email valido";Element.update(d,msgerror);return false}if(email!=conf_email){msgerror="Attenzione: l'indirizzo email inserito non corrisponde alla conferma";Element.update(d,msgerror);return false}User.username=email;User.email=email;User.conf_email=conf_email;if(pswd==""){msgerror="Attenzione: il campo password &egrave; obbligatorio";Element.update(d,msgerror);return false}var regexp=/[a-zA-Z0-9]{8,12}/;if(!regexp.test(pswd)){msgerror="La password pu&ograve; contenere solo lettere e numeri e deve avere una lunghezza compresa tra gli 8 e i 12 caratteri";if(d){Element.update(d,msgerror)}return}if(pswd!=conf_pswd){msgerror="Attenzione: la password inserita non corrisponde alla conferma";Element.update(d,msgerror);return false}User.pswd=pswd;User.conf_pswd=conf_pswd;if(nome==""){msgerror="Attenzione: il campo nome &egrave; obbligatorio";Element.update(d,msgerror);return false}User.nome=nome;if(cognome==""){msgerror="Attenzione: il campo cognome &egrave; obbligatorio";Element.update(d,msgerror);return false}User.cognome=cognome;if(msisdn==""){msgerror="Attenzione: il campo cellulare &egrave; obbligatorio";Element.update(d,msgerror);return false}if(isNaN(msisdn)||msisdn.length<6||msisdn.length>7){msgerror="Attenzione: il campo cellulare non &egrave; valido";Element.update(d,msgerror);return false}User.cell=cellulare;User.mitt=cellulare;User.pref=pref;User.msisdn=msisdn;if(!contratto){msgerror="Attenzione: &egrave; necessario accettare le condizioni contrattuali per proseguire";Element.update(d,msgerror);return false}if(!condizioni){msgerror="Attenzione: &egrave; necessario fornire il consenso al trattamento dei dati personali per proseguire";Element.update(d,msgerror);return false}params="step="+step+"&"+Object.toQueryString(User)}else{params="step="+step}var url="/vola-sms/registrazione_wlcip.php";_callAjax(url,params)}function regStep1(from){var params="step=1";var url="/vola-sms/registrazione.php";_callAjax(url,params)}function regStep2(from){if(!checkUserData(from)){return}var params="step=2&"+Object.toQueryString(User);var url="/vola-sms/registrazione.php";_callAjax(url,params)}function regStep3(from){if(!checkUserData(from)){return}var params="step=3";var url="/vola-sms/registrazione.php";_callAjax(url,params)}function regStep4(from){if(!checkUserData(from)){return}var params="step=4&"+Object.toQueryString(User);var url="/vola-sms/registrazione.php";_callAjax(url,params)}function regStep5(){var params="step=5&"+Object.toQueryString(User);var url="/vola-sms/registrazione.php";_callAjax(url,params)}function valorizzaFormUtente(){if($("nome")){$("nome").value=User.nome}if($("email")){$("email").value=User.email}if($("username")){$("username").value=User.username}if($("cognome")){$("cognome").value=User.cognome}if($("rag_soc")){$("rag_soc").value=User.rag_soc}if($("pref")){$("pref").value=User.pref}if($("msisdn")){$("msisdn").value=User.msisdn}if($("indirizzo")){$("indirizzo").value=User.indirizzo}if($("cap")){$("cap").value=User.cap}if($("citta")){$("citta").value=User.citta}if($("tel")){$("tel").value=User.tel}if($("fax")){$("fax").value=User.fax}if($("prov")){$("prov").value=User.prov}if($("piva")){$("piva").value=User.piva}if($("cf")){$("cf").value=User.cf}if($("categoria")){$("categoria").value=User.categoria}if($("contratto")){$("contratto").value=User.contratto}if($("privacy")){$("privacy").value=User.privacy}}function checkUserData(step){var d=$("msg_reg");switch(step){case 1:if($("username")){if($F("username")==""){msgerror="Attenzione: il campo username &egrave; obbligatorio";Element.update(d,msgerror);return false}User.username=$F("username")}if($("nome")){if($F("nome")==""){msgerror="Attenzione: il campo nome &egrave; obbligatorio";Element.update(d,msgerror);return false}User.nome=$F("nome")}if($("cognome")){if($F("cognome")==""){msgerror="Attenzione: il campo cognome &egrave; obbligatorio";Element.update(d,msgerror);return false}User.cognome=$F("cognome")}if($("email")){if($F("email")==""){msgerror="Attenzione: il campo email &egrave; obbligatorio";Element.update(d,msgerror);return false}reg=/^[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}$/;if($F("email").search(reg)==-1){msgerror="Attenzione: inserire un indirizzo email valido";Element.update(d,msgerror);return false}if(!$("confemail")||$F("email")!=$F("confemail")){msgerror="Attenzione: l'indirizzo email inserito non corrisponde alla conferma";Element.update(d,msgerror);return false}User.email=$F("email")}if($("rag_soc")){User.rag_soc=$F("rag_soc")}if($("pref")&&$("msisdn")&&$F("pref")!=""&&$F("msisdn")!=""){User.pref=$F("pref");User.msisdn=$F("msisdn");User.cell=User.pref+User.msisdn}if($("spam_verify")){if($F("spam_verify")==""){msgerror="Attenzione: Il codice di verifica &egrave; errato";Element.update(d,msgerror);return false}User.spam_verify=$F("spam_verify")}return true;case 2:if($("indirizzo")){if($F("indirizzo")==""){msgerror="<br>Attenzione: il campo indirizzo e' obbligatorio<br><br>";Element.update(d,msgerror);return false}User.indirizzo=$F("indirizzo")}if($("citta")){if($F("citta")==""){msgerror="<br>Attenzione: il campo citta' e' obbligatorio<br><br>";Element.update(d,msgerror);return false}User.citta=$F("citta")}if($("cap")){if($F("cap")==""){msgerror="<br>Attenzione: il campo cap e' obbligatorio<br><br>";Element.update(d,msgerror);return false}User.cap=$F("cap")}if($("prov")){if($F("prov")==""){msgerror="<br>Attenzione: il campo provincia e' obbligatorio<br><br>";Element.update(d,msgerror);return false}User.provincia=$F("prov")}if($("piva")){if($F("piva")==""){msgerror="<br>Attenzione: il campo Partita iva e' obbligatorio<br><br>";Element.update(d,msgerror);return false}reg=/^[0-9]{11}$/;if($F("piva").search(reg)==-1){msgerror="<br>Attenzione: la partita iva inserita non e' valida. Per essere valida la partita iva deve essere un codice numerico di 11 cifre<br><br>";Element.update(d,msgerror);return false}User.piva=$F("piva")}if($("cf")){if($F("cf")==""){msgerror="<br>Il campo Codice Fiscale e' obbligatorio<br><br>";Element.update(d,msgerror);return false}if(User.rag_soc==""){reg=/^[a-zA-Z]{6}[0-9]{2}[a-zA-Z][0-9]{2}[a-zA-Z][0-9]{3}[a-zA-Z]$/;if($F("cf").search(reg)==-1){msgerror="<br>Attenzione: il codice fiscale non e' valido. Un codice fiscale valido deve essere formato da 6 lettere, 2 numeri, 1 lettera, 2 numeri, 1 lettera, 3 numeri, 1 lettera (es. bcdfgh12l34m567n)<br><br>";Element.update(d,msgerror);return false}}else{reg1=/^[0-9]{11}$/;reg2=/^[a-zA-Z]{6}[0-9]{2}[a-zA-Z][0-9]{2}[a-zA-Z][0-9]{3}[a-zA-Z]$/;if($F("cf").search(reg1)==-1&&$F("cf").search(reg2)==-1){msgerror="<br>Attenzione: ti ricordiamo che ai sensi del D.L. 223/2006 art.37 il Codice Fiscale deve essere inserito anche se uguale alla partita iva e che deve essere un codice numerico di 11 cifre<br><br>";Element.update(d,msgerror);return false}}User.cf=$F("cf")}if($("tel")){User.tel=$F("tel")}if($("fax")){User.fax=$F("fax")}if($("categoria")){User.categoria=$F("categoria")}return true;case 3:if($("contratto_ok")){if(!$("contratto_ok").checked){msgerror="<br>Attenzione: e' necessario accettare le condizioni contrattuali per proseguire<br><br>";Element.update(d,msgerror);return false}User.contratto=1}if($("privacy_ok")){if(!$("privacy_ok").checked){msgerror="<br>Attenzione: e' necessario fornire il consenso al trattamento dei dati personali per proseguire<br><br>";Element.update(d,msgerror);return false}User.privacy=1}return true;default:return true}}function showCondizioniWlcip(type){var url="infocontrattualiwlcip.php";var params="type="+type;_callAjax(url,params)}function showCondizioni(from){var params="type=condizioni&from="+from;var url="infocontrattuali.php";_callAjax(url,params)}function showRiservatezza(){var params="type=privacy";var url="infocontrattuali.php";_callAjax(url,params)}function processCheckboxPaging(form,name,selected){if($(form)&&$(name)){var elems=$(form).elements[name];temp=new Array();if(elems.length){for(i=0;i<elems.length;i++){j=0;trovato=false;while(j<selected.length&&!trovato){if(selected[j]==elems[i].value){elems[i].checked=true;trovato=true}j++}}}else{trovato=false;i=0;while(i<selected.length&&!trovato){if(selected[i]==elems.value){elems.checked=true;trovato=true}i++}}}}function destinatari_send(value){var d=$("div_dests");var html="Nessun destinatario impostato<input type='hidden' id='totdest' name='totdest' value='0'>";switch(value){case"dest_single":html="";Element.update(d,html);Element.show("destinatari");break;case"dest_filter":Element.update(d,html);DialogBox("load_dest_filter");Element.hide("destinatari");break;case"dest_all":Element.hide("destinatari");var url="/vola-sms/rubrica.php";var params="type=count";_callAjax(url,params);break;case"dest_file":Element.hide("destinatari");Element.update(d,html);DialogBox("load_dest_step1");break;case"filter_remove":var url="/vola-sms/rubrica.php";var params="type=removefilter";Element.update(d,html);var myAjax=new Ajax.Request(url,{parameters:params,onComplete:DialogBox("load_dest_filter")});break}}function closeImportFileDests(){var url="/vola-sms/load_dest.php";var params="step="+0;try{var myAjax=new Ajax.Request(url,{parameters:params,onFailure:ShowError,onComplete:CloseDialogBox,evalScripts:true})}catch(e){ShowError()}}function backRegistrazione(from){if(from==1){regStep1(2)}else{regStep3(4)}}function addFilter(){var filtro=$F("categorie");var numres=$F("numres");var d=$("div_dests");var html="Applicato filtro '"+filtro+"' ("+numres+" contatti)<input type='hidden' id='totdest' name='totdest' value='"+numres+"'>";Element.update(d,html);var url="/vola-sms/rubrica.php";var params="type=addfilter&filtro="+filtro;var temp=params.toQueryParams();params=Object.toQueryString(temp);var myAjax=new Ajax.Request(url,{parameters:params});CloseDialogBox()}function rimuoviFiltro(type){var url="/vola-sms/rubrica.php";var params="type="+type;_callAjax(url,params)}function delAllContacts(){myConfirm("dell_all_contacts",null)}function doDelAllContacts(){var url="/vola-sms/eliminacontatto.php";var params="type=del_all";_callAjax(url,params)}function CriUpdateDest(n){var d=$("div_dests");var html="destinatari importati da file ("+n+" contatti)<input type='hidden' id='totdest' name='totdest' value='"+n+"'>";Element.update(d,html);CloseDialogBox()}function CriLoadDest(frm_name){var button=$("btn_avanti");button.disabled=true;fileUpload(frm_name)}function CriLoadContacts(frm_name){var button=$("btn_avanti");button.disabled=true;fileUpload(frm_name)}function CriLoadContacts2(frm_name){var button=$("btn_avanti");button.disabled=true;if($(frm_name)){var params=Form.serialize(frm_name);var url="/vola-sms/load_contacts.php";try{new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,onFailure:ShowError,evalScripts:true})}catch(e){myAlert("connection_error",null)}}}function fileUpload(frm_name){var frm=$(frm_name);if(frm){if($("iframe_upload")){Element.remove("iframe_upload")}if($("progress")){Element.remove("progress")}var str_iframe='<iframe id="iframe_upload" name="iframe_upload" style="border: 0;width: 0px;height: 0px;"></iframe>';var str_progress='<div id="progress" style="display:none"><div id="pbar"></div><div id="ppct">0%</div></div>';new Insertion.After(frm_name,str_iframe);new Insertion.After("file_upload",str_progress);frm.target="iframe_upload";frm.encoding="multipart/form-data";frm.submit();progressbar()}}function around(m){return(Math.round(m*100))/100}function mega(m){return around(parseFloat(m/(1024*1024)))}function uploadEnded(r){if(r.cancel_upload){txt="Upload Finish!"}else{txt=mega(r.total)+" Mb transfert!"}$("pbar").style.width="100%";if(txt){txt=" ("+txt+")"}$("ppct").update("100%"+txt);if($("action_upd_end")){DialogBox($F("action_upd_end"))}upload_control.stop()}function progressStatus(o){var r=o.responseText.evalJSON();if(!r.done){if(r.total){var pct=around(parseFloat(100*(r.current/r.total)));$("pbar").style.width=pct+"%";txt=pct+"% ("+mega(r.current)+"/"+mega(r.total)+" Mb)"}}else{if(r.cancel_upload){txt="Upload Error!";upload_control.stop()}else{if(r.current==r.total){uploadEnded(r);return}}}$("ppct").update(txt)}function updateProgress(){if($("progress_key")){new Ajax.Request("/vola-sms/fileprogress.php",{parameters:"progress_key="+$F("progress_key"),onComplete:progressStatus})}else{upload_control.stop()}}function progressbar(){upload_control=new PeriodicalExecuter(updateProgress,4);$("pbar").style.width="0%";$("ppct").update("0%");Effect.Appear("progress",2)}function alertSMS(action,iswelcomeip){var msg="";var destinatari="";var totdest=0;var redirect=false;var hdests=-1;if($("msg")){msg=$F("msg")}if($("destinatari")){destinatari=$F("destinatari")}if($("totdest")){ndests=$F("totdest")}if($("hdests")){hdests=$F("hdests")}if(msg!=""||((destinatari!=""||totdest!=0)&&hdests!=-1)){var myparams=new Array();myparams[0]=iswelcomeip;myConfirm(action,myparams)}else{switch(action){case"close_sms_contatti":applicaFiltroContatti("contatti");break;case"close_impostazioni_senders":CloseDialogBox();LoadPage("senders");break;case"close_impostazioni_silver":case"close_impostazioni_demosilver":CloseDialogBoxConfirm();LoadPageJ("profilotariffario");break;case"close_sms_impostazioni":LoadPage("senders");break;case"close_sms_traffico":LoadPageJ("traffico_search");break;case"close_acquista_demo":case"close_acquista_demosilver":CloseDialogBoxConfirm();LoadPage("acquista");break;case"close_sms_acquista":LoadPage("acquista");break}}}function closeMyConfirm(){if($("btnInvia")){var button=$("btnInvia");button.disabled=false}CloseDialogBoxConfirm()}function getPassword(){var d=$("pswd_error");var msgerror="";var reg=new RegExp("^(([0-9a-zA-Z-]+[-._+&])*[0-9a-zA-Z-]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}){0,1}$");if($("email")){if($F("email")==""||!reg.test($F("email"))){msgerror="Inserire un indirizzo email valido";if(d){Element.update(d,msgerror)}return}var url="/vola-sms/get_layer.php";var params="";params="type=get_password&email="+$F("email");try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}}function changePassword(){var old_pswd="";var new_pswd="";var conf_pswd="";if($("old_pswd")){old_pswd=$F("old_pswd")}if($("new_pswd")){new_pswd=$F("new_pswd")}if($("conf_pswd")){conf_pswd=$F("conf_pswd")}var url="/vola-sms/save_profile.php";var params="";params="type=password&old_pswd="+escape(old_pswd)+"&new_pswd="+escape(new_pswd)+"&conf_pswd="+escape(conf_pswd);var temp=params.toQueryParams();params=Object.toQueryString(temp);try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function cambiaProfiloUtente(){var nome="";var cognome="";var rpefisso="";var msisdn="";var email="";if($("nome")){nome=$F("nome")}if($("cognome")){cognome=$F("cognome")}if($("prefisso")){prefisso=$F("prefisso")}if($("msisdn")){msisdn=$F("msisdn")}if($("email")){email=$F("email")}var url="/vola-sms/save_profile.php";var params="";params="type=utente&nome="+encodeURIComponent(nome)+"&cognome="+encodeURIComponent(cognome)+"&prefisso="+encodeURIComponent(prefisso)+"&msisdn="+encodeURIComponent(msisdn)+"&email="+encodeURIComponent(email);try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function cambiaProfiloFatturazione(){var rag_soc="";var ind="";var cap="";var citta="";var prov="";var tel_azienda="";var cf="";var piva="";var emailaz="";if($("rag_soc")){rag_soc=$F("rag_soc")}if($("ind")){ind=$F("ind")}if($("cap")){cap=$F("cap")}if($("citta")){citta=$F("citta")}if($("prov")){prov=$F("prov")}if($("tel_azienda")){tel_azienda=$F("tel_azienda")}if($("cf")){cf=$F("cf")}if($("piva")){piva=$F("piva")}if($("emailaz")){emailaz=$F("emailaz")}var url="/vola-sms/save_profile.php";var params="";params="type=fatturazione&rag_soc="+encodeURIComponent(rag_soc)+"&ind="+encodeURIComponent(ind)+"&cap="+encodeURIComponent(cap)+"&citta="+encodeURIComponent(citta)+"&prov="+encodeURIComponent(prov)+"&tel_azienda="+encodeURIComponent(tel_azienda)+"&cf="+encodeURIComponent(cf)+"&piva="+encodeURIComponent(piva)+"&email_az="+encodeURIComponent(emailaz);try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function setProfEstero(x){var url="/vola-sms/save_profile.php";var params="";params="type=estero&value="+x;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function setProfNotifica(x){var url="/vola-sms/save_profile.php";var params="";params="type=notifica&value="+x;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function cambiaPassword(){var d=$("msg_pswd");if($F("old_pswd")==""){msgerror="Inserire la password di accesso asscoiata all'account";if(d){Element.update(d,msgerror)}return}if($F("old_pswd")!=$F("user_pswd")){msgerror="La password inserita non coincide con quella dell'account";if(d){Element.update(d,msgerror)}return}if($F("new_pswd")==""){msgerror="Inserire la nuova password di accesso da asscoiare all'account";if(d){Element.update(d,msgerror)}return}var regexp=/[a-zA-Z0-9]{8,12}/;if(!regexp.test($F("new_pswd"))){msgerror="La password pu� contenere solo lettere e numeri e deve avere una lunghezza compresa tra gli 8 e i 12 caratteri";if(d){Element.update(d,msgerror)}return}if($F("new_pswd")!=$F("conf_pswd")){msgerror="La password inserita non coincide con la conferma";if(d){Element.update(d,msgerror)}return}var params="type=pswd&pswd="+$F("new_pswd");var url="save_profile.php";try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function cambiaProfilo(){var d=$("msg_pswd");if($F("nome")==""){msgerror="Il campo nome � obbligatorio";if(d){Element.update(d,msgerror)}return}if($F("cognome")==""){msgerror="Il campo cognome � obbligatorio";if(d){Element.update(d,msgerror)}return}if($F("email")==""){msgerror="Il campo email � obbligatorio";if(d){Element.update(d,msgerror)}return}var regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if(!regexp.test($F("email"))){msgerror="Inserire un indirizzo email valido";if(d){Element.update(d,msgerror)}return}var params="type=profile&nome="+escape($F("nome"))+"&cognome="+escape($F("cognome"))+"&email="+escape($F("email"));var url="save_profile.php";try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function mittentePredefinito(){var sender_sel="";if($("senders")){sender_sel=$F("senders")}if(sender_sel==""||sender_sel==null){var d=$("msg_sender");msgerror="ATTENZIONE: seleziona il Mittente che Vuoi far diventare Predefinito";if(d){Element.update(d,msgerror)}return false}url="/vola-sms/ges_mittenti.php";var params="type=mitt_pred&mitt="+escape(sender_sel);try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function eliminaMittente(){var sender_sel="";if($("senders")){sender_sel=$F("senders")}if(sender_sel==""||sender_sel==null){var d=$("msg_sender");msgerror="ATTENZIONE: seleziona il Mittente che Vuoi eliminare";if(d){Element.update(d,msgerror)}return false}url="/vola-sms/ges_mittenti.php";var params="type=mitt_del&mitt="+escape(sender_sel);try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function nuovoMittente(){var mittente="",d;if($("mittente")){mittente=$F("mittente")}var espressione=new RegExp("^(899|892|12|166|144)");var espressione2=new RegExp("^([a-zA-Z0-9-_.+*: ])+$");if(mittente==""||mittente==null){d=$("msg_sender");msgerror="ATTENZIONE: inserire il Mittente che vuoi Aggiungere";if(d){Element.update(d,msgerror)}return false}if(!espressione2.test(mittente)){d=$("msg_sender");msgerror="ATTENZIONE: il mittente inserito contiene dei caratteri non validi";if(d){Element.update(d,msgerror)}return false}url="/vola-sms/ges_mittenti.php";var params="type=mitt_new&mitt="+escape(mittente);try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function sendPincode(mitt){var params="type=pincode&mitt="+mitt;var url="/vola-sms/ges_mittenti.php";try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function confermaPincode(mitt){if($("pincode")){if($F("pincode")==""){return}var params="type=confpincode&pincode="+$F("pincode")+"&mitt="+escape(mitt);var url="/vola-sms/ges_mittenti.php";try{var myAjax=new Ajax.Updater({success:"ModalWinConfirm"},url,{parameters:params,onComplete:ShowLayerConfirm,evalScripts:true})}catch(e){myAlert("connection_error",null)}}}function statSMSDettaglioMese(pagename,mese){var url="/vola-sms/get_layer.php";var params="type="+pagename+"&m="+mese;_updateSectionPage(url,"areacontenuti",params)}function dettaglioTrafficoSMS(type,value,page){var url="/vola-sms/dettagliotrafficosms.php";var params="";switch(type){case"day":params+="d="+value;break;case"month":params+="m="+value;break;case"year":if(value!=""&&value!=null){params+="y="+value}else{todel_pag=new Array()}break}params+="&pageID="+page;_updateSectionPage(url,"areacontenuti",params)}function dettaglioTrafficoMMS(type,value,page){var url="/vola-sms/dettagliotrafficomms.php";var params="";switch(type){case"day":params+="d="+value;break;case"month":params+="m="+value;break;case"year":if(value!=""&&value!=null){params+="anno="+value}break}params+="&pageID="+page;_updateSectionPage(url,"areacontenuti",params)}function cambiaPagSmsInviati(page,giorno){var temp=saveSelection("frm_smsdel","sms_todel",todel_pag);todel_pag=temp;var url="/vola-sms/dettagliotrafficosms.php";var params="d="+giorno+"&pageID="+page;_updateSectionPage(url,"areacontenuti",params)}function cambiaPagDifferiti(page){var temp=saveSelection("frm_differiti","idcanc",differiti_pag);differiti_pag=temp;var url="/vola-sms/get_layer.php";var params="type=differiti&pageID="+page;_updateSectionPage(url,"areacontenuti",params)}function dettaglioDifferiti(data,from){var url="/vola-sms/get_layer.php";var params="type=differiti&dt="+data+"&from="+from;_updateSectionPage(url,"areacontenuti",params)}function dettaglioSMS(idsms){var url="/vola-sms/get_layer.php";params="type=dett_sms&idsms="+idsms;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function dettaglioMMS(idmms,clorid){var url="/vola-sms/get_layer.php";params="type=dett_mms&idmms="+idmms+"&clorid="+clorid;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function pincodeRegistrazione(){var pincode="";var remember="";if($("pincode")){pincode=$F("pincode")}if($("remember")){remember=$F("remember")}var url="/vola-sms/registrazione_wlcip.php";var params="step=3&pincode="+pincode+"&remember="+remember;_callAjax(url,params)}function cambiaPagDestinatariSMS(idsms,page){var url="/vola-sms/get_layer.php";var params="type=dett_sms&pageID="+page+"&idsms="+idsms;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function loginwlcip(){if($("username")&&$("password")){var d=$("login_error");if($F("username")==""){if(d){var msgerror="<b>Inserire lo username</b>";Element.update(d,msgerror)}return false}if($F("password")==""){if(d){var msgerror="<b>Inserire la password</b>";Element.update(d,msgerror)}return false}myConfirm("login_remember");return true}return false}function focusDestinatariOn(){if(!$("hdests")||!$("destinatari")){return false}if($F("hdests")==-1||$F("hdests")==""){$("destinatari").style.fontStyle="normal";$("destinatari").value=""}}function focusDestinatariOff(){if(!$("hdests")||!$("destinatari")){return false}if($F("hdests")==-1||$F("destinatari")==""){$("destinatari").style.fontStyle="italic";$("destinatari").value="[Inserisci i numeri dei destinatari separati da virgola oppure un nominativo presente nei contatti]";$("hdests").value=-1}}function destinatariKeyPress(){if($("hdests")){$("hdests").value=1}}function focusAmicoMsgOn(){if(!$("hmsg")||!$("msg")){return false}if($F("hmsg")==-1||$F("msg")==""){$("msg").style.fontStyle="normal";$("msg").value=""}}function focusAmicoMsgOff(){if(!$("hmsg")||!$("msg")){return false}if($F("hmsg")==-1||$F("msg")==""){$("msg").style.fontStyle="italic";$("msg").value="[Inserisci un eventuale testo personalizzato da inviare ai tuoi amici]";$("hmsg").value=-1}}function amicoMsgKeyPress(){if($("hmsg")){$("hmsg").value=1}}function focusAmicoDestsOn(){if(!$("hdests")||!$("dests")){return false}if($F("hdests")==-1||$F("dests")==""){$("dests").style.fontStyle="normal";$("dests").value=""}}function focusAmicoDestsOff(){if(!$("hdests")||!$("dests")){return false}if($F("hdests")==-1||$F("dests")==""){$("dests").style.fontStyle="italic";$("dests").value="[Inserisci i destinatari utilizzando come separatore la virgola o il punto e virgola]";$("hdests").value=-1}}function amicoDestsKeyPress(){if($("hdests")){$("hdests").value=1}}function acquistaCredito(p){CloseDialogBox();if(p=="PXX"||p=="P"){window.location="http://www.vola.it/ecommerce/catalogo.php?id=2"}else{window.location="http://www.vola.it/ecommerce/catalogo.php?id=3"}}function myAlert(event,myparams){var d=$("ModalWinConfirm");var html="<div id='ModalBGConfirm'></div><div id='DialogWindowConfirm' style='width:[WIDTH]px;'><div class='shadow1'><div class='shadow2'><div class='shadow3'><div class='container'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='right'><div class='dw_header'><table width='100%' border='0' cellspacing='0'cellpadding='0'><tr><td width='83%' align='center' class='dw_title'>[CAPTION]</td><td width='17%' align='right'><img src='/files_comuni_mini/img/pulsanti/chiudi.gif' width='21'height='21' onClick='closeMyConfirm()' /></td></tr></table></div></td></tr><tr><td><div class='[CONTENT_STYLE]'>[MESSAGE]<form id='frm_login' method='post' action='javascript:void%200'><table class='txt10' width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td height='15px'></td></tr><tr><td height='30' valign='top'><div align='center'><input type='button' name='Submit' value='OK' onClick=\"[JSACTION]\"><div id='login_error'></div></td></tr></table></form></div></td></tr></table></div></div></div></div></div>";if($("btnInvia")){$("btnInvia").disabled=false}switch(event){case"canc_traffico":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","300");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","I messaggi selezionati sono stati cancellati.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_sms_empty":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","300");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Non sono stati selezionati SMS da eliminare.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credsms_error":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito SMS da aggiungere/togliere al subaccount deve essere un avalore numerico maggiore di 0.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credmms_error":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito MMS da aggiungere/togliere al subaccount deve essere un avalore numerico maggiore di 0.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credsms+_no_credit":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il tuo credito SMS non &egrave; sufficiente. Per poter completare l'operazione &egrave; necessario acquistare nuovo credito SMS.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credmms+_no_credit":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il tuo credito MMS non &egrave; sufficiente. Per poter completare l'operazione &egrave; necessario acquistare nuovo credito MMS o convertire credito SMS in credito MMS.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credsms-_credit_err":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione! Il credito SMS che stai tentando di togliere al tuo sub-account &egrave; maggiore del suo credito disponibile. Controlla e riprova.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credmms-_credit_err":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione! Il credito MMS che stai tentando di togliere al tuo sub-account &egrave; maggiore del suo credito disponibile. Controlla e riprova.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"credsms+_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito SMS &egrave; stato assegnato con successo al tuo sub-account.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('subaccount');");break;case"credmms+_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito MMS &egrave; stato assegnato con successo al tuo sub-account.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('subaccount');");break;case"credsms-_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito SMS &egrave; stato decrementato con successo al tuo sub-account.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('subaccount');");break;case"credmms-_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il credito MMS &egrave; stato decrementato con successo al tuo sub-account.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('subaccount');");break;case"sub_lic_add_err":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Non si hanno abbastanza licenze per procedere con l'assegnazione.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_mod_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il tuo sub-account &egrave; stato modificato con successo.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_del_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il tuo sub-account &egrave; stato cancellato con successo.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_send_data_ko":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio della email con i dati di accesso del tuo sub-account non &egrave; riuscito.Controlla l'indirizzo di email associato al sub-account in oggetto e riprova.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_send_data_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio della email con i dati di accesso del tuo sub-account &egrave; stato completato con successo.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_err_maxnum":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Non &egrave; possibile creare altri sub-account poich&egrave; &egrave; stato raggiunto il numero massimo (30) di sub-account che &egrave; possibile associare al tuo account principale.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_crea_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il sub-account &egrave; stato creato con successo. Puoi inviare subito i dati relativi al sub-account appena creato (username e password) all'indirizzo email inserito durante la creazione. Per inviare i dati clicca <a href='#' onClick='CloseDialogBoxConfirm();inviaDatiAccesso("+myparams[0]+")'>qui</a>");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"pt_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'operazione di cambio listino &egrave; stata eseguita correttamente.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm()");break;case"pt_ok_silver":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'operazione di cambio listino &egrave; stata eseguita correttamente.<br><br><b>ATTENZIONE al profilo SILVER</b>: ritardi e problemi di consegna sono possibili in vari momenti della giornata. Vi ricordiamo che la consegna dei messaggi SMS sul profilo SILVER (bassa qualit&agrave;) &egrave; di tipo \"Best Effort\" e non &egrave; quindi garantita. Consigliamo l'utilizzo del profilo GOLD.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm()");break;case"pt_ko_diff":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione!<br>Ci sono "+myparams[0]+" SMS programmati per l'invio differito, pertanto non &egrave; possibile cambiare il profilo tariffario fino a che tali messaggi non saranno inviati o verranno cancellati.<br><br>&Egrave; possibile visualizzare ed eventualmente eliminare tali messaggi differiti cliccando <a href='#' onClick=\"CloseDialogBoxConfirm();LoadPageContenuti('differiti')\">qui</a>.<b> Dopodich&egrave; sar&agrave; possibile modificare il profilo tariffario</b>.Una volta cambiato il profilo, i messaggi cancellati dall'invio differito andranno nuovamente reinseriti.&Egrave; possibile attendere che tutti i messaggi differiti vengano inviati e poi effettuare il cambio listino.<br><br><br>L'invio dell'ultimo messaggio &egrave; previsto per il: <b>"+myparams[1]+"</b>");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"pt_ko_subaccount":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Non &egrave; possibile cambiare il tipo di listino associato all'account principale poich&egrave; sono stati creati dei sub-account con il listino attuale. Prima di cambiare listino &egrave; necessario cancellare tutti i subaccount creati.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_cmp_ok":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","La campagna SMS parametrica &egrave; stata cancellata con successo.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"cmp_resend_diff_err":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio di ulteriori messaggi parametrici deve essere posteriore a quello della campagna madre.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_cmp_err1":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Impossibile cancellare una campagna in fase di processamento. Attendere la fine del processamento e riprovare.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_cmp_err2":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Impossibile cancellare una campagna in fase di invio. Attendere la fine dell'invio in corso.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_cmp_err3":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Impossibile cancellare una campagna gi&agrave; inviata.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"cmp_duplicata":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Esiste gi&agrave; una campagna con lo stesso nome. Scegli un nuovo nome.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();loadJson('inviosms_1')");break;case"cmp_diff_err":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio di una campagna SMS parametrica deve essere differito di almeno 5 minuti dalla data/ora corrente.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"volasync":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","NOVIT&Agrave;");html=html.replace("[MESSAGE]","<p>VOLASYNC &egrave; un innovativo software (l'ultimo nato della famiglia delle applicazioni Vola) per tenere costantemente sincronizzata la tua rubrica di Outlook (2000. XP. 2003 e 2007) e Outlook Express (versione 6). Installando VOLASYNC potrai mantenere aggiornati tutti i tuoi contatti di Outlook (in maniera automatica impostando il periodo di sincronizzazione) con la tua rubrica di Vola sul web. Aggiornando o aggiungendo un nuovo contatto su Outlook sul tuo PC, automaticamente VOLASYNC aggiorner&agrave; la tua rubrica Vola sul web. </p><p style='margin-bottom: 0;'>In questo modo dovunque sarai, anche non avendo il tuo PC a disposizione, potrai inviare messaggi SMS a tutti i contatti della tua rubrica senza dover cercare o ricordare i numeri di telefono.<br><p></p><P style='margin-top: 0; margin-bottom: 0px;'>Per scaricare VOLASYNC<STRONG> <a href='/download/volasync/SetupVolaSync.exe' onClick='CloseDialogBoxConfirm();' class='btn'>clicca qui</a></STRONG> (Compatibile con Windows ME/NT4.0/2000/XP/VISTA)</P>");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sender_demo_alert":chtml="Le personalizzazione del mittente non &egrave; consentita in modalit&agrave; demo. Sar&agrave; possibile modificare il mittente, nel caso di SMS di tipo Gold, soltanto dopo aver effettuato almeno un acquisto.<br><br>Per acquistare clicca <a href='#' onClick=\"alertSMS('close_acquista_demo', '{$iswelcomeip}')\">qui.</a>";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sender_silver_alert":chtml="La personalizzazione del mittente non &egrave; consentita con profilo silver. Per utilizzare questa funzionalit&agrave; &egrave; necessario passare al profilo Gold.<br><br>Per cambiare il tuo profilo clicca <a href='#' onClick=\"alertSMS('close_impostazioni_silver', '{$iswelcomeip}')\">qui.</a>";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sender_demosilver_alert":chtml="La personalizzazione del mittente non &egrave; consentita se il tuo account &egrave demo e/o con profilo silver. Per utilizzare questa funzionalit&agrave; &egrave; necessario passare al profilo Gold ed effettuare almeno un acquisto.<br><br>Per cambiare il tuo profilo clicca <a href='#' onClick=\"alertSMS('close_impostazioni_demosilver', '{$iswelcomeip}')\">qui.</a><br><br>Per acquistare clicca <a href='#' onClick=\"alertSMS('close_acquista_demosilver', '{$iswelcomeip}')\">qui.</a>";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"wlcip_daily_block":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione! L'invio corrente &egrave; stato bloccato dai sistemi Vola per traffico anomalo proveniente dagli accounts della tua Azienda. Per esigenze di invio giornaliero di grandi quantit&agrave; di SMS &egrave; possibile contattare il servizio Clienti Vola al numero 199 45 46 52 o inviare una email a supporto@vola.it");html=html.replace("[JSACTION]","LoadPage('inviosms');CloseDialogBoxConfirm();");break;break;case"conf_invito":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Invito inviato");html=html.replace("[MESSAGE]","L'invito &egrave; stato inviato ai tuoi amici.");html=html.replace("[JSACTION]","LoadPage('dilloamico');CloseDialogBoxConfirm();");break;default:case"connection_error":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione si &egrave; verificato un errore di comunicazione.<br>Se il problema persiste contattare il supporto tecnico inviando una mail a supporto@vola.it.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"generic_error":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione si &egrave; verificato un errore di comunicazione.<br>Se il problema persiste contattare il supporto tecnico inviando una mail a supporto@vola.it.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();window.location = '/'");break;case"canc_diff":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: i messaggi SMS sono stati cancellati con successo");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_no_contacts_select":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Seleziona almeno un contatto da eliminare");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"del_diff_empty":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: selezionare almeno un sms differito da cancellare");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sms_no_dests":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Seleziona almeno un contatto a cui inviare l'SMS");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"login_remember":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Selezionando questa opzione non ti verr&agrave; richiesto di inserire la password ad ogni accesso<br><br><input type='checkbox' name='remember' value='yes'>Ricordami su questo computer");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"change_profile":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il profilo &egrave; stato salvato con le nuove informazioni inserite.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('profilo_wlcip')");break;case"change_pswd":html=html.replace("[CONTENT_STYLE]","dw_contents");html=html.replace("[WIDTH]","250");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","La nuova password &egrave; stata memorizzata.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();LoadPageContenuti('profilo_wlcip')");break;case"save_cmp_ok":chtml="La campagna &egrave; stata presa in consegna correttamente dal server per l'invio.";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm(); menuUpdate('giallo', '2'); loadJson('cmp_sms_programmati')");break;case"save_cmp_ko":chtml="Si &egrave; verificato un problema nella procedura di invio della campagna al server. Riprova ad inviare la campagna e se l'errore persiste contatta il supporto tecnico.";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm()");break;case"save_cmp_nocredit":chtml="Il tuo credito residuo non &egrave; sufficiente per procedere con l'invio della campagna SMS parametrica. &Egrave; necessario prima acquistare ulteriore credito SMS.";html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm()");break;case"nb_silver":chtml='ATTENZIONE al profilo SILVER: ritardi e problemi di consegna sono possibili in vari momenti della giornata. Vi ricordiamo che la consegna dei messaggi SMS sul profilo SILVER (bassa qualit&agrave;) &egrave; di tipo "Best Effort" e non &egrave; quindi garantita. Consigliamo l\'utilizzo del profilo GOLD.<br><br>';html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","335");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]",chtml);html=html.replace("[JSACTION]","CloseDialogBoxConfirm()");break;case"avviso":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","500");html=html.replace("[CAPTION]","AVVISO IMPORTANTE");html=html.replace("[MESSAGE]","Gentile Cliente,<br /><br />La informiamo che nel periodo dal <b>2 Agosto al 22 Agosto 2010</b> compresi i nostri uffici rimarranno chiusi. Pur garantendo, come di consueto, il presidio e il funzionamento del Gateway Vola h24, durante tale periodo, non sar&agrave; disponibile il servizio di help desk telefonico funzionante durante il normale orario di ufficio nei giorni lavorativi.<br /><br />Per problemi urgenti sar&agrave; tuttavia sempre disponibile un servizio di supporto via email all'indirizzo <a href='mailto:supporto@vola.it'>supporto@vola.it</a> (i problemi tecnici / di integrazione con il gateway saranno per&ograve; presi in consegna dai nostri tecnici al rientro dopo il 22 Agosto). Durante tutto questo periodo saranno comunque elaborati tutti gli ordini ricevuti che hanno come pagamento il bonifico bancario, il vaglia postale e la carta di credito via fax. In questi casi l'accredito dei relativi messaggi sar&agrave; effettuato entro il giorno lavorativo successivo alla ricezione del pagamento. Per quanto riguarda la necessit&agrave; di accrediti urgenti Vi consigliamo di utilizzare il servizio di pagamento con carta di credito on-line presente sul sito <a href='http://www.vola.it'>www.vola.it</a> che sar&agrave;, come di consueto, sempre disponibile.<br /><br />Ricordiamo che in alcuni casi, per motivi di sicurezza, anche nel caso di acquisto con carta di credito on-line (come riportato sul sito al momento della scelta del pagamento con carta di credito) i messaggi potranno non essere accreditati immediatamente ma soltanto dopo il controllo da parte di un nostro operatore. In questi casi l'effettivo addebito dell'importo sulla carta di credito (e quindi l'accredito dei messaggi sull'account) avverr&agrave; il giorno lavorativo successivo all'acquisto effettuato sul sito.<br /><br />Cogliamo l'occasione per augurare buone vacanze a tutti.<br /><br />Cordialmente,<br /><br />Staff Vola<br />Vola S.p.A.");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break;case"sub_no_del":html=html.replace("[CONTENT_STYLE]","dw_contents_justify");html=html.replace("[WIDTH]","400");html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Il Subaccount selezionato ha "+myparams[0]+" SMS programmati per l'invio, pertanto non &egrave; possibile procedere con la sua cancellazione fino a che tali messaggi non saranno cancellati o inviati.<br /><br />L'invio dell'ultimo messaggio &egrave; proevisto per il : <b>"+myparams[1]+"</b>");html=html.replace("[JSACTION]","CloseDialogBoxConfirm();");break}Element.update(d,html);ShowLayerConfirm()}function myConfirm(event,myparams){var d=$("ModalWinConfirm");var html="<div id='ModalBGConfirm'></div><div id='DialogWindowConfirm' style='width:[WIDTH]px;'><div class='shadow1'><div class='shadow2'><div class='shadow3'><div class='container'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='right'><div class='dw_header'><table width='100%' border='0' cellspacing='0'cellpadding='0'><tr><td width='83%' align='center' class='dw_title'>[CAPTION]</td><td width='17%' align='right'><div id='xclose'><img src='/files_comuni_mini/img/pulsanti/chiudi.gif' width='21'height='21' onClick='closeMyConfirm()' /></div></td></tr></table></div></td></tr><tr><td><div class='dw_contents' id='dw_contents'>[MESSAGE]<form id='frm_login' method='post' action='javascript:void%200'><table width='100%' border='0' cellpadding='0' cellspacing='0'	class='txt10'><tr><td height='15px'></td></tr><tr><td width='767' height='30' valign='top'><div align='center'><input type='button' id='btnok' name='Submit' value='OK' onClick=\"[JSACTIONOK]\"><input type='button' id='btnannulla' name='Submit' value='Annulla' onClick=\"[JSACTIONKO]\"><div id='login_error'></div></td></tr></table></form></div></td></tr></table></div></div></div></div></div>";window_width="250";switch(event){case"conf_invio_estero":window_width="350";html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Per procedere con l'invio corrente &egrave; necessario abilitare l'invio verso destinatari esteri.<br /><br />Cliccando su \"OK\" l'abilitazione verr&agrave; fatta automaticamente e i messaggi saranno inviati.");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();forzaInvioEstero('frm_inviosms')");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();invioSMS()");break;case"confirm_del_sms":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Confermi la cancellazione degli SMS selezionati?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();doCancellaTrafficoSMS('"+myparams+"')");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"delsubaccount":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Confermi la cancellazione del sub-account selezionato?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();gestioneSubaccountUtente('"+myparams+"', 'del')");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"cambiaprofilo":html=html.replace("[CAPTION]","Attenzione");if(myparams==1){html=html.replace("[MESSAGE]","<b>ATTENZIONE!:</b>Il profilo Silver &egrave; un profilo di BASSA QUALIT&Agrave; che utilizza per la consegna dei messaggi SMS diversi operatori esteri. La consegna dei messaggi &egrave; di tipo \"Best Effort\" e non &egrave; quindi garantita, sono possibili ritardi e problemi di consegna (in alcuni casi si possono riscontrare anche mancate consegne) in vari momenti della giornata.<br /><br />Confermando il cambio di profilo da Gold a Silver, accetto quanto sopra riportato e prendo atto che VOLA S.p.A. non potr&agrave; essere ritenuta responsabile di eventuali disservizi che potranno accadere con l'utilizzo del servizio Silver. VOLA consiglia l'utilizzo del profilo Gold.<br /><br />Confermi l'operazione di cambio profilo tariffario?");window_width="400"}else{html=html.replace("[MESSAGE]","Confermi l'operazione di cambio profilo tariffario?")}html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();cambiaProfiloTariffario()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_del_resend":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Cancellare l'invio della sottocampagna?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();nuovaCampagna()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_del_report_cmp_madre":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Verranno eliminati tutti i report associati alla campagna madre.<br>Procedere con l'eliminazione del reporto di invio?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();doCMPDeleteReportInvio()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_del_report_cmp":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Procedere con l'eliminazione del report di invio?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();doCMPDeleteReportInvio()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_del_campagna":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","La cancellazione della campagna selezionata annulla l'invio degli SMS associati.\r\nSi intende procedere?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();doDeleteDifferito()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_send_cmp":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Procedere con l'invio della campagna impostata?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();sendCMP()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_new_cmp":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","La creazione di una nuova campagna comporta la perdita di tutti i dati impostati per la campagna corrente.<br>Continuare?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();nuovaCampagna()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm()");break;case"confirm_send_sms":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione sono stati selezionati per l'invio "+myparams[0]+" destinatari.<br>Procedere con l'invio dell'SMS?");if(myparams[0]<=200){html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm(); do_send_sms('"+myparams[1]+"')")}else{html=html.replace("[JSACTIONOK]","doSendSMSOptimized('"+myparams[1]+"')")}html=html.replace("[JSACTIONKO]","abortSendOptimized()");break;case"canc_contatto_corrente":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Procedendo con l'operazione le informazioni relative al contatto selezionato saranno cancellate.<br>Continuare?");html=html.replace("[JSACTIONOK]","doEliminaContattoCorrente('"+myparams[0]+"');CloseDialogBoxConfirm();");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"do_del_contacts":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: i contatti selezionati saranno eliminati dalla rubrica.<br>Procedere con l'operazione?");html=html.replace("[JSACTIONOK]","doEliminaContatti();CloseDialogBoxConfirm();");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"do_del_differiti":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: procedendo con l'operazione gli sms differiti selezionati verranno cancellati<br>Procedere?");html=html.replace("[JSACTIONOK]","doEliminaDifferiti()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_contatto":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Le modifiche al contatto non sono state salvate. Si desidera uscire comunque?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();CloseDialogBox();applicaFiltroContatti('contatti');");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_sms_contatti":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","applicaFiltroContatti('contatti'); CloseDialogBoxConfirm();");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_sms_impostazioni":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();LoadPage('senders');");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_impostazioni_senders":CloseDialogBox();html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();LoadPage('senders');");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();DialogBox('sender')");break;case"close_impostazioni_silver":case"close_impostazioni_demosilver":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");if(myparams[0]!=1){html=html.replace("[JSACTIONOK]","LoadPageContenuti('impostazioni'); CloseDialogBoxConfirm();")}else{html=html.replace("[JSACTIONOK]","LoadPageContenuti('senders'); CloseDialogBoxConfirm();")}if(event=="close_impostazioni_silver"){html=html.replace("[JSACTIONKO]","myAlert('sender_silver_alert', null)")}else{html=html.replace("[JSACTIONKO]","myAlert('sender_demosilver_alert', null)")}break;case"close_sms_traffico":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","dettaglioTrafficoSMS('year', null, 1); CloseDialogBoxConfirm();");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_sms_acquista":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","LoadPage('acquista'); CloseDialogBoxConfirm();");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"close_acquista_demo":case"close_acquista_demosilver":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","L'invio corrente non &egrave; stato completato. Uscendo da questa sezione verranno perdute le modifiche correnti. Si vuole proseguire?");html=html.replace("[JSACTIONOK]","LoadPage('acquista'); CloseDialogBoxConfirm();");if(event=="close_acquista_demo"){html=html.replace("[JSACTIONKO]","myAlert('sender_demo_alert', null)")}else{html=html.replace("[JSACTIONKO]","myAlert('sender_demosilver_alert', null)")}break;case"abort_reg_wlcip":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: la procedura di registrazione non &egrave; stata portata a termine.<br><br>Procedendo con l'operazione di chiusura sar� necessario reinserire tutti i dati.");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm(); CloseDialogBox()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break;case"riautentica":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: per il numero mittente "+myparams[0]+" non &egrave; stata portata a termine la procedura di autenticazione. Prima di poter autenticare un altro numero mittente &egrave; necessario portare a termine questa operazione.<br>Continuare con l'autenticazione del numero "+myparams[0]+"?");html=html.replace("[JSACTIONOK]","sendPincode('"+myparams[0]+"')");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();LoadPageContenuti('senders');");break;case"dell_all_contacts":html=html.replace("[CAPTION]","Attenzione");html=html.replace("[MESSAGE]","Attenzione: procedendo con l'operazione tutti i contatti verranno eliminati.");html=html.replace("[JSACTIONOK]","CloseDialogBoxConfirm();doDelAllContacts()");html=html.replace("[JSACTIONKO]","CloseDialogBoxConfirm();");break}html=html.replace("[WIDTH]",window_width);Element.update(d,html);ShowLayerConfirm()}function doSendSMSOptimized(frm){var d=$("ModalWinConfirm");d.empty();var html="<div id='ModalBGConfirm'></div><div id='DialogWindowConfirm' style='width:250px;'><div class='shadow1'><div class='shadow2'><div class='shadow3'><div class='container'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='right'><div class='dw_header'><table width='100%' border='0' cellspacing='0'cellpadding='0'><tr><td align='center' class='dw_title'>Attenzione</td></tr></table></div></td></tr><tr><td width='100%'><div id='dw_contents' class='dw_contents' style='height: 70px'>Invio in corso...<br><br><div id='progress_bar'></div><div id='pbar_percentage'>0%</div></div></td></tr></table></div></div></div></div></div>";Element.update(d,html);ShowLayerConfirm();if($("ModalBG")){$("ModalBG").style.display="inline"}var filename=(new Date().getTime())+".txt";progress_bar=new Control.ProgressBar("progress_bar",{afterChange:function(progress,active){var d=$("pbar_percentage");if(progress>=100){Element.update(d,"100%");progress_bar.stop(false);confirmSendOptimized()}else{Element.update(d,progress+"%")}},interval:0.15});try{progress_bar.poll("sendopt_progress_bar.php?filename="+escape(filename),2);var params=Form.serialize(frm);params+="&step=1&filename="+escape(filename);_callAjax("sendSmsOptimized.php",params)}catch(e){}}function abortSendOptimized(){CloseDialogBoxConfirm();if($("ModalBG")){$("ModalBG").style.display="none"}d=$("pbarcontainer");d.style.display="none";try{var params="step=3";var myAjax=new Ajax.Request("sendSmsOptimized.php",{parameters:params,onFailure:ShowError})}catch(e){}LoadPage("inviosms")}function confirmSendOptimized(){if($("ModalBG")){$("ModalBG").style.display="none"}_callAjax("sendSmsOptimized.php","step=2")}function sessionUpdater(){try{if(session_control==null){session_control=new Ajax.PeriodicalUpdater("","session_updater.php",{asynchronous:true,frequency:600,onSuccess:_processResponse})}}catch(e){}}function checkSendersControl(x){if(x==1){if($("sms_sender")){$("sms_sender").disabled=true}if($("sender_always")){$("sender_always").disabled=true}if($("sender_current")){$("sender_current").disabled=true}}}function sendInvito(){var dests="";var ckbxris=false;var errore=false;var msg_err="";if($("dests")){dests=$F("dests")}if($("ckbxris")){ckbxris=$F("ckbxris")}if(dests==""){errore=true;msg_err+="- Attenzione! &Egrave; necessario inserire almeno un indirizzo email prima di procedere con l'invio.<br>"}if(!ckbxris){errore=true;msg_err+="- Attenzione! Prima di procedere con l'invio &egrave; necessario accettare l'informativa sulla privacy.<br>"}var re_space=new RegExp(" ","ig");var re_virg=new RegExp(",","ig");dests=dests.replace(re_space,"");dests=dests.replace(re_virg,";");var lst_email=dests.split(";");var regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;var regexp_autoc=/.*<([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+>.*/;var cerr=0;for(var i=0;i<lst_email.length;i++){if(!regexp.test(lst_email[i])&&lst_email[i]!=""&&!regexp_autoc.test(lst_email[i])){cerr++}}if(cerr>0){errore=true;msg_err+="- Attenzione! Gli indirizzi email inseriti sono errati. Controlla gli indirizzi inseriti e riprova.<br>"}if(errore){if($("msg_err")){Element.update($("msg_err"),msg_err)}return false}var params=Form.serialize("frm_amico");_callAjax("send_inviti.php",params)}function chiudiAnteprimaInvito(){var d=$("ModalWin");Element.update(d,"");CloseDialogBox()}function anteprimaInvito(){var dests="";var hdests=-1;if($("dests")){dests=$F("dests")}if($("hdests")){hdests=$F("hdests")}if(hdests==-1){Element.update($("err_msg"),"- Attenzione! &Egrave; necessario inserire almeno un indirizzo email prima di procedere con l'invio.");return false}var re_space=new RegExp(" ","ig");var re_virg=new RegExp(",","ig");dests=dests.replace(re_space,"");dests=dests.replace(re_virg,";");var lst_email=dests.split(";");var regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;var regexp_autoc=/.*<([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+>.*/;var cerr=0;for(var i=0;i<lst_email.length;i++){if(!regexp.test(lst_email[i])&&lst_email[i]!=""&&!regexp_autoc.test(lst_email[i])){cerr++}}if(cerr>0){Element.update($("err_msg"),"- Attenzione! Gli indirizzi email inseriti sono errati. Controlla gli indirizzi inseriti e riprova.");return false}var url="/vola-sms/get_layer.php";var params=Form.serialize("frm_amico");params+="&type=anteprima_invito";try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function loadFormInvito(){var url="/vola-sms/get_layer.php";var params=Form.serialize("frm_amico");params+="&type=invita_amico";_updateSectionPage(url,"",params)}function showBannerAmico(){if(navigator.appName=="Microsoft Internet Explorer"){_callAjax("showBannerAmico.php","")}}function trafficoSearch(frm){todel_pag=new Array();var params=Form.serialize(frm);params+="&formtype="+frm;_callAjax("/vola-sms/get_jlayer.php",params)}function cambiaPagTrafficSearch(params){var temp=saveSelection("frm_smsdel","sms_todel",todel_pag);todel_pag=temp;_callAjax("/vola-sms/get_jlayer.php",params)}function profiloTariffario(){var url="/vola-sms/get_jlayer.php";var params="type=profilotariffario";_callAjax(url,params)}function invioSMS(){var url="/vola-sms/get_jlayer.php";var params="type=inviosms";_callAjax(url,params)}function cambiaProfiloTariffario(){var url="/vola-sms/get_jlayer.php";var params="type=cambiaprofilo";_callAjax(url,params)}function salvaSubaccount(id){var username="";var password="";var nsms=0;var nmms=0;var email="";var errore=false;var msgerror="Attenzione:<br>";if($("user")){username=$F("user")}if($("password")){password=$F("password")}if($("nsms")){nsms=$F("nsms")}if($("nmms")){nmms=$F("nmms")}if($("email")){email=$F("email")}if(username==""){errore=true;msgerror+="Il campo username &egrave; obbligaorio<br>"}if(password==""){errore=true;msgerror+="Il campo password &egrave; obbligaorio<br>"}if(id==0){if(isNaN(nsms)){errore=true;msgerror+="Il credito SMS deve essere un valore numerico<br>"}if(isNaN(nmms)){errore=true;msgerror+="Il credito MMS deve essere un valore numerico<br>"}if(nmms<=0&&nsms<=0){errore=true;msgerror+="Per creare il sub-account &egrave; necessario inserire almeno uno tra credito SMS e MMS<br>"}}var regexp=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if(email==""||!regexp.test(email)){errore=true;msgerror+="Inserire un indirizzo email valido<br>"}if(errore){var d=$("msgerror");if(d){Element.update(d,msgerror)}return}var url="/vola-sms/mng_subaccount.php";var params=Form.serialize("frmSubaccount");if(id==0){params+="&type=new"}else{params+="&type=mod&id="+id}_callAjax(url,params)}function inviaDatiAccesso(id){var url="/vola-sms/mng_subaccount.php";var params="&type=send_data&id="+id;_callAjax(url,params)}function gestioneSubaccountUtente(id,type){var credsms="";var credmms="";if($("creditosms_"+id)){credsms=$F("creditosms_"+id)}if($("creditomms_"+id)){credmms=$F("creditomms_"+id)}if((type=="credsms+"||type=="credsms-")&&(isNaN(credsms)||credsms<0||credsms=="")){myAlert("credsms_error",null);$("creditosms_"+id).value="";return}if((type=="credmms+"||type=="credmms-")&&(isNaN(credmms)||credmms<0||credmms=="")){myAlert("credmms_error",null);$("creditomms_"+id).value="";return}var url="/vola-sms/mng_subaccount.php";var params="type="+type+"&id="+id+"&credsms="+credsms+"&credmms="+credmms;_callAjax(url,params)}function checkCancellazioneSubaccountUtente(idsub){var url="/vola-sms/mng_subaccount.php";var params="type=checkdel&idsub="+idsub;_callAjax(url,params)}function modificaSubaccountUtente(id,type){var url="/vola-sms/get_layer.php";var params="type="+type+"&id="+id;try{var myAjax=new Ajax.Updater({success:"ModalWin"},url,{parameters:params,onComplete:ShowLayer,evalScripts:true})}catch(e){myAlert("connection_error",null)}}function gestisciLicenze(type,id,cmd){var disp=0;var ass=0;var us=0;var q=0;var d=$("msgerror");var msg="";if($(type+"_disp")){disp=parseInt($F(type+"_disp"))}if($(type+"_ass")){ass=parseInt($F(type+"_ass"))}if($(type+"_us")){us=parseInt($F(type+"_us"))}if($(type+"_q")){q=parseInt($F(type+"_q"))}if(isNaN(q)||q<=0){msg="Il numero di licenze da aggiungere/togliere deve essere un valore numerico maggiore di 0";Element.update(d,msg);return}if(cmd=="+"&&q>disp){msg="Non si hanno abbastanza licenze per procedere con l'assegnazione";Element.update(d,msg);return}if(cmd=="-"&&q>ass){msg="Si sta cercando di togliere un numero di licenze maggiore rispetto a quello assegnato al subaccount";Element.update(d,msg);return}var url="/vola-sms/mnglicsubaccount.php";var params="cmd="+cmd+"&tipolic="+type+"&id="+id+"&q="+q+"&disp="+disp+"&ass="+ass+"&us="+us;_callAjax(url,params)}function cambiaPagSubaccount(page,filtro){var url="/vola-sms/get_layer.php";var params="";if(filtro==0){params="type=subaccount&pageID="+page}else{params="type=filtrasubaccount&pageID="+page}_updateSectionPage(url,"areacontenuti",params)}function applicaFiltroSubaccount(){var username="";var crsmsda="";var crsmsa="";var crmmsda="";var crmmsa="";if($("username")){username=$F("username")}if($("crsmsda")){crsmsda=$F("crsmsda")}if($("crsmsa")){crsmsa=$F("crsmsa")}if($("crmmsda")){crmmsda=$F("crmmsda")}if($("crmmsa")){crmmsa=$F("crmmsa")}var d,m;if(username==""&&crsmsda==""&&crsmsa==""&&crmmsda==""&&crmmsa==""){d=$("msgerr");m="Specificare almeno un parametro di ricerca.";Element.update(d,m);return}if(isNaN(crsmsda)||isNaN(crsmsa)||isNaN(crmmsda)||isNaN(crmmsa)){d=$("msgerr");m="Il valore che indica il range di ricerca per il credito deve essere un valore numerico.";Element.update(d,m);return}if(crsmsa<crsmsda){d=$("msgerr");m="I valori del credito SMS che hai inserito per la ricerca non sono corretti. Controlla di aver inserito un intervallo di ricerca corretto e riprova.";Element.update(d,m);return}if(crmmsa<crmmsda){d=$("msgerr");m="I valori del credito MMS che hai inserito per la ricerca non sono corretti. Controlla di aver inserito un intervallo di ricerca corretto e riprova.";Element.update(d,m);return}var url="get_layer.php";var params="type=filtrasubaccount&username="+username+"&crsmsda="+crsmsda+"&crsmsa="+crsmsa+"&crmmsda="+crmmsda+"&crmmsa="+crmmsa;_updateSectionPage(url,"areacontenuti",params)}function menuUpdate(menu_name,csel){var sel_name="";for(var i=1;i<=15;i++){sel_name=menu_name+"_"+i;if($(sel_name)){$(sel_name).removeClassName("SUBSELEZIONE"+menu_name)}}var current=menu_name+"_"+csel;if($(current)){$(current).toggleClassName("SUBSELEZIONE"+menu_name)}}function esportaRubrica(){window.location="/vola-sms/esporta_rubrica.php"};