var artistNames=new Array()
artistNames[0]="Faber Drive"
artistNames[1]="LIGHTS"
artistNames[2]="Danny Fernandes"
artistNames[3]="Shiloh"
artistNames[4]="Karl Wolf"
artistNames[5]="Joannie Rochette"
artistNames[6]="The New Cities"
artistNames[7]="Mike Fisher"
var nextName=1
var prevName=7

$(document).ready(function(){
var $panels=$('#slider .panel')
var $container=$('#slider .scrollContainer')
var $scroll=$('#slider .scroll').css('overflow','hidden')
$('#celebSubNav .navigation a').click(selectNav)
function selectNav(){
$(this)
.parents('ul:first')
.find('li')
.removeClass('selected')
.end()
.end()
.parents('li:first')
.addClass('selected')
.end()
.end()}
var scrollOptions={
target: $scroll,
items: $panels,
navigation: '#celebSubNav .navigation a',
prev: '.left',
next: '.right',
axis: 'xy',
duration: 500,
easing: 'swing'}
$('#slider').serialScroll(scrollOptions);
$.localScroll(scrollOptions)
if(window.location.hash){
var target=window.location.hash.substring(2,window.location.hash.length)
for(var i=0;i<artistNames.length;i++){
if(artistNames[i].match(target)){
$('.storySubNav .navigation a:eq('+i+')').click()
getArtist(i)}}
}else{
getArtist('0')}
})


function getArtist(direction){
if(direction=='forward'){
if(nextName==1){
nextName++
prevName=0
}else if(nextName==7){
nextName=0
prevName++
}else{
nextName++
prevName++}
}else if(direction=='back'){
if(nextName==0){
nextName=7
prevName--
}else if(prevName==0){
nextName--
prevName=7
}else{
nextName--
prevName--
}
}else if(direction){
var yourInt=parseInt(direction);
if(yourInt=='0'){
nextName=1;
prevName=7;
}else if(yourInt==7){
nextName=0
prevName=yourInt-1
}else{
nextName=yourInt+1;
prevName=yourInt-1;
}
}
if (nextName == '1') {
yourInt = '0';
} else {
yourInt = prevName+1;
}
$('.storySubNav .navigation a:eq('+yourInt+')').click();
document.getElementById("leftArrow").innerHTML=artistNames[prevName];
document.getElementById("rightArrow").innerHTML=artistNames[nextName]}
