

function PreLoader(parent, startValue, maxValue)
{
  window.scrollTo(0, 0);
  this.m_isIE = (String(navigator.appName).indexOf('Microsoft') != -1);
  this.m_onComplete = 0;

  this.m_parent = parent;
  this.m_html = document.createElement('TABLE');
  this.m_html.cellSpacing = 0;
  this.m_html.cellPadding = 0;
  this.m_html.border = 0;
  this.m_html.style.width = '100%';
  this.m_html.style.height = '100%';
  this.m_html.style.background = 'rgb(255, 255, 255)';
  this.m_html.style.left = 0;
  this.m_html.style.top = 0;
  this.m_html.style.position = 'absolute';

  this.m_tbody = document.createElement('TBODY');
  this.m_html.appendChild(this.m_tbody);

  var r = this.m_html.insertRow(0);
  this.m_contentCell = r.insertCell(0);
  this.m_contentCell.height = 400;
  this.m_contentCell.align = 'center';
  this.m_contentCell.vAlign = 'middle';

  this.m_value = startValue;
  this.m_maxValue = maxValue;

  this.m_logo = document.createElement('IMG');
  this.m_logo.style.paddingBottom = '16px';
  this.m_logo.style.visibility = 'hidden';
  this.m_logo.onload = function(e){this.style.visibility='visible'; setTimeout("BeginPreload();", 100);}
  this.m_contentCell.appendChild(this.m_logo);
  this.m_logo.src = 'images/BBClogo_small.jpg';

  this.m_progressBar = new ProgressBar(this.m_contentCell, startValue, maxValue, 200, 4);

  this.SetValue = function(newValue)
  {
     this.m_value = newValue;
     this.m_progressBar.SetValue(newValue);
     if (this.m_value >= this.m_maxValue)
       if (this.m_onComplete)
         this.m_onComplete(this);
  }

  this.Step = function()
  {
    this.SetValue(++this.m_value);
  }


  this.m_parent.appendChild(this.m_html);
  this.SetValue(startValue);
}
