﻿var currentshow;
currentshow = 0;

var myvideos = new Array();
myvideos[0] = "esB_P6CC1Mo";
myvideos[1] = "GEfchy-qr50";
myvideos[2] = "rvUMywtZG1Q";
myvideos[3] = "6qYb3F323-M";
myvideos[4] = "6-Pn4z-4kCM";
myvideos[5] = "7CZRc4sCdsE";
myvideos[6] = "9TZ5LNYxxdA";
myvideos[7] = "M1Q5fEVenWw";

function navigate_forward(){
	if (currentshow <7) currentshow +=1;
	display_current();
}
function navigate_backward(){
	if (currentshow>0) currentshow -=1;
	display_current();
}
function display_current(){

	jQuery(document).ready(function() {
		if (currentshow>=0 && currentshow <=7){
			$("#myvideo").html('<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'+myvideos[currentshow]+'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+myvideos[currentshow]+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>');
			$("#video-title").html("Antonia Spicer Show Reel: Part " + (currentshow+1));
		}
		//if first video, disable previous button
		if (currentshow==0){
			$("#navigate-previous").toggleClass("jcarousel-prev-horizontal");
			$("#navigate-previous").toggleClass("jcarousel-prev-disabled-horizontal");
		} else {
			$("#navigate-previous").addClass("jcarousel-prev-horizontal");
			$("#navigate-previous").removeClass("jcarousel-prev-disabled-horizontal");
		}
		//if last video
		if (currentshow==7){
			$("#navigate-next").toggleClass("jcarousel-next-horizontal");
			$("#navigate-next").toggleClass("jcarousel-next-disabled-horizontal");
		} else {
			$("#navigate-next").addClass("jcarousel-next-horizontal");
			$("#navigate-next").removeClass("jcarousel-next-disabled-horizontal");
		}
	});
	
}
