var msgTrasporto='Ci sono stati dei problemi nella comunicazione con il server.<br/>Si prega di riprovare più tardi.<br/><br/>In caso il problema persista si prega di inviare una mail con il problema riscontrato a comunication@cybermatic.eu';var msgInterno="Ci sono stati dei problemi interni dell'applicativo.<br/>Si prega di riprovare più tardi.<br/><br/>In caso il problema persista si prega di inviare una mail con il problema riscontrato a comunication@cybermatic.eu";var waitURL="../img/GenericBE/updateProgress.gif";function getPopEdit(request,urlRequest,idDiv,fSalva,titolo,aInfo,iLogo){wait();$.ajax({type:"POST",contentType:"application/json; charset=utf-8",timeout:30000,url:urlRequest,data:$.toJSON(request),success:function(msg){if(msg=="KO - Generic Error"){resume();showInfoAjax('Errore:',msgInterno);}else{$('#'+idDiv).popupShow(msg,titolo,fSalva,aInfo,iLogo);resume();}},error:function(XMLHttpRequest,textStatus,errorThrown){resume();showInfoAjax('Errore:',msgTrasporto);}});}function getDataPop(request,urlRequest,idDivDest,idDivPop){wait();$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:urlRequest,timeout:30000,data:$.toJSON(request),success:function(msg){if(msg=="KO - Generic Error"){resume();showInfoAjax('Errore:',msgInterno);}else{$('#'+idDivDest).html(msg);$('#'+idDivPop).popupHide();resume();}},error:function(XMLHttpRequest,textStatus,errorThrown){resume();showInfoAjax('Errore:',msgTrasporto);$('#'+idDivPop).popupError(msgTrasporto);}});}function getData(request,urlRequest,idDivDest){wait();$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:urlRequest,timeout:30000,data:$.toJSON(request),success:function(msg){if(msg=="KO - Generic Error"){resume();showInfoAjax('Errore:',msgInterno);}else{$('#'+idDivDest).html(msg);resume();}},error:function(XMLHttpRequest,textStatus,errorThrown){resume();showInfoAjax('Errore:',msgTrasporto);}});}function getWSData(request,urlRequest,fSuccess){wait();$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:urlRequest,timeout:30000,data:$.toJSON(request),success:fSuccess,error:function(XMLHttpRequest,textStatus,errorThrown){resume();showInfoAjax('Errore:',msgTrasporto);}});}function wait(){var bMsgBkg=$('<div/>').addClass('BlockInfoBack').attr('id','WaitMsg_Bkg').appendTo(document.body);var bMsg=$('<div/>').addClass('WaitInfo').attr('id','WaitMsg').appendTo(document.body);$('<div/>').addClass('Titolo').appendTo(bMsg).html('Attendere Prego...');var Msg=(arguments.length==0)?'Si prega di attendere prima di eseguire altre operazioni o ricaricare la pagina.':arguments[0];$('<div/>').addClass('Testo').appendTo(bMsg).html('<img src="'+waitURL+'" style="float:left;margin-right:10px;" /><div>'+Msg+'</div>');bMsg.overlay({mask:{color:'#999',loadSpeed:200,opacity:0.5},closeOnClick:false,load:true});bMsg.center(true);}function resume(){var bMsgBkg=$('#WaitMsg_Bkg');bMsgBkg.remove();var bMsg=$('#WaitMsg');bMsg.overlay().close();bMsg.remove();}function showInfoAjax(titolo,descrizione){bMsg=$('#blockMsg');bMsg.remove();bMsg=$('<div/>').addClass('BlockInfo').attr('id','blockMsg').appendTo(document.body);$('<div/>').addClass('Titolo').appendTo(bMsg).html(titolo);$('<div/>').addClass('Testo').appendTo(bMsg).html(descrizione);bMsg.overlay({mask:{color:'#999999',loadSpeed:200,opacity:0.5},closeOnClick:false,load:true});$("#blockMsg").center(true);}var nC='';function myLogOut(cookieName){nC=cookieName;getWSData({},"WS/UAuth.asmx/LogOut",checkLogOut);}function myLogOutBE(cookieName){nC=cookieName;getWSData({},"../WS/UAuth.asmx/LogOut",checkLogOut);}function checkLogOut(msg){if(msg.d.Result=="OK"){if(nC!=""){var exp="";var dEx=new Date();dEx.setTime(dEx.getTime()+(-1*24*60*60*1000));exp="; expires="+dEx.toGMTString();document.cookie=nC+"="+exp+"; path=/";}window.location.href=window.location.href;}else{resume();LogInInfo("LogOut:","<b>C'è stato un problema nel Log Out.</b>");}}
