includes/clientside/static/faders.js
changeset 473 518bc2b214f1
parent 461 717e71109645
child 507 586fd7d3202d
equal deleted inserted replaced
472:bc4b58034f4d 473:518bc2b214f1
     4 {
     4 {
     5   if(IE)
     5   if(IE)
     6     nofade = true;
     6     nofade = true;
     7   if(document.getElementById('specialLayer_darkener'))
     7   if(document.getElementById('specialLayer_darkener'))
     8   {
     8   {
     9     document.getElementById('specialLayer_darkener').style.display = 'block';
       
    10     if(nofade)
     9     if(nofade)
    11     {
    10     {
    12       document.getElementById('specialLayer_darkener').style.opacity = '0.7';
    11       changeOpac(70, 'specialLayer_darkener');
    13       document.getElementById('specialLayer_darkener').style.filter = 'alpha(opacity=70)';
    12       document.getElementById('specialLayer_darkener').style.display = 'block';
    14     }
    13     }
    15     else
    14     else
    16     {
    15     {
       
    16       document.getElementById('specialLayer_darkener').style.display = 'block';
    17       opacity('specialLayer_darkener', 0, 70, 1000);
    17       opacity('specialLayer_darkener', 0, 70, 1000);
    18     }
    18     }
    19   } else {
    19   } else {
    20     w = getWidth();
    20     w = getWidth();
    21     h = getHeight();
    21     h = getHeight();
    95  *   opacity() - required for darken() and enlighten()
    95  *   opacity() - required for darken() and enlighten()
    96  *   MB_* constants are defined in enano-lib-basic.js
    96  *   MB_* constants are defined in enano-lib-basic.js
    97  */
    97  */
    98 
    98 
    99 var mb_current_obj;
    99 var mb_current_obj;
       
   100 var mb_previously_had_darkener = false;
   100 
   101 
   101 function messagebox(type, title, message)
   102 function messagebox(type, title, message)
   102 {
   103 {
   103   var y = getScrollOffset();
   104   var y = getScrollOffset();
   104   if(document.getElementById('messageBox')) return;
   105   
   105   darken(true);
   106   // Prevent multiple instances
       
   107   if ( document.getElementById('messageBox') )
       
   108     return;
       
   109   
       
   110   if ( document.getElementById('specialLayer_darkener') )
       
   111     if ( document.getElementById('specialLayer_darkener').style.display == 'block' )
       
   112       mb_previously_had_darkener = true;
       
   113   if ( !mb_previously_had_darkener )
       
   114     darken(true);
   106   if ( aclDisableTransitionFX )
   115   if ( aclDisableTransitionFX )
   107   {
   116   {
   108     document.getElementById('specialLayer_darkener').style.zIndex = '5';
   117     document.getElementById('specialLayer_darkener').style.zIndex = '5';
   109   }
   118   }
   110   var master_div = document.createElement('div');
   119   var master_div = document.createElement('div');
   289   this.destroy = function()
   298   this.destroy = function()
   290     {
   299     {
   291       var mbdiv = document.getElementById('messageBox');
   300       var mbdiv = document.getElementById('messageBox');
   292       mbdiv.parentNode.removeChild(mbdiv.nextSibling);
   301       mbdiv.parentNode.removeChild(mbdiv.nextSibling);
   293       mbdiv.parentNode.removeChild(mbdiv);
   302       mbdiv.parentNode.removeChild(mbdiv);
   294       enlighten(true);
   303       if ( !mb_previously_had_darkener )
       
   304         enlighten(true);
   295     };
   305     };
   296   
   306   
   297   //domObjChangeOpac(0, mydiv);
   307   //domObjChangeOpac(0, mydiv);
   298   //domObjChangeOpac(0, master_div);
   308   //domObjChangeOpac(0, master_div);
   299   
   309   
   337   if ( aclDisableTransitionFX )
   347   if ( aclDisableTransitionFX )
   338   {
   348   {
   339     var mbdiv = document.getElementById('messageBox');
   349     var mbdiv = document.getElementById('messageBox');
   340     mbdiv.parentNode.removeChild(mbdiv.nextSibling);
   350     mbdiv.parentNode.removeChild(mbdiv.nextSibling);
   341     mbdiv.parentNode.removeChild(mbdiv);
   351     mbdiv.parentNode.removeChild(mbdiv);
   342     enlighten(true);
   352     if ( !mb_previously_had_darkener )
       
   353       enlighten(true);
   343   }
   354   }
   344   else
   355   else
   345   {
   356   {
   346     var to = fly_out_top(maindiv, true, false);
   357     var to = fly_out_top(maindiv, true, false);
   347     setTimeout("var mbdiv = document.getElementById('messageBox'); mbdiv.parentNode.removeChild(mbdiv.nextSibling); mbdiv.parentNode.removeChild(mbdiv); enlighten(true);", to);
   358     setTimeout("var mbdiv = document.getElementById('messageBox'); mbdiv.parentNode.removeChild(mbdiv.nextSibling); mbdiv.parentNode.removeChild(mbdiv); if ( !mb_previously_had_darkener ) enlighten(true);", to);
   348   }
   359   }
   349   if(typeof mb.onclick[val] == 'function')
   360   if(typeof mb.onclick[val] == 'function')
   350   {
   361   {
   351     o = mb.onclick[val];
   362     o = mb.onclick[val];
   352     o();
   363     o();