window.loadList.push('dbLoad()');

window.db_delay = 8333;
window.db_items = [
  { 'text': "No Contracts! No Caps! No Worries! No overage fees, no early termination fees, just fast service.",
    'img': 'res/images/banners/contracts.png',
    'link': 'internet.html' },

  { 'text': "But wait.. there's more! We also offer consulting services for all of your hardware, software, website or networking needs",
    'img': 'res/images/banners/other.png',
    'link': 'faq_view.php?faq_id=20' },

//  { 'text': "Referral program: Refer a friend, and you both get 1 month free! More referrals, more free service!",
//    'img': 'res/images/banners/refer.png',
//    'link': 'referral.html' },

  { 'text': "30 day money back guarantee: If our service isn't right for you, let us know in 30 days for a full refund",
    'img': 'res/images/banners/refund.png',
    'link': 'faq_view.php?faq_id=238' },

  { 'text': "Custom Solutions: Need a static IP or VPN? Having financial issues? Email or Website support? We can work with you.",
    'img': 'res/images/banners/solutions.png',
    'link': 'contact.html' },

  { 'text': "Fast, friendly tech support: Over the phone, email, or in person!",
    'img': 'res/images/banners/support.png',
    'link': 'contact.html' },

  { 'text': "Going on vacation? We'll put your account on hold. Why pay for service you aren't using?",
    'img': 'res/images/banners/vacation.png',
    'link': 'faq_view.php?faq_id=64' }
];

function dbLoad()
{
  var root = document.getElementById('deathbanner'), nodeA, nodeI, i;

  if(!window.magic) { return; }

  root.style.background = 'url(res/images/banners-shadow/shadow.png)';

//  groomNode(root.firstChild);

  window.dbZ = 10;
  for(i=0; i<db_items.length; i++)
  {
    nodeA = document.createElement('a');
    nodeA.className = 'item';
    nodeA.id = 'dbItem'+ i;
    nodeA.style.display = 'none';
    nodeA.href = db_items[i].link;

    nodeI = document.createElement('img');
    nodeI.alt = db_items[i].text;
    nodeI.src = db_items[i].img;

    nodeA.appendChild(nodeI);
    root.appendChild(nodeA);
  }
//alert(root.outerHTML);
  dbRotate();
}

function dbRotate()
{
  var pick = window.db_chosen;
  /* window.db_chosen */
  /* window.db_delay */

  while(pick==window.db_chosen)
  { pick = document.getElementById('dbItem'+ Math.floor(Math.random()*db_items.length)); }

  if(window.db_chosen!=null)
  {
    db_chosen.style.zIndex = 2;
//    new Effect.DropOut(db_chosen, {duration: 1});
    new Effect.Fade(db_chosen, {duration: 1});
  }
  pick.style.zIndex = 1;
  pick.style.display = 'block';

  window.db_chosen = pick;

  setTimeout('dbRotate()', db_delay);
}

