$(function(){
	$('#cropbox').Jcrop({
		aspectRatio: 1,
		onSelect: updateCoords
	});
	
	function updateCoords(c)
	{
		$('#x').val(c.x);
		$('#y').val(c.y);
		$('#w').val(c.w);
		$('#h').val(c.h);
	};

	function checkCoords()
	{
		if (parseInt($('#w').val())) return true;
		alert('Please select a crop region then press submit.');
		return false;
	};
	
	$('#profile_phone').mask("(999) 999-9999");
	$('#profile_website').focus(function(){
		if ($(this).val() == '')
			$(this).val('http://');
	});
	$('#profile_first_name, #profile_last_name, #profile_gradclass').parent().addClass('required');

	$('table tr:odd').addClass("alt");
	$('.hidden').hide();
	$('#pw-link').click(function() {
		$('#password-change').slideToggle('slow');
	});
	
	$('#year_gradclass').change(function(){
		$(this).parent().parent().parent().submit();
	});
});

