includes/clientside/static/faders.js
changeset 539 1beddd693f2d
parent 537 547b7ba6d535
child 541 acb7e23b6ffa
equal deleted inserted replaced
538:a43f9d646dc7 539:1beddd693f2d
     4  * Darkens the browser screen. This will make the entire page un-clickable except for any floating divs created after this is called. Restore with enlighten().
     4  * Darkens the browser screen. This will make the entire page un-clickable except for any floating divs created after this is called. Restore with enlighten().
     5  * @param bool Controls whether the fade should be disabled or not. aclDisableTransitionFX will override this if set to true, and fades are never fired on IE.
     5  * @param bool Controls whether the fade should be disabled or not. aclDisableTransitionFX will override this if set to true, and fades are never fired on IE.
     6  * @param int When specified, represents the numeric opacity value to set the fade layer to. 1-100.
     6  * @param int When specified, represents the numeric opacity value to set the fade layer to. 1-100.
     7  */
     7  */
     8 
     8 
       
     9 var darkener_index = 0;
       
    10 
     9 function darken(nofade, opacVal)
    11 function darken(nofade, opacVal)
    10 {
    12 {
    11   if(IE)
    13   if(IE)
    12     nofade = true;
    14     nofade = true;
    13   if ( !opacVal )
    15   if ( !opacVal )
    14     opacVal = 70;
    16     opacVal = 70;
       
    17   darkener_index++;
    15   if(document.getElementById('specialLayer_darkener'))
    18   if(document.getElementById('specialLayer_darkener'))
    16   {
    19   {
    17     if(nofade)
    20     if(nofade)
    18     {
    21     {
    19       changeOpac(opacVal, 'specialLayer_darkener');
    22       changeOpac(opacVal, 'specialLayer_darkener');
    84 
    87 
    85 function enlighten(nofade)
    88 function enlighten(nofade)
    86 {
    89 {
    87   if(IE)
    90   if(IE)
    88     nofade = true;
    91     nofade = true;
       
    92   darkener_index -= 1;
       
    93   if ( darkener_index > 0 )
       
    94     return false;
    89   if(document.getElementById('specialLayer_darkener'))
    95   if(document.getElementById('specialLayer_darkener'))
    90   {
    96   {
    91     if(nofade)
    97     if(nofade)
    92     {
    98     {
    93       document.getElementById('specialLayer_darkener').style.display = 'none';
    99       document.getElementById('specialLayer_darkener').style.display = 'none';