function playclip(obj){

    $("li.selected").removeClass("selected")
    obj.className = 'selected greyseparator'

    var playerid = $(obj).attr("alt");
    $("div.show").addClass("hide")
    $("div.show").removeClass("show")

    document.getElementById(playerid).className="show"

}

$(function() {
	$("#shareTabs a").click(function(e)  {
		$f().hide(true);

		// toggle tab class
		var tab = $(this);
		$("#shareTabs a").removeClass("current");
		tab.addClass("current");

		// show / hide panes
		$(tab.attr("href")).show();
		var other = (tab.attr("href") == "#emailPane") ? $("#embedPane") : $("#emailPane");

		other.hide();

		// prevent link's default behaviour
		return e.preventDefault();

	});
	// close buttons
	$("#panes div.close").click(function() {
		$("#shareTabs a").removeClass("current");
		$("#emailPane, #embedPane").hide();
		$f().show();
	});
});

$(document).ready(function() {
    $(".tab_container").show();
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});  
});
