	function mmfProcessJson(data) {
		alert('running my method');
		mmfProcessJson(data); 
		$('#talkBack2').animate({ opacity: 1 }, 3000, function(){ $('#talkBack2').fadeOut(); });
	}
	
$(document).ready(function(){
	$('dl.dropdown').hover(
		function(){ $(this).find('dd').addClass('on'); },
		function(){ $(this).find('dd').removeClass('on'); }
	);
	
	$('input[type="text"], textarea').focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	$('#orderSome dl dd ul').hover(
		function(){$('#orderSome dl dd li').addClass('on');},
		function(){$('#orderSome dl dd li').removeClass('on');}
	);

	$('#whyGetOne li h3').click(function(){
		var clicked = $(this);
		$('#whyGetOne li.current p').slideUp('fast', function(){
			$('#whyGetOne li').removeClass('current');
			clicked.parent('li').addClass('current');
			clicked.siblings('p').slideDown('fast');			
		});
	});
	
	$('#whyGetOne li.current p').slideDown('medium');
	
	// Handle Card Balance Form
	$('#checkYrBalanceForm').submit(function() {
		$(this).ajaxSubmit({
			target:			'#balance',
			beforeSubmit:	reqFields
		}); 
		return false;
	});

	$('#balanceWrap a.button').click(function(){
		$('#balanceWrap').hide();
		$('#checkYrBalanceForm').reset();
		$('#checkBalance dl').show();
		return false;	
	});
	
	$('#burritotype').change(function(){
		var size = 0;
		if ($('#BurritoLarge').attr('checked')) { size = 2 };
			if ($('#BurritoRegular').attr('checked')) { size = 1 };
		buildNut(size);
	});
	
	$("select[name='smoothietype']").change(function(){
		var size = 2;
		if ($('#SmoothieLarge').attr('checked')) { size = 3 };
		if ($('#SmoothieRegular').attr('checked')) { size = 1 };
		if ($('#SmoothieMini').attr('checked')) { size = 2 };

		buildSmoothie(size);
	});

	$("select[name='othertype']").change(function(){
		var dressing = "WithDressing";
		if ($('#NoDressing').attr('checked')) { dressing = "NoDressing" };
		chgDressing(dressing);
	});
	
//	talkBack();

});

// function talkBack(){
// 	$('body:not(.promos, .talk-to-us) #talkBack2').removeClass('box1').addClass('callout');
// 	$('#talkBack2 a.close').hide();
// 	$('#talkBack1').click(function(){
// 		var pos = $('#talkBack1').position();
// 		$('#talkBack2')
// 			.css({
// 				'right' 	: pos.left - 614,
// 				'top'		: pos.top,
// 				'display'	: 'block'
// 			})
// 			.animate({
// 				width: '420px'
// 			}, 500, function(){ $('#talkBack2 a.close').show(); });		
// 		return false;
// 	});
// 	$('#talkBack2 a.close').click(function(){
// 		$('#talkBack2').css({
// 			'display'	: 'none',
// 			'width'		: '0'
// 		});
// 		$(this).hide();
// 		return false; 
// 	})
// }

function reqFields(){
	if ( ( $('#cardnum').val() > 99999999999 || $('cardnum').val() < 10000000000000000 ) || ( $('#regcode').val() > 99999 || $('regcode').val() < 1000000 ) ) {
		$('#balanceWrap').show();
		$('#checkBalance dl').hide();
		return true;
	} else {
		alert('Check your numbers!');
		return false;
	}
}

jQuery.fn.reset = function () {
  $(this).each (function() { this.reset(); });
}
