function handlePasswordError(json) {
  if(json) {
  	setError('error_for_password_username', json.username);
  	setError('error_for_email', json.email);
	}
}

function handleProfileError(json) {
	var str = '';
	try{
	  for (i in json) {
			str += json[i]+'<br/>';
	  }
		setError('error_for_profile_form', str);	  
	}catch(ee){}
}

function setError(el, msg) {
	if(msg) {
  	Element.update(el, msg);
    Effect.BlindDown(el, {duration:0.3});
	} else {
		Effect.BlindUp(el, {duration:0.3});
	}
}


