/* javascript code for popmint.se */

var showcaseQueue = new Array();
var spotlightTime = 8000;

/* preload images */
var tmp1 = new Image();
tmp1.src = '/themes/popmint2006v6/images/showcase_aktivnap.png';
var tmp2 = new Image();
tmp2.src = '/themes/popmint2006v6/images/showcase_aktivnap_extra.png';
var tmp3 = new Image();
tmp3.src = '/themes/popmint2006v6/images/showcase_ifkasp.png';
var tmp4 = new Image();
tmp4.src = '/themes/popmint2006v6/images/showcase_ifkasp_extra.png';
var tmp5 = new Image();
tmp5.src = '/themes/popmint2006v6/images/showcase_laric.png';
var tmp6 = new Image();
tmp6.src = '/themes/popmint2006v6/images/showcase_laric_extra.png';

function queueShowcase(showcase) {
  showcaseQueue[showcaseQueue.length] = showcase;
}

function activateTransitionTimers() {
  $('#showcase-container').DropInRight(800);
  setTimeout("$('#showcase-extra').slideDown('slow');", 1000);
  setTimeout("$('#showcase-extra').slideUp('slow');", spotlightTime - 1000);
  setTimeout("$('#showcase-container').DropOutRight(800);", spotlightTime - 800);
}

function showcaseAktivnap() {
  $('#showcase-container').html('<a href="http://www.aktivera-naprapati.se" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-aktivnap" border="0" alt="Aktivera Naprapati showcase" title="Visit aktivera-naprapati.se!" /><\/a>');
  $('#showcase-extra').html('<a href="http://www.aktivera-naprapati.se" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-aktivnap-extra" border="0" alt="Aktivera Naprapati showcase" title="Visit aktivera-naprapati.se!" /><\/a>');
  activateTransitionTimers();
}

function showcaseIfkasp() {
  $('#showcase-container').html('<a href="http://www.ifkaspudden.se" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-ifkasp" border="0" alt="IFK Aspudden showcase" title="Visit ifkaspudden.se!" /><\/a>');
  $('#showcase-extra').html('<a href="http://www.ifkaspudden.se" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-ifkasp-extra" border="0" alt="IFK Aspudden showcase" title="Visit ifkaspudden.se!" /><\/a>');
  activateTransitionTimers();
}

function showcaseLaric() {
  $('#showcase-container').html('<a href="http://www.gite-laricouviere.com" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-laric" border="0" alt="Gite La Ricouviere showcase" title="Visit gite-laricouviere.com!" /><\/a>');
  $('#showcase-extra').html('<a href="http://www.gite-laricouviere.com" target="_blank"><img src="/themes/popmint2006v6/images/blank.gif" class="showcase-laric-extra" border="0" alt="Gite La Ricouviere showcase" title="Visit gite-laricouviere.com!" /><\/a>');
  activateTransitionTimers();
}

function showcaseSlideshow() {
  if (showcaseQueue.length == 0) {
    queueShowcase('showcaseAktivnap();');
    queueShowcase('showcaseLaric();');
    queueShowcase('showcaseIfkasp();');
  }

  var startTime = 0;
  for (i in showcaseQueue) {
    setTimeout(showcaseQueue[i], startTime);
    startTime = startTime + spotlightTime;
  }

  setTimeout('showcaseSlideshow();', startTime);
}

$(document).ready(function(){
  showcaseSlideshow();
});
