// JavaScript Document

window.onload = pageInit;

var titles = new Array("Crossing the Stone","Danceculture","Purcell: Dido &amp; Aeneas","Kapsberger &amp; Zipoli: The Jesuit Operas","Joy: A Holiday Collection","Buddha Bar Presents Living Theater vol. 2","Buddha Bar Presents Living Theater vol. 3","Reflections","Simply Christmas","Songs She Loved (Volumes I &amp; II)","Pergolesi: Stabat Mater","This Town","Vocalise");

var artists = new Array("Catrin Finch","Tracy Young","Predrag Gosta &amp; New Trinity Baroque","James David Christie &amp; Ensemble Abendmusik","Jewel","Joseph Baldassare","Joseph Baldassare","Chanticleer","Various Artists","Terry Barber","Predrag Gosta &amp; New Trinity Baroque","Steve Smith","Adiemus/Karl Jenkins");

var release = new Array("2003 Sony","2005 Ferosh","2004 Edition Lilac","2003 Dorian Recordings","1999 Columbia/Atlantic/WEA","2002 George V","2003 Kunduru Music","1998 Warner Teldec","2005 Sony","2007 rEvolv Music","2008 Edition Lilac","2008 Gas Records","2004 EMI")

var covers = new Array("Crossing-the-Stone.jpg","Danceculture.jpg","Dido-and-Aeneas.jpg","Jesuit-Operas.jpg","Joy.jpg","Living-Theater-2.jpg","Living-Theater-3.jpg","Reflections.jpg","Simply-Christmas.jpg","Songs-She-Loved.jpg","Stabat-Mater.jpg","This-Town.jpg","Vocalise.jpg");

var roles = new Array("Solo vocalist for &ldquo;Ave Maria&rdquo; and &ldquo;Suo Gan&rdquo;","Solo for &ldquo;The World Is A Stage&rdquo; Club Remix","Sings the role of Witch","Sings the role of Japan","Created various sounds for &ldquo;Ave Maria&rdquo; and other tracks","Solo for &ldquo;The World Is A Stage&rdquo;","Solo for &ldquo;I Dreamed&rdquo;","Sings soprano and tenor throughout the album","Sings &ldquo;Ave Maria&rdquo;","Solo vocals, background vocals, musical composition, lyric writing, production","Alto Soloist","Vocals for the title track &ldquo;This Town&rdquo;","Main soloist");

var comments = new Array();

comments[0] = "Renowned harpist Catrin Finch asked Terry to join her on her first solo release.  The &ldquo;Ave Maria&rdquo; (Bach/Gounod) has received international attention and radio play and has become a signature piece for Terry."
comments[1] = "As the lead vocalist for the international hit &ldquo;The World Is A Stage&rdquo; (listed in the top 10 by DJs worldwide) Terry&rsquo;s vocals were used in Tracy Young&rsquo;s remix and can be heard on this album along with those of Madonna, Chaka Khan, Cyndi Lauper and others."
comments[2] = "Having just performed the witch&rsquo;s role for the Spoleto Festival, Terry was asked to record it with New Trinity Baroque, an orchestra founded friend and colleague from New Trinity College of Music in London, Predrag Gosta."
comments[3] = "Early in Terry&rsquo;s career, he helped create this historically significant recording. In it, he collaborated with other wonderful singers like Ellen Hargis as well as Steven Rickards and Randall Wong, two countertenors who were also former members of Chanticleer."
comments[4] = "Produced by the legendary Arif Mardin, this album of sacred and popular holiday favorites needed singers with extreme range that could sing in several parts to create a children&rsquo;s choir sound. Countertenor Drew Minter recommended Terry for the job where he sings tenor, alto, and soprano to create an ethereal backdrop for the album."
comments[5] = "For this album of original compositions, Terry recorded vocals for &ldquo;The World Is A Stage&rdquo; which was an international success.  As a result, Producer and composer, Joseph Baldassare, became a fan, friend and advocate for Terry&rsquo;s unique vocal sound."
comments[6] = "After the success of his solo on Living Theater Volume 2, Terry was asked to return and recorded &ldquo;I dreamed&rdquo; for Volume 3 thus continuing his productive collaboration with producer/composer Joseph Baldassare."
comments[7] = "As a full-time member multiple Grammy-winning Chanticleer, Terry performed over a hundred concerts across the globe as a full time member of the ensemble. This album is an anniversary collection dedicated to the memory of Louis Botto, the ensemble&rsquo;s founder and artistic director."
comments[8] = "Karl Jenkins Music, producers of Terry&rsquo;s distinct rendition of &ldquo;Ave Maria&rdquo; for Catrin Finch&rsquo;s album, continues to release Terry&rsquo;s work on various albums including this compilation of Christmas favorites from Sony."
comments[9] = "Working with writers Andrew Gold, Greg Prestopino and Sabelle Breer (who have written for Celine Dion, Linda Ronstadt, Avril Lavigne and Nsync), Terry created his first solo album as a tribute to his mother who passed away at a young age.  In 2008 he recorded Volume II. In this version, he delves deeper into production and composition, improving on a few tracks from the first version and including more of his own writing."
comments[10] = "Terry Barber and soprano Evelyn Tubb, both specialists in early music, came together to perform and produce a live recording of this beautiful work by Pergolesi.  In addition to his seamless collaboration with Tubb on this project, Terry worked closely with Michael Fields, a compelling lutinist and musician."
comments[11] = "Grammy winner Steve Smith asked Terry to create some otherworldly sounds for the title track of his most recent release."
comments[12] = "As a fan of this new age series, Terry reached out to composer, Karl Jenkins who enthusiastically responded, &ldquo;Let&rsquo;s do an album.&rdquo;  Accompanied by the London Philharmonic Orchestra, Terry was a principal soloist performing on several tracks including the title song."

