$(function() {    
    $("a#increase_size").click(function() {
        var currentFontSize = $('body').css('font-size').substr(0,$('body').css('font-size').length - 2);
        var currentFontSizeFloat = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeFloat * 1.1;
        if (newFontSize < 13)

        {
            $('body').css('font-size', newFontSize + 'px');
        }
        return false;
    });

    $("#decrease_size").click(function() {
        var currentFontSize = $('body').css('font-size').substr(0,$('body').css('font-size').length - 2);
        var currentFontSizeFloat = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeFloat * 0.9;
        if (newFontSize > 9)
        {
            $('body').css('font-size', newFontSize + 'px');
        }
        return false;
    });
    

	$("#add_another").click(function() {
		var form_fields = $("div.dude");
		
		form_fields.each(function(i){
			if ($(this).hasClass("hidden"))
			{
				$(this).show().removeClass("hidden");
				return false;
			}
		});
	});
});

function registerEmail()
{
	var email = $('#registrationemail').attr('value');
	$.post("http://justanumber.com/registeremail/", {"email": email}, displayEmailRegistration);
}

function displayEmailRegistration($message)
{
	$('#emailregtext').text($message);
}