$(document).ready(function(){
	$("a.imgZoom").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayShow':	true,
		'overlayOpacity': .8
	});
	
	$("a.fancyFrame").fancybox({
		'zoomSpeedIn'		: 300,
		'zoomSpeedOut'		: 300,
		'overlayShow'		: true,
		'overlayOpacity'	: .8,
		'autoScale'     	: true,
		'type'				: 'iframe',
		'width'				: 750,
		'height'			: 510
	});
	
	$(".delete_entry").click(function(e){
		if(!confirm('Are you sure you want to delete this entry?'))
		{
			e.preventDefault();
			return false;
		} else {
			return true;
		}
	});
	
	$("#form_ntma_entry #category").change(function(){
		if($(this).val() == "BEST ALBUM")
		{
			$("#form_ntma_entry #ntma_notice_album").show();
			$("#form_ntma_entry .mp3").hide();
		} else {
			$("#form_ntma_entry #ntma_notice_album").hide();
			$("#form_ntma_entry .mp3").show();
		}
		if($(this).val() == "BEST SONGWRITER")
		{
			$("#form_ntma_entry #ntma_notice_songwriter").show();
			$("#form_ntma_entry .doc").show();
		} else {
			$("#form_ntma_entry #ntma_notice_songwriter").hide();
			$("#form_ntma_entry .doc").hide();
		}
	});
	
	$("#form_ntma_entry #category").val($("#form_ntma_entry #category").attr("rel"));
	$("#form_ntma_checkout #state").val($("#form_ntma_checkout #state").attr("rel"));
	$("#form_ntma_checkout #cc_type").val($("#form_ntma_checkout #cc_type").attr("rel"));
	$("#form_ntma_checkout #cc_exp_month").val($("#form_ntma_checkout #cc_exp_month").attr("rel"));
	$("#form_ntma_checkout #cc_exp_year").val($("#form_ntma_checkout #cc_exp_year").attr("rel"));
	$(".print_me").click(function(e){
		window.print();
		e.preventDefault();
	});
	$('input#start_date_text').DatePicker({
		format:'m/d/Y',
		date: $('input#start_date_text').val(),
		current: $('input#start_date_text').val(),
		starts: 1,
		position: 'r',
		onChange: function(formated, dates){
			$('input#start_date_text').val(formated);
			$('input#start_date_text').DatePickerHide();
		}
	});
	$('input#end_date_text').DatePicker({
		format:'m/d/Y',
		date: $('input#end_date_text').val(),
		current: $('input#end_date_text').val(),
		starts: 1,
		position: 'r',
		onChange: function(formated, dates){
			$('input#end_date_text').val(formated);
			$('input#end_date_text').DatePickerHide();
		}
	});
});
