$(document).ready(function(){
	
	// Disclaimer modal window
	if ($('#disclaimer_modal').length) {
		$.blockUI({
			message: $('#disclaimer_modal'),
			css: {
                top:  ($(window).height() - 369) /2 + 'px', 
                left: ($(window).width() - 740) /2 + 'px', 
                width: '740px'
			}
		});
	}
	
	// Date picker
	$('input.datepicker').datepicker({
		dateFormat: 'yy-mm-dd'
	});
	
	var icons = {
		header: "ui-icon-off",
		headerSelected: "ui-icon-on"
	};
	
	// team accordion
	$('#accordion').accordion({
		header: 'div.info',
		autoHeight: false,
		icons: icons
	});
	
	$('.audioplay').bind('click', function(el){
		$(this).closest('tr').next().toggle();
		return false;
	});
	
	// Newsletter tabs
	$('.fileTabs ul.tabs a').bind('click', function(){
		var elem = $(this).closest('.fileTabs');
		
		$('table', elem).hide();
		$('table#' + $(this).text() + '-tab-content', elem).show();
		
		$('li.active', elem).removeClass('active');
		$(this).parent().addClass('active');
		return false;
	});
	
	$('input[name="Fund_Group"]').change(function(){
		var transcript_upload = $('#transcript_field');
		if($(':checked', $(this).closest('div')).val() == 'Investor Call')
		{
			transcript_upload.show();
		}
		else
		{
			transcript_upload.hide();
		}
	});
});

function toggleQuestions(el) {
	$('#questions_company').hide();
	$('#questions_individual').hide();
	$('#' + el).show();
}
