var videosArray = new Array(); //array con los videos a cargar

videosArray[0] = new Array("http://www.youtube.com/watch?v=zUQHeUn7ZNI", "http://i3.ytimg.com/vi/zUQHeUn7ZNI/default.jpg", "Defying gravity at the JFGA");
videosArray[1] = new Array("http://www.youtube.com/watch?v=IR40sWiH9Ps", "http://i2.ytimg.com/vi/IR40sWiH9Ps/default.jpg", "British Weather Simulation");
videosArray[2] = new Array("http://www.youtube.com/watch?v=hqcG6mFxUsU", "http://i1.ytimg.com/vi/hqcG6mFxUsU/default.jpg", "JFGA at Sotogrande");
videosArray[3] = new Array("http://www.youtube.com/watch?v=Vi4NvK3JIU8", "http://i3.ytimg.com/vi/Vi4NvK3JIU8/default.jpg", "JFGA Sotogrande, Canal+ Golf TV");
videosArray[4] = new Array("http://www.youtube.com/watch?v=HJLKeLaa_cg", "http://i1.ytimg.com/vi/HJLKeLaa_cg/default.jpg", "JFGA Performance Injection - Episode 1 ");
videosArray[5] = new Array("http://www.youtube.com/watch?v=GzkAK-7eFsY", "http://i4.ytimg.com/vi/GzkAK-7eFsY/default.jpg", "JFGA Performance Injection - Episode 2 ");
videosArray[6] = new Array("http://www.youtube.com/watch?v=LU5f_W7a2nY", "http://i1.ytimg.com/vi/LU5f_W7a2nY/default.jpg", "JFGA Performance Injection - Episode 3");
videosArray[7] = new Array("http://www.youtube.com/watch?v=shX-2dn0b7M", "http://i4.ytimg.com/vi/shX-2dn0b7M/default.jpg", "Evaluations - Playing hockey");
videosArray[8] = new Array("http://www.youtube.com/watch?v=W6vIwZUh5EM", "http://i4.ytimg.com/vi/W6vIwZUh5EM/default.jpg", "Alex Noren Clinic at the academy");
videosArray[9] = new Array("http://www.youtube.com/watch?v=O8a_albdgsE", "http://i4.ytimg.com/vi/O8a_albdgsE/default.jpg", "Fitness");
videosArray[10] = new Array("http://www.youtube.com/watch?v=mpxhJCCB6Sg", "http://i2.ytimg.com/vi/mpxhJCCB6Sg/default.jpg", "Evaluations - British Weather Simulation");
videosArray[11] = new Array("http://www.youtube.com/watch?v=ZIpz_kM4aQ4", "http://i3.ytimg.com/vi/ZIpz_kM4aQ4/default.jpg", "Marcelo going through his short game eval...");
videosArray[12] = new Array("http://www.youtube.com/watch?v=PIhDhAQUoJY", "http://i1.ytimg.com/vi/PIhDhAQUoJY/default.jpg", "Evaluations - Adam Skills test");
videosArray[13] = new Array("http://www.youtube.com/watch?v=f-oykW8iPKg", "http://i1.ytimg.com/vi/f-oykW8iPKg/default.jpg", "Manuel de los Santos se entrena en la Jason Floyd");


function cargarVideos(){
	var salida = '';
	for (i = (videosArray.length - 1); i >= 0 ; i--){
		salida += '<div class="miniVideo"><div class="imgVideo"><a href="' + videosArray[i][0] + '&autoplay=1' + '"';
		salida += ' class="nyroModal" rel="gal" title="" >';
		salida += '<img class="imgPreVideo" height="90" width="120" src="';
		salida += videosArray[i][1];
		salida += '" /><img class="play" src="../images/play.png" /></a></div><div class="textoVideo">';
		salida += videosArray[i][2];
		salida += '</div></div>';
	}
	
	return salida;
}

function videosLeft(){
	if(posVideos > 2){
		$('#videosBox').animate({left : '+=572'}, 500, 'linear');
		posVideos -= 1;
	} else if (posVideos == 2) {
		$('#videosBox').animate({left : 0}, 500, 'linear');
		posVideos = 1;
	}
}

function videosRight(){
	if(posVideos < pagsVideos-1){
		$('#videosBox').animate({left : '-=572'}, 500, 'linear');
		posVideos += 1;
	} else if(posVideos == pagsVideos-1){
		$('#videosBox').animate({left : (videosArray.length * -143) + 572}, 500, 'linear');
		posVideos = pagsVideos;
	}	
}
