$(document).ready(function(){
	$('a#show_moreinfo').toggle(
		function() {
			$('#episode_extra').slideDown('normal', function() { $('a#show_moreinfo').html('Hide cast/crew info'); });
		},
		function () {
			$('#episode_extra').slideUp('normal', function() { $('a#show_moreinfo').html('Show cast/crew info'); });
		}
	);


	$('#talent_letters > a').click(
		function() {
			letter = $(this).attr('href').substr(-1);
			$('#talent_list').hide().load('ajax/get_talent_list.php', {tlet: letter}, function () { $('#talent_list').show(); });
			return false;
		}
	);
	$('#all_talent').click(
		function() {
			$('#talent_list').hide().load('ajax/get_talent_list.php', {tlet: 'all'}, function () { $('#talent_list').show(); });
			return false;
		}
	);
	
	view_list_switch(0);	submit_form_start();
});function view_list_switch(selected_tab) {	if (!document.getElementById('view_ep_list'))		return;		if (!document.getElementById('ep_list_'+selected_tab))		selected_tab=0;		for (var i=0; i<3; i++) {		var the_list = document.getElementById('ep_list_'+i);		var the_tab = document.getElementById('tab_'+i);		if (the_list) {			if (i==selected_tab) {				the_list.style.display='';				the_tab.className='tab_selected';			}			else {				the_list.style.display='none';				the_tab.className='tab_deselected';			}		}				if (i==selected_tab && !the_list)			selected_tab++;	}}function new_pilot_check() {	var video_online =  document.new_pilot.video_online[0].checked;	document.new_pilot.show_link.disabled = !video_online;	document.new_pilot.show_pass.disabled = !video_online;		if (video_online)		$('#snail_mail_info').slideUp();	else		$('#snail_mail_info').slideDown();}function new_pilot_submit() {	var video_online =  document.new_pilot.video_online[0].checked;		if (document.new_pilot.person_name.value=='') {		alert('Please enter your name!');		document.new_pilot.person_name.focus();		return false;	}		if (document.new_pilot.email.value=='') {		alert('Please enter your email address!');		document.new_pilot.email.focus();		return false;	}		if (document.new_pilot.show_name.value=='') {		alert('Please enter your show name!');		document.new_pilot.show_name.focus();		return false;	}		if (video_online && document.new_pilot.show_link.value==''){		alert('Please enter your show link!');		document.new_pilot.show_link.focus();		return false;	}	return true;}function new_ad_submit() {		if (document.new_ad.person_name.value=='') {		alert('Please enter your name!');		document.new_ad.person_name.focus();		return false;	}		if (document.new_ad.email.value=='') {		alert('Please enter your email address!');		document.new_ad.email.focus();		return false;	}		if (document.new_ad.show_link.value==''){		alert('Please enter your show link!');		document.new_ad.show_link.focus();		return false;	}	return true;}function submit_form_start() {	if (!eval('document.new_pilot') || !eval('document.new_pilot.video_online'))		return;		if (document.new_pilot.video_online[0].checked)		$('#snail_mail_info').css('display','none');	else		$('#snail_mail_info').css('display','');}
