/* load video urlName into player */
function playVid(urlName){
ytplayer2 = document.getElementById("ytplayer");
ytplayer2.loadVideoById(urlName);
}

jsIndex = 1;
iScroll = 0;

function nextVid() {
	if(jsIndex < (videoNum - 2)) {
		jsIndex++;
		iScroll = iScroll - 75;
		var objElem = document.getElementById("hfeed");
		objElem.style.top = (iScroll) + "px";
	}
}

function previousVid() {
	if(jsIndex >= 2)
	{
		jsIndex--;
		iScroll = iScroll + 75;
		var objElem = document.getElementById("hfeed");
		objElem.style.top = (iScroll) + "px";
	}
}


/* when page is loaded */
$(document).ready(function(){
	/* embed player into the page */
	var params = {};
	var atts = { id: "ytplayer" };
	params.allowscriptaccess    = 'always';
	params.wmode   = 'window';
	params.allowFullScreen = 'true';
	swfobject.embedSWF("http://www.youtube.com/v/"+videoID+"&hl=en&enablejsapi=1&rel=0&HD=1&fs=1&showinfo=1","ytapiplayer", "584", "352", "8", null, null, params, atts);		
	
	/* make rel="external" links open in a new window */
	$('a[rel="external"]').attr('target', '_blank');
});
