var ui = {
 msg:{
  types:["info","warn","error"],
  show:function(message,type){
   $("body").append("<div id=ui-msg class="+ui.msg.types[type]+">"+message+"</div>").find("#ui-msg")
    .fadeIn(600).delay(5000).fadeOut(600,function(){$(this).remove();});
  },
  confirm:function(message,func){
   $("body").append("<div id=ui-msg class="+ui.msg.types[1]+">"+message
    +"<div class='buttons'><button type='yes'>Да</button><button type='cancel'>Отмена</button></div></div>")
    .find("#ui-msg").fadeIn(600)
    .find("button[type='yes']").click(func).parent()
    .find("button[type='cancel']").click(function(){
     $("#ui-msg").fadeOut(600,function(){$(this).remove();});
    });
  },
  info:function(message){ui.msg.show(message,0);},
  warn:function(message){ui.msg.show(message,1);},
  error:function(message){ui.msg.show(message,2);},
 }
};
