Profil = {
	_form : "profil_form",
	_error_div: "profil_control",
	
	markField: function(bool){
		var field = "andet_text";
		var disable = (bool)? "" : "disabled";
		document.getElementById(field).disabled=disable;
		if(disable == "")
			document.getElementById(field).focus();
	},
	
	setLinkPassword: function(){
		var check = document.getElementById("profil_password").checked;
		document.getElementById("profil_password").checked = !check;		
		this.setPassword();
	},
	
	setPassword: function(){
		var check = document.getElementById("profil_password").checked;
		var disable = (check)? "":"disabled";
		document.getElementById("profil_pass0").disabled = disable;
		document.getElementById("profil_pass1").disabled = disable;
	},
	
	submit: function(){
		var form = document.getElementById(this._form);
		document.getElementById(this._error_div).innerHTML = "Tilføjer...";
		var funk = function(){
			if(document.getElementById("profil_control_loaded"))
				location.reload();
		}
		YAHOO.util.Connect.asyncPostRequest('ajax/profil_control.php?ajax=true',this._error_div,'',form,funk);
	}
	
}