$(document).ready(function() {
	setupNav();
	setupCloseBtns();
	setupText();
	setupTextNav();
})

function setupNav() {
	$("#ringtonesBtn,#aboutJgBtn,#aboutAlbumBtn,#sweepstakesBtn").hover(
		function(){
			$(this).css('background-position', '0 top');
		},
		function(){
			$(this).css('background-position', '0 bottom');
		}
	)
	
	$("#ringtonesBtn").click(function(){
		$("#aboutJgArea").hide();
		$("#aboutAlbumArea").hide();
		$("#ringtonesArea").show();
	})
	
	$("#aboutJgBtn").click(function(){
		$("#aboutAlbumArea").hide();
		$("#ringtonesArea").hide();
		$("#aboutJgArea").show();
	})
	
	$("#aboutAlbumBtn").click(function(){
		$("#ringtonesArea").hide();
		$("#aboutJgArea").hide();
		$("#aboutAlbumArea").show();
	})
	
	$("#sweepstakesBtn").click(function(e){
		var url = "http://www.wbecommerce.com/shops/sweeps/adultswim/index.html";
		if(e.ctrlKey) {
			window.open(url, "_blank");
		} 
		else {
			window.open(url, "_self");
		}
	})
}

function setupCloseBtns() {
	$(".closeBtn").each(function(i){
		$(this).click(function(){
			$(this).parent().hide();
		})
	})
}

var jgBioText1 = "<p>JG Thirlwell is a composer/producer/performer based in Brooklyn. He was born in Melbourne, Australia, where he studied art at Melbourne State College for two years before moving to London in 1978. After working with experimental group Nurse With Wound, JG started making his own records in 1980, initially releasing them with his own label, Self Immolation. He was inspired by the post-punk explosion of creativity in the UK, which engendered the accessibility of DIY, and the writings of John Cage and systems music, among other things. He then relocated to NYC in 1983 where he still lives in Brooklyn, between travels.</p><p>JG's catalog is extensive, under many pseudonyms including Foetus, Steroid Maximus, Manorexia, Baby Zizanie, Wiseblood and others. If there is a common thread to his varied musical styles it is a dramatic intensity and an evocative, cinematic quality. He considers the studio his main instrument. His oeuvre stretches the gamut from orchestrations, big band and sound sculpture, cathartic noise-rock to abstract  electronics, chamber music, serial music and imaginary soundtracks - sometimes all in the same album.</p><p>In recent years, with commissions for Kronos Quartet, LEMUR and Bang On A Can, and in his occasional eighteen-piece ensemble, he has been increasingly interested electronically and sample generated music being rescored for traditional instrumentation played both conventionally and not. JG is also a member of the \"freq_out\" sound-art collective, who create on-site sound and light installations led by curator Carl Michael Von Hausswolf.  Most recently he has been performing with a chamber ensemble version of  Manorexia.</p>"
var jgBioText2 = ""

