var hermes = { src: '/_graphics/hermes.swf' };
sIFR.activate(hermes);

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(document).ready(function(){	
	$(function(){
		$.fn.supersized.options = {  
			startwidth: 1200,  
			startheight: 800,
			minsize: .50,
			slideshow: 0
		};
        $('#supersize').supersized(); 
    });

	//External links.
	$('a[rel="external"]').click( function() {
		window.open( $(this).attr('href') );
		return false;
	});
});


function nextSlide(nextId){
	// Control the animation.
	$.preloadImages("_graphics/bg/" + nextId + ".jpg");
	sIFR.replace(hermes, {
	  	selector: ".bandname",
		forceSingleLine: true,
	  	css: ".sIFR-root { background-color: #ffffff; color: #000000;}"
	});	
	$("#overlay").fadeOut("fast");
	setTimeout("ajaxCall(" + nextId + ")", 10000);
}

function ajaxCall(nextId){
	// Called 
	$("#overlay").fadeIn("fast", function(){
		$("#supersize").load("band.php?id=" + nextId + "");
	});
}

