function lightSwitch(n) {
	n++;
	i=1;
	while (i < 7) {
		if (n == i) { $('#goto'+i).addClass('selected'); }
		else { $('#goto'+i).removeClass('selected'); }
		i++;
	}
}
function getHash() {
  var hash = window.location.hash;
  switchhash = hash.substring(1); // remove #
  if (switchhash == "macmiller") {
	changeSwitch(0,switchhash);
	}
	else if (switchhash == "billieslum") {
		changeSwitch(1,switchhash);
	}
	else if  (switchhash == "nappyroots") {
		changeSwitch(2,switchhash);
	}
	else if  (switchhash == "theoutlawz") {
		changeSwitch(3,switchhash);
	}
	else if (switchhash == "tityboi") {
		changeSwitch(4,switchhash);
	}
	else {
		if (switchhash == "autoplay") {
			changeSwitch(0,"macmiller");
		}
	}
}
function changeSwitch(id,title) {
	$('#nav a:eq('+id+')').trigger('click'); 
	niftyplayer('niftyPlayer1').loadAndPlay('/player/'+title+'.mp3');
	lightSwitch(id);
}
		
setTimeout("getHash()",3000);

$("#ftr").ready(function() {

$('.features').cycle({
    fx:     'fade',
    speed:  1000,
    timeout: 0,
    pager:  '#nav',
});



$('#goto1').click(function() { 
	changeSwitch(0,"macmiller");
});
$('#goto2').click(function() { 
	changeSwitch(1,"billieslum");
});
$('#goto3').click(function() { 
	changeSwitch(2,"nappyroots");
});
$('#goto4').click(function() { 
	changeSwitch(3,"theoutlawz");
});
$('#goto5').click(function() { 
	changeSwitch(4,"tityboi");
});


});
