$(document).ready(function() {

$("div#spangles div:first").css("margin-right","0");
$("div#spangles div").append("<div class='spinner'><img class='spin' src='images/spinner.gif'/></div>");
	

var id, rightContent;
var cache = [];
var blurbHtml = "<p>Mu-Mu provide not only state of the art equipment for your recording projects, but can specify, Install and offer training on professional audio systems.</p><p>We place a great deal of emphasis on effective training, ensuring a solid knowledge of both hardware and the increasingly complex sphere of modern audio software.</p><p>Recent work has included a new recording studio at Wolverley secondary school, a sound system in the new bar at Subtone (Cheltenham) and specification, installation and training in artist owned studios.</p>";

var info = new Array();
info[0] = "<p>Tascam DM 3200 Installed at Wolverley Secondary School as part of a complete studio rebuild completed during the Summer Break 2008.</p>";
info[1] = "<p>Completed control room with Adam A7 Monitors and an Euphonics mix control allowing remote operation of Logic 8 faders and plugins.</p>";
info[2] = "<p>The Tascam DM 3200 take pride of place as the centerpiece of the new control room at Wolverley Secondary Schools new studio installation.</p>";
info[3] = "<p>Taking a close look at setting up Logic projects making sure that all the basic templates are easily accessible and suitable for the teaching requirements of the school.</p>";
info[4] = "<p>Matthew on the first training day. Covering in depth operation of the mixing console and how it integrates with Logic via Firewire.</p>";
info[5] = "<p>Control room at Wolverley Secondary School, all new and ready to go.</p>";
info[6] = "";

var images = new Array();
images[0] = jQuery("<img />").attr("src", "images/installation/0 Installation Tascam DM 3200 studio.png").attr("alt","Tascam DM 3200 Installed at Wolverley Secondary School as part of a complete studio rebuild completed during the Summer Break 2008.").attr("width","456").attr("height","371");
images[1] = jQuery("<img />").attr("src", "images/installation/1 Installation Adam A7 monitors Euphonics mix Logic 8 faders.png").attr("alt","Completed control room with Adam A7 Monitors and an Euphonics mix control allowing remote operation of Logic 8 faders and plugins.").attr("width","456").attr("height","371");
images[2] = jQuery("<img />").attr("src", "images/installation/2 Installation Tascam DM 3200 studio control room.png").attr("alt","The Tascam DM 3200 take pride of place as the centerpiece of the new control room at Wolverley Secondary Schools new studio installation.").attr("width","456").attr("height","371");
images[3] = jQuery("<img />").attr("src", "images/installation/3 Installation Logic projects templates.png").attr("alt","Taking a close look at setting up Logic projects making sure that all the basic templates are easily accessible and suitable for the teaching requirements of the school.").attr("width","456").attr("height","371");
images[4] = jQuery("<img />").attr("src", "images/installation/4 Installation Matthew Devenish mixing Logic firewire.png").attr("alt","Matthew Devenish on the first training day. Covering in depth operation of the mixing console and how it integrates with Logic via Firewire.").attr("width","456").attr("height","371");
images[5] = jQuery("<img />").attr("src", "images/installation/5 Installation control room.png").attr("alt","Control room at Wolverley Secondary School, all new and ready to go.").attr("width","456").attr("height","371");
images[6] = jQuery("<img />").attr("src", "images/installation/6 Installation sound system Subtone bar.png").attr("alt","New sound system in Subtone bar, Cheltenham").attr("width","456").attr("height","371");


// for(var i=6; i>=0; --i){
	
// }

$("div#spangles a").each(function(id){

	$(this).bind("click",function(){
		return false;
	});
	
var cacheImage = document.createElement('img');
	cacheImage.src = images[id].attr('src');
	cache.push(cacheImage);

	cacheImage.onload=function(e){

	$("a#spang"+id).parent().children("div").fadeOut("fast");
	
	$("a#spang"+id).bind("mouseover",function(){
		doPanels();
		$(images[id]).load(showContent(id));
		return false;
	});
}
});

function showContent(id){
$("div#rightpanel").html("");
$("div#rightpanel").append(images[id]).append(info[id]).fadeIn("medium");
}

function doPanels(){
		$("div#leftpanel").css({'width':'440px','padding-right':'20px'}).html(blurbHtml);
		$("div#rightpanel").css("width","460px").hide();
}

});
