window.addEvent('domready', add_events);

function add_events()
{
    if($('to_update') && $($('to_update').value))
        var c = $('to_update').value;
    else
        var c = 'mb_contents';
    var args = {
        'container': c,
        'callback': add_events
    };


    MOOdalBox.init();
    $('registration').addEvent('submit', ajax_submit.bindWithEvent($('registration'), args));

    $('registration').addEvent('reset', ajax_reset.bindWithEvent($('registration'), args));
    document.location.href='#top';
}

function changeProfessionalFormType(type){
	if(type != 'society'){
		$('society_form').style.display     = "none";
		$('independant_form').style.display = "block";
	}
	else{
		$('society_form').style.display     = "block";
		$('independant_form').style.display = "none";
	}
}
function changeVatFormType(type,value){
	if(value == '0'){
		$('vat_form_'+type).style.display = "none";
	}
	else{
		$('vat_form_'+type).style.display = "block";
	}
}