function pageInit() {
	
	// Set up panels
	var landingpanel = document.getElementById("landing");
	var infopanel = document.getElementById("info");
	
	landingpanel.style.display = "block";
	infopanel.style.display = "none";
	
	// Add rollover events to image links
		for (var i=0; i<document.images.length; i++) {
		  if (document.images[i].className == "rollover") {	
			   setupRollover(document.images[i]);
		   }
		  if (document.images[i].className == "thumb") {	
			   setupThumb(document.images[i]);
		   }
	}
	
	var loadimg = MM_preloadImages('images/album-art/Crossing-the-Stone.jpg','images/album-art/Danceculture.jpg','images/album-art/Dido-and-Aeneas.jpg','images/album-art/Jesuit-Operas.jpg','images/album-art/Joy.jpg','images/album-art/Living-Theater-2.jpg','images/album-art/Living-Theater-3.jpg','images/album-art/Reflections.jpg','images/album-art/Simply-Christmas.jpg','images/album-art/Songs-She-Loved.jpg','images/album-art/Stabat-Mater.jpg','images/album-art/This-Town.jpg','images/album-art/Vocalise.jpg')
	
}

// Setup rollovers for image links
function setupRollover(theImg) {
	theImg.upImg = new Image();
	theImg.upImg.src = theImg.src;
	theImg.onmouseout = function() {
		this.src = this.upImg.src;
	}
	
	theImg.overImg = new Image();
	
	var imgname;
	var overimage;
		
	imgname = theImg.src;
	overimage = imgname.replace(/-up/,'-over');
	theImg.overImg.src = overimage;

		theImg.onmouseover = function() {
		this.src = this.overImg.src;
	}
}

// Setup thumbnail actions
function setupThumb(theImg) {
	
	theImg.onclick = swapPanel;
	
}

// Load album info into panel
function swapPanel() {
	
	// Set up panels
	var landingpanel = document.getElementById("landing");
	var infopanel = document.getElementById("info");
	var purchasebtn = document.getElementById("purchase");
	
	purchasebtn.style.display = "none";
	landingpanel.style.display = "none";
	infopanel.style.display = "block";
	
	// Get selected thumbnail's ID
	var thumbID = this.id;

	// Update Album Art
	var coverart = document.getElementById("albumart");
	var coverpath = 'images/album-art/' + covers[thumbID];
	coverart.setAttribute("src",coverpath);
	coverart.setAttribute("alt",titles[thumbID]);
	
	// Update text elements
	infopanel.getElementsByTagName("h1").item(0).innerHTML = titles[thumbID];
	infopanel.getElementsByTagName("h2").item(0).innerHTML = artists[thumbID];
	infopanel.getElementsByTagName("h3").item(0).innerHTML = release[thumbID];
	document.getElementById("role").innerHTML = roles[thumbID];
	document.getElementById("comments").innerHTML = comments[thumbID];
	
	// Show purchase button
	if (thumbID == 9) {
		purchasebtn.style.display = "block";
	} 
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}