(function(c) {
  c.fn.Qnotify = function(e) {
    
	var a = c.extend({
      text: "",
      speed: 500,
      close: 5E3,
      width: 300,
      sound: "",
      color: ""
    }, e);
	
	var collborder;
	var collFon;
	var coll;
	
	if("green" == a.color) { 
	  collborder = 'C3E6CB'; 
	  coll = '155724'; 
	  collFon = 'D4EDDA';  
	} else { 
	  collborder = 'EDDFC4';  
	  coll = 'C09853'; 
	  collFon = 'FCF8E3'; 
	}
	
    c(this).append('<div class="qnotify"><div class="qnotify_title"></div><!--audio autoplay="" class="qplay"></audio-->                                                                                                        <div style=""><div class="fa fa-cogs push-fix" style="font-size: 30px;" aria-hidden="true"></div></div><div class="qnotify_text"></div></div>');
    var b = c(".qnotify"),
      d;
    1 < b.length && c(".qnotify:first").remove();
    b.css({
      position: "fixed",
      "cursor": "help",
      display: "",
      background: "#"+collFon,
      color: "#"+coll,
      "margin-top": "75px",
      "font-family": "Tahoma",
      "z-index": "0",
      right: "17px",
      top: "-0px",
      height: "auto",
      display: "inline-block",
      "border-radius": "3px",
	  /*"-moz-box-shadow": "0 0 3px rgba(0,0,0,0.1)",
      "-webkit-box-shadow": "0 0 3px rgba(0,0,0,0.1)",
      "-khtml-box-shadow": "0 0 3px rgba(0,0,0,0.1)",
      "box-shadow": "0 0 3px rgba(0,0,0,0.1)",*/
      border: "1px solid #"+collborder
    });
    c(".qnotify_title").css({});
    "error" == a.sound && (d = '<source src="theme/sound/error.wav" >');
    c(".qplay").append(d);
    c(".qnotify_title").html(a.title);
    "" == a.width ? b.css({
      width: "auto"
    }) : b.css({
      width: a.width + "px"
    });
    c(".qnotify_text").html(a.text).css({
      padding: "10px",
	  "margin-left": "47px"
    });
    b.fadeIn(a.speed, function() {
      b.animate({
        
      }, a.speed);
      b.show()
    });
    setTimeout(function() {
      b.animate({
        top: -b.height() - 77
      }, a.speed)
    }, a.close);
    setTimeout(function() {
      b.remove()
    }, a.close + 1E3)
  }
})(jQuery);
