
$(document).ready(function(){
	$(".tabsTop .tabsLinks li span,.tabsLinks p").click(function(){
	$(".tabsTop .tabs").each(function(){$(this).hide();});
	$(".tabsTop .tabsInner #"+$(this).attr("id")).show();
	$(".tabsTop .tabsLinks li span,.tabsLinks p").each(function(){$(this).removeClass("selected");});
	$(this).addClass("selected");
	});
});


function showMoreFor(element)
{
	$("#moreFor"+element).fadeIn();
	$("#showMoreFor"+element).hide();
	$("#hideMoreFor"+element).show();
}
function hideMoreFor(element)
{
	$("#moreFor"+element).fadeOut();
	$("#showMoreFor"+element).show();
	$("#hideMoreFor"+element).hide();
}

function showPopupVideo(element)
{
	$("#popupDescription"+element).hide();
	$("#popupVideo"+element).show();
}





function nextPane(paneType)
{
	if($("#pane_"+paneType+" .on").next().is("span"))
	{
		$("#pane_"+paneType+" .on").removeClass("on").hide().next().show().addClass("on");
	} 
	
	
	
		if(!$("#pane_"+paneType+" .on").prev().is("span"))
		{
			$("#pane_"+paneType+" .Prev").hide();
		}
		else
		{
			$("#pane_"+paneType+" .Prev").show();
		
		}
		
		
		if(!$("#pane_"+paneType+" .on").next().is("span"))
		{
			$("#pane_"+paneType+"  .Next").hide();
		}
		else
		{
			$("#pane_"+paneType+".Next").show();
		}
	
	
	
}


function prevPane(paneType)
{
	if($("#pane_"+paneType+" .on").prev().is("span"))
	{
		$("#pane_"+paneType+" .on").removeClass("on").hide().prev().show().addClass("on");
	
		if(!$("#pane_"+paneType+" .on").prev().is("span"))
		{
			$("#pane_"+paneType+" .PrevNext .Prev").hide();
		}
		else
		{
			$("#pane_"+paneType+" .PrevNext .Prev").show();
		
		}
		
		
		if(!$("#pane_"+paneType+" .on").next().is("span"))
		{
			$("#pane_"+paneType+" .PrevNext .Next").hide();
		}
		else
		{
			$("#pane_"+paneType+" .PrevNext .Next").show();
		}
	
	
	} 
	
	
}

function updateTitle(ftype,source)
{
//alert($(source).children(".date").html());
//alert("#"+ftype+" .videoData .videoDate");
//alert($("#"+ftype+"_info .videoDate").html());

$("#"+ftype+".videoData .videoDate").html($(source).children(".date").html());



$("#"+ftype+".videoData h2").html($(source).children(".title").html());
$("#"+ftype+".videoData p").html($(source).children(".description").html());

}

function showCSPANPlayer(url)
{
theNewWin=window.open(url,'CSPANFlashPlayerWindow','width=370,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=yes,resizable=no,top=0,left=0');

	if(theNewWin)
	{
		theNewWin.focus();
		theNewWin.resizeTo('370','480');
	}
	else
	{
		alert("You appear to be using popup blocking software.  Please allow popups for www.c-spanarchives.org and then reload this page in order to see the video.");
	}
}

function showFlashPlayer(pID,clipStart,clipStop) {
	var url="http://www.c-spanarchives.org/library/includes/templates/library/flash_popup.php";
	url+="?pID="+pID;
	url+="&clipStart="+clipStart;
	url+="&clipStop="+clipStop;
	theNewWin=window.open(url,'CSPANFlashPlayerWindow','width=370,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=yes,resizable=no,top=0,left=0');

	if(theNewWin)
	{
		theNewWin.focus();
		theNewWin.resizeTo('370','480');
	}
	else
	{
		alert("You appear to be using popup blocking software.  Please allow popups for www.c-spanarchives.org and then reload this page in order to see the video.");
	}
}