var albumText1 = "<p>By: Jackson Publick</p><p>A good score can really get a show moving.  It sets the tone, bridges the scenes, reinforces the theme, and keeps things from getting too static during the talky bits. But without J.G. Thirlwell's music, The Venture Bros. would not move at all. Yes, I have a confession to make: The Venture Bros. wouldn't exist without J.G. </p><p>I came up with the basic idea for The Venture Bros. back in the late '90's, but hadn't yet considered turning it into an animated television show (odd, I realize, for someone who was already making his living in cartoons at the time, and was actively pitching series ideas to the cable networks... but there you have it). Animation was my day job, but on the side my co-workers and I published an annual anthology of our personal comic book stories called Monkeysuit. Which was my intended destination for The Venture Bros... </p><p>...until a more musically adventurous friend of mine lent me a copy ofQuilombo because he knew I would dig it. He had no idea how much.</p><p>Track 4: \"Fighteous.\" That changed everything. Ten seconds into my first listen, and the first thing that ran through my head was \"what is this strange, wonderful, Jonny Quest-on-steroids music?!\" The second thing that ran through my head was Hank and Dean. Literally. Their now iconic silhouettes from our opening title sequence appeared fully-formed before my eyes and started running in time to the beat.  </p>";
var albumText2 = "<p>It was as if these complete strangers calling themselves \"Steroid Maximus\" had probed my subconscious and written the theme song for The Venture Bros. show that I </p><p>didn't even know I wanted to make yet. The music was commanding me to animate the little bastards--I had writing to do!</p><p>I finished the first draft of the pilot script in less than a week.</p><p>Of course, nothing else in the process of making an animated TV show happens that quickly, so it was two years later when I finally convinced Adult Swim to produce The Venture Bros. My first order of business was to track down Steroid Maximus and try to convince them to do my theme song. To my surprise, \"them\" (as well as Foetus, Manorexia, and countless other \"bands\") was J.G. Thirlwell. To my even bigger surprise, he lived in right here in Brooklyn and was about to release a new Steroid Maximus CD. And to my eternal gratitude, he agreed to join the The Venture Bros. </p><p>I will never forget my first visit to J.G.'s loft to hear his music for our first regular series episode, \"Dia De Los Dangerous.\" And not just because it was so much nicer than my apartment, or because he has a giant letter \"X\" in the middle of his living room. The music blew my head off and left a cartoonishly gigantic, toothy grin in its place. It was exactly what I imagined and yet way beyond my expectations. We had already been in production for months, </p>";
var albumText3 = "<p>but it wasn't until then and there that I felt like The Venture Bros. was going to be a \"real\" show. And better yet, it was going to be a show with the hottest damn music ever heard in a cartoon. Not to sound too prophetic, but I knew there was no way in hell a soundtrack CD like the one you now hold in your hands wouldn't someday become a reality. I'm only surprised it took this long.</p><p>But thank god it did. Because over the course of the three seasons and four years since The Venture Bros. premiered, the show has evolved in complexity and emotional range, and J.G.'s music has evolved with it--sometimes leading the way. I'm super-excited and proud to present to you, without further interruption from our chattering characters or exploding hovercrafts, J.G. Thirlwell's incredible scores for The Venture Bros.</p><p>Press \"play\" and start running!</p><p>(I still haven't returned my friend's Quilombo CD.)</p>";
var albumText4 = "<p>By: John Zorn NYC 2008</p><p>JG Thirlwell's brilliant music for The Venture Brothers injects new energy into the world of cartoon soundtracks. An extension of his work with Steroid Maximus, the music is filled with honesty, imagination and excitement. Like all great soundtrack composers, JGT is a compendium of music history and he jumps easily from one genre to another with flamboyant style—mambo, drum 'n' bass, electronica, 20th century classical, lounge, calliope carousel, big band jazz—nothing seems to escape his unerring ear, but no matter where he goes, he always remains uniquely himself. </p><p>JGT truly understands the medium. Not afraid to use humor or comment on the action, the music is filled with inside jokes, parodies and references to classic film scores by Morricone, Carpenter, Schifrin, Mancini, Quincy Jones and others, giving the music an added layer of complexity and depth. The best soundtrack music can be appreciated on many levels, and JG Thirlwell's music for The Venture Brothers is no exception. Rich in detail and meticulously crafted, it simultaneously brings life to the images it accompanies and stands firmly on its own as fascinating music in its own right. This is great music. </p>";

var albumTextIndex = 1;

function setupText() {
	$("#aboutJgText").empty();
	$("#aboutJgText").append('<img id="jgPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/jgThirlwellPic.jpg" alt="JG Thirlwell" />' + jgBioText1);
	
	$("#aboutAlbumText").empty();
	$("#aboutAlbumText").append('<img id="ventureBrosPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/ventureBrosPic.png" alt="The Venture Bros." />' + albumText1);
}

function setupTextNav() {
	$(".nextBtn,.backBtn").hover(
		function(){
			$(this).css('background-position', '0 bottom');
		},
		function(){
			$(this).css('background-position', '0 top');
		}
	)
	
	/*$("#aboutJgArea .nextBtn").click(function(){
		$("#aboutJgText").empty();
		$("#aboutJgText").append('<img id="jgPic" src="tools/img/jgThirlwellPic.jpg" alt="JG Thirlwell" />' + jgBioText2);
	})
	
	$("#aboutJgArea .backBtn").click(function(){
		$("#aboutJgText").empty();
		$("#aboutJgText").append('<img id="jgPic" src="tools/img/jgThirlwellPic.jpg" alt="JG Thirlwell" />' + jgBioText1);
	})*/
	
	$("#aboutAlbumArea .nextBtn").click(function(){
		albumTextIndex++;
		$("#aboutAlbumText").empty();
		
		if (albumTextIndex > 4) {
			albumTextIndex = 4;
		}
		
		switchIt();
	})
	
	$("#aboutAlbumArea .backBtn").click(function(){
		albumTextIndex--;
		
		if (albumTextIndex < 1) {
			albumTextIndex = 1;
		}
		
		$("#aboutAlbumText").empty();
		
		switchIt();
	})
}

function switchIt() {
	switch(albumTextIndex) {
		case 1: 
			$("#aboutAlbumText").append('<img id="ventureBrosPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/ventureBrosPic.png" alt="The Venture Bros." />' + albumText1);
			break;
		case 2:
			$("#aboutAlbumText").append('<img id="ventureBrosPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/ventureBrosPic.png" alt="The Venture Bros." />' + albumText2);
			break;
		case 3:
			$("#aboutAlbumText").append('<img id="ventureBrosPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/ventureBrosPic.png" alt="The Venture Bros." />' + albumText3);
			break;
		case 4:
			$("#aboutAlbumText").append('<img id="ventureBrosPic" src="http://i.cdn.turner.com/adultswim/music/venturebrosalbum/tools/img/ventureBrosPic.png" alt="The Venture Bros." />' + albumText4);
			break;
		default:
			break;
	}
}


