thisMovie = function(movieName)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
	{
		return document[movieName];
	}
	else
	{
		return document[movieName];
	}
}

indicateCurrentVideo = function()
{
	// retrieve all anchors with the class name "videoThumbnail" and iterate through them
	$$('a.videoThumbnail').each(function(obj)
	{
		// attach event handler
		obj.onclick = function()
		{
			// remove the class "current" from all anchors
			$$('a.videoThumbnail').each(function(obj)
			{
				obj.removeClassName('current');
			});

			// add the class "current" to the clicked anchor
			obj.addClassName('current');
			
			var id = obj.parentNode.id.substring(5); // Remove first 5 characters from id... i.e "v i d e o"
			var mv = thisMovie("videoPlayer"); 
			//alert('return from "thisMovie"');
            mv.callAS(id);
                        
			//alert('return from "callAS"');
			$('video-title-current').innerHTML = $('video-title-'+ id).innerHTML;
			$('video-description-current').innerHTML = $('video-description-'+ id).innerHTML;
			
			// return false to avoid following anchor reference
			return false;
		}
	});
}

highlightCurrentVideo = function(videoID)
{
	$$('a.videoThumbnail').each(function(obj)
	{
		$$('a.videoThumbnail').each(function(obj)
		{
			obj.removeClassName('current');
		});
		
		$('video'+ videoID).firstChild.addClassName('current');
		$('video-title-current').innerHTML = $('video-title-'+ videoID).innerHTML;
		$('video-description-current').innerHTML = $('video-description-'+ videoID).innerHTML;
	});
}