/* --- Initialize page --- */
$(document).ready(function(){

	/* --- Videos --- */
	if (document.getElementById("videoplayer")) {
		//my hover
			$('#videobar li').hover(function() {
			$(this).addClass('hover-white');
			}, function() {
			$(this).removeClass('hover-white');
			});

		// Hide all but first video, set active class for first thumbnail
		$("#videoplayer>div").not(":first").hide();
		$("#videobar a:first").addClass("active");

		// Click thumbnails
		$("#videobar a").click(function(){
			// Stop if already showing
			if ($(this).is(".active")) { return false; }

			// Switch video
			$("#videoplayer>div:visible").hide();
			$(this.hash).show();
			$(".widget_title").html(this.hash.slice(1));
			// Switch active link
			$("#videobar a.active").removeClass("active");
			$(this).addClass("active");
			return false;
		});
	}
});
