$(document).ready(function() {
	
	if ($('#sendRegistrationForm').length > 0)
	{
		$('#sendRegistrationForm').attr("disabled", true);
		sendAble();
		$('#registrationRules').change(function(){
			sendAble();
		});
	}
	
});

function sendAble()
{
	if ($('#sendOkeyText').length > 0)
	{
		$('#sendOkeyText').remove();
	}
	if ($('#registrationRules').is(":checked"))
	{
		$('#sendRegistrationForm').attr("disabled", false);
	}
	else
	{
		$('#sendRegistrationFormParagraf').append("<span id=\"sendOkeyText\" class=\"required\">Du måste fylla i alla obligatoriskt fält!</span>");
		$('#sendRegistrationForm').attr("disabled", true);
	}
}