function init(){
	// Setup all element functions on the form
	$('#id_type').change(function(){
		s_h_agent();
	});
	$('#id_company_profile').parent().after('<li><label>&nbsp;</label><strong><span id="id_text_counter" style="font-weight:bold">250</span> / 250</strong> characters remaining</li>')
	$('#id_company_profile').keypress(function(){
		limit_text('#id_text_counter', '#id_company_profile', 250);
	});
	$('#id_company_profile').blur(function(){
		limit_text('#id_text_counter', '#id_company_profile', 250);
	});
	
	var liHtml = $('#id_predefined_logo').parent().html()
	$('#id_predefined_logo').parent().html(liHtml + '&nbsp; &nbsp; <span><a href="#1" onclick="toggle_logo(\'addnew\')">Add a new logo</a></span>')
	liHtml = $('#id_predefined_logo').parent().html()
	
	// Form validation
    $("#id_propster_form").validate({
		rules: {
			status:"required",
			type:"required",
			first_name:"required",
			last_name:"required",
			cell_number:{
				required:true,
				number:true
			},
			email:{
				required:true,
				email:true
			},
			confirm_email: {
				equalTo: "#id_email"
			},
			password:"required",
			region:"required",
			agency_name:{
				required:function(element){
					return $("#id_type").val() == "Estate Agent";
				}
			},
			capture_type:"required"
		},
		messages: {
			email:{
				required: "This field is required.",
				email: "Enter a valid e-mail address."
			},
			cell_number:{
				required: "This field is required.",
				number: "Enter a valid number."
			},
			vat_number:{
				required: "This field is required.",
				number: "Enter a valid number."
			}
        }
    });
	
	// Initialize required functions
	limit_text('#id_text_counter', '#id_company_profile', 250)
	alternateRows()
	set_required_fields(new Array('id_status', 'id_type', 'id_first_name', 'id_last_name', 'id_cell_number', 'id_email', 'id_confirm_email', 'id_password', 'id_region', 'id_agency_name', 'id_capture_type', 'id_country'))
}