/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// V:\1.1.007\js\loading.js

var nMessaggi=0;function showLoading(text,image,time,callback,scope){nMessaggi++;text=text||getText['CARICAMENTO'];time=(time==0)?0:(time||.4);log.time(nMessaggi,log4javascript.Level.TRACE);log.debug('...showloading... '+nMessaggi+': '+text);image='images/load_new.gif';if(nMessaggi>1){progress.body.dom.innerHTML='<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="loading">'+'<tr><td align="center" valign="middle">'+'<table cellspacing="0" cellpadding="0" border="0">'+'<tr>'+'<td class="loading-td">'+'<img src="'+image+'" align="top">'+'</td>'+'</tr>'+'<tr>'+'<td class="loading-td loading-text">'+'&nbsp;&nbsp;'+text+'<img src="'+IMG_PUNTINI+'">'+'</td>'+'</tr>'+'</table>'+'</tr></td>'+'</table>'
if(callback){callback.call(scope);}}else{progress=new Ext.Window({manager:WindowMgrAlwayOnTop,width:220,height:100,frame:true,shadow:false,border:false,autoDestroy:true,modal:true,resizable:false,closable:false,draggable:false,html:'<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="loading">'+'<tr><td align="center" valign="middle">'+'<table cellspacing="0" cellpadding="0" border="0">'+'<tr>'+'<td class="loading-td">'+'<img src="'+image+'" align="top">'+'</td>'+'</tr>'+'<tr>'+'<td class="loading-td loading-text">'+'&nbsp;&nbsp;'+text+'<img src="'+IMG_PUNTINI+'">'+'</td>'+'</tr>'+'</table>'+'</tr></td>'+'</table>'})
WindowMgrAlwayOnTop.zseed=2000000000;if(time>0){progress.show();progress.getEl().fadeIn({duration:time});progress.mask.fadeIn({duration:time,endOpacity:.5,callback:callback,scope:scope});}else{progress.on({'show':{fn:function(){if(callback){callback.call(scope);}},scope:this,single:true}})
progress.show();}}}
function hideLoading(time,callback,scope){log.debug('...hideloading... '+nMessaggi);time=(time==0)?0:(time||.4);nMessaggi=(nMessaggi==0)?0:nMessaggi-1;if(nMessaggi==0){if(time>0){progress.getEl().fadeOut({duration:time,remove:false});progress.mask.fadeOut({duration:time,remove:false,callback:function(){this.hide();WindowMgrAlwayOnTop.zseed=0;if(callback){callback.call(scope);}},scope:progress});}else{progress.hide();WindowMgrAlwayOnTop.zseed=0;if(callback){callback.call(scope);}}}
log.timeEnd(nMessaggi+1);}

