/*
 +-------------------------------------------------------------------+
 |                    J S - L O A D E R   (v1.7)                     |
 |                          P a r t   I                              |
 |                                                                   |
 | Copyright Gerd Tentler               www.gerd-tentler.de/tools    |
 | Created: Mar. 26, 2002               Last modified: Dec. 15, 2007 |
 +-------------------------------------------------------------------+
 | This program may be used and hosted free of charge by anyone for  |
 | personal purpose as long as this copyright notice remains intact. |
 |                                                                   |
 | Obtain permission before selling the code for this program or     |
 | hosting this software on a commercial website or redistributing   |
 | this software over the Internet or in any other medium. In all    |
 | cases copyright must remain intact.                               |
 +-------------------------------------------------------------------+

======================================================================================================
 This script was tested with the following systems and browsers:

 - Windows XP: IE 6, NN 7, Opera 7 + 9, Firefox 2
 - Mac OS X:   IE 5

 If you use another browser or system, this script may not work for you - sorry.

 NOTE: Safari 1 (Mac OS X) does not support "document.images[].complete", so the progress bar will
       not be shown.
======================================================================================================
*/
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------

  var boxText = "Loading ... please wait!";   // dialog box message
  var boxFont = "bold 14px Arial,Helvetica";  // dialog box font (CSS spec: "style size family")
  
 
  var boxFontColor = "#126321";               // dialog box font color
  var boxWidth = 400;                         // dialog box width (pixels)
  var boxHeight = 400;                        // dialog box height (pixels)
  var boxBGColor = "#ffffff";                 // dialog box background color
  var boxBorder = "2px outset #ffffff";       // dialog box border (CSS spec: "size style color")

  var barLength = 200;                        // progress bar length (pixels)
  var barHeight = 15;  	                       // progress bar height (pixels)  
                       
  var barColor = "#547535";                   // progress bar color
  var barBGColor = "#ffffff";                 // progress bar background color

  var fadeInSpeed = 0;                       // content fade-in speed (0 - 30; 0 = no fading)*
  var contentOpacity = 20;                    // content opacity during loading (0 - 100)*

// * Fading and content opacity were successfully tested on Windows XP with IE 6, NN 7, Firefox 2
//   and Opera 9. Other browsers may not support these features, but the script should work anyway.

//----------------------------------------------------------------------------------------------------
// Build dialog box and progress bar
//----------------------------------------------------------------------------------------------------

  var safari = (navigator.userAgent.indexOf('Safari') != -1) ? true : false;

  if((document.all || document.getElementById) && !safari) {
    document.write('<style> .clsBox { ' +
                   'position:absolute; top:50%; left:50%; ' +
                   'width:' + boxWidth + 'px; ' +
                   'height:' + boxHeight + 'px; ' +
                   'background:url(loader.gif);' +
                
                   'margin-top:-' + Math.round(boxHeight / 2) + 'px; ' +
                   'margin-left:-' + Math.round(boxWidth / 2) + 'px; ' +
                   
                  
                   'z-index:50; ' +
                   '} .clsBarBG { ' +
                   
                    'position:absolute;left:100px;top:265px;' +
                  
                  
                   'width:' + (barLength + 4) + 'px; ' +
                   'height:' + (barHeight + 4) + 'px; ' +
                   
                  
                   'margin-top:0px; padding:0px; ' +
                   'text-align: left; ' +
                   '} .clsBar { ' +
                   'margin-top:0px; padding:30px; ' +
                   'width:0px; height:' + barHeight + 'px; ' +
                   'background-color:' + barColor + '; ' +
                  
                  
                   'margin:1px; padding:0px; ' +
                   'font-size:1px; ' +
                   '}  </style> ' +
                   '<div id="divBox" class="clsBox">' +
                   '<table border=0 cellspacing=0 cellpadding=0><tr>' +
                   '<td width=' + boxWidth + ' height=' + boxHeight + ' align=center>' +
                   
                   '<table border=0 cellspacing=0 cellpadding=0 ><tr><td width=' + barLength + '>' +
                   '<div id="divBarBG" class="clsBarBG"><div id="divBar" class="clsBar"></div></div>' +
                   '</td></tr></table>' +
                   '</td></tr></table></div>' +
                   '<div id="Content" style="width:100%; visibility:hidden">');
  }

//----------------------------------------------------------------------------------------------------