/* ======================= */
/* Modified From pageSlide */
/* ======================= */

/* Configuration Settings */

var moveInt = 285 // y axis movement
var sliderPosArt = 1 // where the slider starts
var sliderPosMusic = 1 // music slider start

/* ==================== */
/* ===   Functions 	=== */
/* ==================== */

function jumpToTime(year) {
	/* part one - getting position from element */
	var elem = 'date-'+year;
	var obj = $(elem);
	var objClass = obj.readAttribute('class');
	var objNum = objClass.substring(14);

	/* part two - getting distance to move */
	var moveDist = ((objNum - sliderPosArt)*moveInt)*-1;
	
	/* part three - moving object */
	new Effect.Move($('timeline_dates'),{x: 0, y: moveDist, queue: {position: 'end', scope: 'contentscope'}})
	
	/* last bit - updating sliderPos */
	sliderPosArt = objNum;
}

function jumpToTime2(year) {
	/* part one - getting position from element */
	var elem = 'music-'+year;
	var obj = $(elem);
	var objClass = obj.readAttribute('class');
	var objNum = objClass.substring(14);

	/* part two - getting distance to move */
	var moveDist = ((objNum - sliderPosMusic)*moveInt)*-1;
	
	/* part three - moving object */
	new Effect.Move($('timeline_dates_music'),{x: 0, y: moveDist, queue: {position: 'end', scope: 'contentscope'}})
	
	/* last bit - updating sliderPos */
	sliderPosMusic = objNum;
}

var currentSlide = 'art';
function swapSlide(slide) {
	// detecting the slide to swap to
	switch(slide) {
		case 'art':
			if(currentSlide == 'music') {
				// move slide
				new Effect.Move($('timelineSlider'),{x: 606, y: 0, queue: {position: 'end', scope: 'contentscope'}});

				// switch classes on buttons
				$('artSpan').addClassName('bottomBG');
				$('musicSpan').removeClassName('bottomBG');
			}
		break;
		
		case 'music':
			if(currentSlide == 'art') {
				new Effect.Move($('timelineSlider'),{x: -606, y: 0, queue: {position: 'end', scope: 'contentscope'}})
				$('artSpan').removeClassName('bottomBG');
				$('musicSpan').addClassName('bottomBG');
			}
		break;
	}
	
	// updating the currentSlide
	currentSlide = slide;
}