//window.scrollToView=function(element,force){ // if(element.length==0) // return; // var offset=element.offset().top-$('body').offset().top; // if(!element.is(':visible')){ // element.css({'visiblity':'hidden'}).show(); // var offset=element.offset().top; // element.css({'visiblity':'','display':''}); // } // var visible_area_start=$(window).scrollTop(); // var visible_area_end=visible_area_start+window.innerHeight; // if(force || offsetvisible_area_end){ // // Not in view so scroll to it // $('html,body').animate({scrollTop:offset-window.innerHeight/3},1000); // return false; // } // return true; //}; window.controls={}; window.exec=function(f,self){ if(typeof(f)=='function') f.call(self); else if(typeof(f)=='string') (new Function(f)).call(self); }; window.delay=function(f,timerMilliseconds){ if(typeof(f)=='function') setTimeout(f,timerMilliseconds); else if(typeof(f)=='string') setTimeout(function(){exec(f);},timerMilliseconds); }; //$(window).bind('beforeunload',function(e){ // window.unloading=true; // if(Page.DoUnload)Page.DoUnload(); //}); //window.DateToInt=function(d){ // if(!d)return 0; // return d.getFullYear()*32140800+(d.getMonth())*2678400+(d.getDate()-1)*86400+d.getHours()*3600+d.getMinutes()*60+d.getSeconds(); //}; //window.IntToDate=function(i){ // if(!i)return 0; // var year=Math.floor(i/32140800);i-=year*32140800; // var month=Math.floor(i/2678400)+1;i-=(month-1)*2678400; // var day=Math.floor(i/86400)+1;i-=(day-1)*86400; // var h=Math.floor(i/3600);i-=h*3600; // var m=Math.floor(i/60);i-=m*60; // var s=i; // return new Date(year,month-1,day,h,m,s); //}; ////Center //function CenterItem(theItem){ // CenterItemX(theItem); // CenterItemY(theItem); //} //function CenterItemX(theItem,pos){ // if(pos==null)pos=0.5; // $(theItem).css('position','fixed'); // $(theItem).css({ // left:($(window).width()-$(theItem).outerWidth())*pos // }); //} //function CenterItemY(theItem,pos){ // if(pos==null)pos=0.5; // $(theItem).css('position','fixed'); // $(theItem).css({ // top:($(window).height()-$(theItem).outerHeight())*pos // }); //} ////DoServerWork //function DoServerWork(script){ // if(!script)return; // var obj=typeof script=='string' ? eval('('+script+')') : script; // if(obj.UpdateID && obj.UpdateID.length>0 && obj.UpdateHTML){ // $('#'+obj.UpdateID).outerHTML(obj.UpdateHTML); // } // if(obj.ExecuteScript && obj.ExecuteScript.length>0){ // exec(obj.ExecuteScript); // } //} ////Wait //var waitCount=0; //function StartWait(startnow){ // ++waitCount; // if(waitCount>1) // return; // $('#WaitDiv').remove(); // $('body').append(""); //cursor:wait; // //setTimeout(function(){$('#WaitDiv').css('background','url(/images/wait.gif) no-repeat center center').css('cursor','wait');},500); // //$('#WaitDiv').delay(500).queue(function(){ // // $(this).css('background','url(/images/wait.gif) no-repeat center center').css('cursor','wait'); // //}); // //$('body').oneTime(500,'wait',function(){$('#WaitDiv').css('background','url(/images/wait.gif) no-repeat center center').css('cursor','wait');}); // if(startnow){ // $('#WaitDiv').css('display','block'); // }else if(!window.waitStarted){ // window.waitTimer=setTimeout(function(){$('#WaitDiv').css('display','block');},1000); // //$('body').oneTime(1000,'wait',function(){$('#WaitDiv').css('display','block');}); // } // window.waitStarted=true; //} //function EndWait(){ // --waitCount; // if(waitCount>0) // return; // //$('body').stopTime('wait'); // if(window.waitTimer){ // clearTimeout(window.waitTimer); // window.waitTimer=null; // } // $('#WaitDiv').remove(); // window.waitStarted=false; // //setTimeout(function(){$('#WaitDiv').remove();},1); // //$('#WaitDiv').delay(500).queue(function(){alert('xxxxxxx');$('#WaitDiv').remove();}); // //$('#WaitDiv').css('background-color','blue').sleep(5000).css('background-color','red'); // //$('#WaitDiv').queue(function(){alert('1');$('#WaitDiv').dequeue();}).queue(function(){alert('2');}); // //$('#WaitDiv').dequeue(); //} ////DownloadURL //function downloadURL(url){ // var iframe=document.getElementById('hiddenDownloader'); // if(!iframe){ // iframe=document.createElement('iframe'); // iframe.id='hiddenDownloader'; // iframe.style.visibility='hidden'; // document.body.appendChild(iframe); // } // iframe.src=url; //} ////resize //function Resized(){ // var w=$(window).width(); // var h=$(window).height(); // if(w!=Page.width || h!=Page.height){ // Page.width=w; // Page.height=h; // Page.Resized(w,h); // } //} //function NeedsResize(){ // $(window).load(function(){ // Resized(); // $(window).resize(Resized); // }); //} //jQuery.fn.extend({ // renameAttr:function(name,newName,removeData){ // var val; // return this.each(function(){ // val=jQuery.attr(this,name); // if(val=="") // return; // jQuery.attr(this,newName,val); // jQuery.removeAttr(this,name); // // remove original data // if(removeData!==false){ // jQuery.removeData(this,name.replace('data-','')); // } // }); // } //}); //Number.prototype.round=function(places){ // return +(Math.round(this+"e+"+places)+"e-"+places); //}; ///* // Author - Rudolf Naprstek // Website - http://www.thimbleopensource.com/tutorials-snippets/jquery-plugin-filter-text-input // Version - 1.5.3 // Release - 12th February 2014 //*/ ///* //jQuery(document).ready(function() { // var masks = { // 'int':     /[\d]/, // 'float':     /[\d\.]/, // 'money':    /[\d\.\s,]/, // 'num':      /[\d\-\.]/, // 'hex':      /[0-9a-f]/i, // 'email':    /[a-z0-9_\.\-@]/i, // 'alpha':    /[a-z_]/i, // 'alphanum': /[a-z0-9_]/i, // 'alphanumlower':/[a-z0-9_]/, // 'alphaspace':    /[a-z ]/i, // 'alphanumspace': /[a-z0-9_ ]/i, // 'alphanumspacelower':/[a-z0-9_ ]/ // }; // jQuery('input[data-mask]').each(function(idx) { // var mask = jQuery(this).data('mask'); // var regex = (masks[mask]) ? masks[mask] : mask; // jQuery(this).filter_input({ regex: regex, live: true }); // }); //}); //*/ //(function($){ // $.fn.extend({ // filter_input:function(options){ // var defaults={ // regex:".", // negkey:false, // use "-" if you want to allow minus sign at the beginning of the string // live:false, // events:'keypress paste' // } // var options=$.extend(defaults,options); // function filter_input_function(event){ // var input = (event.input) ? event.input : $(this); // if (event.ctrlKey || event.altKey) return; // if (event.type=='keypress'){ // var key=event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0; // // 8 = backspace, 9 = tab, 13 = enter, 35 = end, 36 = home, 37 = left, 39 = right, 46 = delete // if (key==8 || key==9 || key==13 || key==35 || key==36|| key==37 || key==39 || key==46){ // // if charCode = key & keyCode = 0 // // 35 = #, 36 = $, 37 = %, 39 = ', 46 = . // if (event.charCode==0 && event.keyCode==key) // return true; // } // var string=String.fromCharCode(key); // // if they pressed the defined negative key // //if (options.negkey && string==options.negkey){ // // // if there is already one at the beginning, remove it // // if (input.val().substr(0, 1) == string){ // // input.val(input.val().substring(1, input.val().length)).change(); // // } else { // // // it isn't there so add it to the beginning of the string // // input.val(string + input.val()).change(); // // } // // return false; // //} // var regex=new RegExp(options.regex); // }else if(event.type=='paste'){ // input.data('value_before_paste', event.target.value); // setTimeout(function(){ // filter_input_function({type:'after_paste', input:input}); // }, 1); // return true; // }else if(event.type=='after_paste'){ // var string = input.val(); // var regex=new RegExp('^('+options.regex+')+$'); // }else{ // return false; // } // if (regex.test(string)){ // return true; // }else if(typeof(options.feedback)=='function'){ // options.feedback.call(this, string); // } // if (event.type=='after_paste') // input.val(input.data('value_before_paste')); // return false; // } // var jquery_version=$.fn.jquery.split('.'); // if(options.live){ // if (parseInt(jquery_version[0])>=1 && parseInt(jquery_version[1])>=7){ // $(this).on(options.events, filter_input_function); // }else{ // $(this).live(options.events, filter_input_function); // } // }else{ // return this.each(function(){ // var input=$(this); // if(parseInt(jquery_version[0])>=1 && parseInt(jquery_version[1])>=7){ // input.off(options.events).on(options.events, filter_input_function); // }else{ // input.unbind(options.events).bind(options.events, filter_input_function); // } // }); // } // } // }); //})(jQuery); //$.fn.scrollTo=function(target,options){ // var settings=$.extend({ // scrollTarget:target, // offsetTop:50, // duration:500, // },options); // return this.each(function(){ // var scrollPane=$(this); // var scrollTarget=(typeof settings.scrollTarget == "number") ? settings.scrollTarget : $(settings.scrollTarget); // var value; // if(typeof scrollTarget=="number"){ // //spostamento assoluto // value=scrollTarget; // }else{ // var offset=element.offset().top-scrollTarget.offset().top; // var visible_area_start=scrollTarget.scrollTop(); // var visible_area_end=visible_area_start+scrollTarget.innerHeight(); // if(offsetvisible_area_end){ // // Not in view so scroll to it // scrollTarget.animate({scrollTop:value},settings.duration); // return false; // }else{ // return; // } // } // //var scrollY=((typeof scrollTarget=="number") ? scrollTarget : scrollTarget.offset().top)+scrollPane.scrollTop()-parseInt(settings.offsetTop); // // scrollPane.animate({scrollTop:offset-window.innerHeight/3},parseInt(settings.duration)); // //scrollPane.animate({scrollTop : scrollY }, parseInt(settings.duration), settings.easing, function(){ // // if (typeof callback == 'function') { callback.call(this); } // //}); // //}); // }); //} //$.fn.animateAppendTo=function(sel,speed){ // speed=speed||400; // var element=this; // var clone=element.clone(true,true); // this.replaceWith(clone); // element.hide(); // element.appendTo(sel); // clone.slideUp(speed,function(){ // clone.remove(); // }); // element.slideDown(speed); // return element; //}; //function deselectAll(){ // if(document.selection) // document.selection.empty(); // if(window.getSelection) // window.getSelection().removeAllRanges(); //} //var _getScrollBarWidth=null; //function getScrollBarWidth(){ // if(!_getScrollBarWidth){ // var $outer=$('
').css({visibility: 'hidden', width: 100, overflow: 'scroll'}).appendTo('body'),widthWithScroll = $('
').css({width: '100%'}).appendTo($outer).outerWidth(); // $outer.remove(); // _getScrollBarWidth=100-widthWithScroll; // } // return _getScrollBarWidth; //}; //function toggleFullScreen(){ // if (!document.fullscreenElement && // alternative standard method // !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) // { // current working methods // if (document.documentElement.requestFullscreen) // document.documentElement.requestFullscreen(); // else if (document.documentElement.msRequestFullscreen) // document.documentElement.msRequestFullscreen(); // else if (document.documentElement.mozRequestFullScreen) // document.documentElement.mozRequestFullScreen(); // else if (document.documentElement.webkitRequestFullscreen) // document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); // }else{ // if (document.exitFullscreen) // document.exitFullscreen(); // else if (document.msExitFullscreen) // document.msExitFullscreen(); // else if (document.mozCancelFullScreen) // document.mozCancelFullScreen(); // else if (document.webkitExitFullscreen) // document.webkitExitFullscreen(); // } //} //function redirect(url){ // window.location.href=url; //} //function reload(){ // location.reload(); //} //function dateToString(date,separator){ // _date=date || new Date(); // _separator=separator || '-'; // var dd=_date.getDate(); // var mm=_date.getMonth()+1; // var yyyy=_date.getFullYear(); // if(dd<10) dd='0'+dd; // if(mm<10) mm='0'+mm; // return yyyy+_separator+mm+_separator+dd; //} //$.fn.isOnScreen = function(partial){ // //let's be sure we're checking only one element (in case function is called on set) // var t = $(this).first(); // //we're using getBoundingClientRect to get position of element relative to viewport // //so we dont need to care about scroll position // var box = t[0].getBoundingClientRect(); // //let's save window size // var win = { // h : $(window).height(), // w : $(window).width() // }; // //now we check against edges of element // //firstly we check one axis // //for example we check if left edge of element is between left and right edge of scree (still might be above/below) // var topEdgeInRange = box.top >= 0 && box.top <= win.h; // var bottomEdgeInRange = box.bottom >= 0 && box.bottom <= win.h; // var leftEdgeInRange = box.left >= 0 && box.left <= win.w; // var rightEdgeInRange = box.right >= 0 && box.right <= win.w; // //here we check if element is bigger then window and 'covers' the screen in given axis // var coverScreenHorizontally = box.left <= 0 && box.right >= win.w; // var coverScreenVertically = box.top <= 0 && box.bottom >= win.h; // //now we check 2nd axis // var topEdgeInScreen = topEdgeInRange && ( leftEdgeInRange || rightEdgeInRange || coverScreenHorizontally ); // var bottomEdgeInScreen = bottomEdgeInRange && ( leftEdgeInRange || rightEdgeInRange || coverScreenHorizontally ); // var leftEdgeInScreen = leftEdgeInRange && ( topEdgeInRange || bottomEdgeInRange || coverScreenVertically ); // var rightEdgeInScreen = rightEdgeInRange && ( topEdgeInRange || bottomEdgeInRange || coverScreenVertically ); // //now knowing presence of each edge on screen, we check if element is partially or entirely present on screen // var isPartiallyOnScreen = topEdgeInScreen || bottomEdgeInScreen || leftEdgeInScreen || rightEdgeInScreen; // var isEntirelyOnScreen = topEdgeInScreen && bottomEdgeInScreen && leftEdgeInScreen && rightEdgeInScreen; // return partial ? isPartiallyOnScreen : isEntirelyOnScreen; //}; //$.expr.filters.onscreen = function(elem) { // return $(elem).isOnScreen(true); //}; //$.expr.filters.entireonscreen = function(elem) { // return $(elem).isOnScreen(true); //}; //var delayExecuteHandle=null; //function delayExecute(func){ // if(delayExecuteHandle){ // clearTimeout(delayExecuteHandle); // delayExecuteHandle=null; // } // var _arguments=[].slice.call(arguments,1); // delayExecuteHandle=setTimeout(function(){ // delayExecuteHandle=null; // func.apply(null,_arguments); // },1000); //} //function delayExecuteForce(func){ // if(!delayExecuteHandle) // return; // clearTimeout(delayExecuteHandle); // delayExecuteHandle=null; // var _arguments=[].slice.call(arguments,1); // func.apply(null,_arguments); //} //function textFit(select){ // $(select).each(function(){ // var container=this; // var zoom=1.0; // container.style.zoom=zoom; // while(zoom>0.01 && (container.scrollWidth>container.clientWidth || container.scrollHeight>container.clientHeight)){ // zoom*=0.9; // container.style.zoom=zoom; // } // }); //} //(function($){ // $.fn.textFit=function(){ // $(this).each(function(){ // var container=this; // var zoom=1.0; // container.style.zoom=zoom; // while(zoom>0.01 && (container.scrollWidth>container.clientWidth || container.scrollHeight>container.clientHeight)){ // zoom*=0.90; // container.style.zoom=zoom; // } // }); // return this; // }; //}(jQuery)); let waitCount=0; function startWait(startnow){ ++waitCount; if(waitCount>1) return; $('#waitDiv').remove(); $('body').append(""); //cursor:wait; if(startnow){ $('#waitDiv').css('display','block'); }else if(!window.waitStarted){ window.waitTimer=setTimeout(function(){$('#waitDiv').css('display','block');},1000); } window.waitStarted=true; } function endWait(){ --waitCount; if(waitCount>0) return; //$('body').stopTime('wait'); if(window.waitTimer){ clearTimeout(window.waitTimer); window.waitTimer=null; } $('#waitDiv').remove(); window.waitStarted=false; } page.callMethod=function(o,name,ok,error,noWait,permitsMultipleCall){ var calling=page.calling; if(o){ if(!o.calling) o.calling=[]; calling=o.calling; } if(!permitsMultipleCall && calling[name]) return; { calling[name]=true; try{ var parms=[]; parms.push(o ? o.id : null); for(var i=6;i{ setInterval(()=>page.KeepAlive(),60*1000); });