/**
 * dom load on startup run
 */
jQuery(function($) {
		
	// Make each div as tall as the tallest div
	var maxHeight = 0;
		
	$(".signin-form").each(function() {
		if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
	}).height(maxHeight);

	$(".switch").click(function() {
				
		$("#signin-form, #openid-form, #forgot-password-form").hide();
		var clicked = $(this).attr('href')+'-form';
		$(clicked).show();		
	});
	
	$("#email").keyup(function() {
		var username = $(this).val().split('@')[0];
		if (username)
			$("#new_username").val(username);
	});
	
	if ($("#email").val() && !$("#new_username").val())
		$("#email").keyup(); // trigger keyup event for auto suggestion of new username
});
