/*
  $Id: boxes.js,v 1.1 2010/07/07 17:31:51 eric Exp $

  Pro-Active Software
  http://www.pro-activesoftware.com
*/

function slideClick() {
  var activeID = $('#slideshow div.active').attr('id');
  var url = '';

  switch (activeID) {
    case 'browsePurchasePrint':
      url = '';
      break;
    case 'printer':
      url = '';
      break;
    case 'download247':
      url = '';
      break;
    case 'christian':
      url = 'index.php?cid=16';
      break;
    case 'elton':
      url = 'index.php?id=1117';
      break;
    case 'wedding':
      url = 'index.php?cid=25';
      break;
    case 'piano':
      url = 'index.php?aid=45';
      break;
    case 'jackson':
      url = 'index.php?id=55';
      break;
    case 'glee':
      url = 'search.php?q=Glee+Cast';
      break;
    case 'patriotic':
      url = 'index.php?cid=11';
      break;
    case 'country':
      url = 'index.php?id=257';
      break;
    case 'guitar':
      url = 'search.php?q=Jimmy+Page';
      break;
  }

  if (url) {
    window.location = url;
  }
}

function slideSwitch() {
  var active = $('#slideshow div.active');

  if (active.length == 0) {
    active = $('#slideshow div:last');
  }

  var next = active.next().length ? active.next() : $('#slideshow div:first');

  active.addClass('prev');

  next.css({opacity: 0.0})
      .addClass('active')
      .animate({opacity: 1.0}, 1000, function() {
        active.removeClass('active prev');
      });
}

$(function() {
    setInterval("slideSwitch()", 5000);
});
