Added 'status' option to message box
authorThierry Florac <thierry.florac@onf.fr>
Fri, 29 Sep 2017 12:07:52 +0200
changeset 216 d3a67e8ba493
parent 215 d3c31bd96780
child 217 bfce7cdbf2c4
Added 'status' option to message box
src/pyams_skin/resources/js/myams-notify.js
src/pyams_skin/resources/js/myams-notify.min.js
--- a/src/pyams_skin/resources/js/myams-notify.js	Fri Sep 29 12:07:24 2017 +0200
+++ b/src/pyams_skin/resources/js/myams-notify.js	Fri Sep 29 12:07:52 2017 +0200
@@ -45,6 +45,7 @@
 			var defaults = {
 				title: "",
 				content: "",
+				status: "",
 				NormalButton: undefined,
 				ActiveButton: undefined,
 				buttons: undefined,
@@ -83,6 +84,7 @@
 			var HasInput = 0;
 			var Name = "";
 			var NumButtons = 0;
+			var btnClass;
 			if (settings.input !== undefined) {
 				HasInput = 1;
 				settings.input = settings.input.toLowerCase();
@@ -122,7 +124,7 @@
 						}
 				}
 			}
-			Content = "<div class='MessageBoxContainer animated fadeIn fast' id='Msg" + SmartMSGboxCount + "'>";
+			Content = "<div class='MessageBoxContainer " + settings.status + " animated fadeIn fast' id='Msg" + SmartMSGboxCount + "'>";
 			Content += "<div class='MessageBoxMiddle'>";
 			Content += "<span class='MsgTitle'>" + settings.title + "</span class='MsgTitle'>";
 			Content += "<p class='pText'>" + settings.content + "</p>";
@@ -145,7 +147,12 @@
 				} else {
 					if (settings.buttons[i] === "]") {
 						NumButtons = NumButtons + 1;
-						Name = "<button id='bot" + NumButtons + "-Msg" + SmartMSGboxCount + "' class='btn btn-default btn-sm botTempo'> " + Name + "</button>";
+						if (NumButtons === 1) {
+							btnClass = 'btn-primary';
+						} else {
+							btnClass = 'btn-default';
+						}
+						Name = "<button id='bot" + NumButtons + "-Msg" + SmartMSGboxCount + "' class='btn " + btnClass + " btn-sm botTempo'> " + Name + "</button>";
 						Content += Name;
 					} else {
 						Name += settings.buttons[i];
--- a/src/pyams_skin/resources/js/myams-notify.min.js	Fri Sep 29 12:07:24 2017 +0200
+++ b/src/pyams_skin/resources/js/myams-notify.min.js	Fri Sep 29 12:07:52 2017 +0200
@@ -1,1 +1,1 @@
-(function(c,d){c(document).ready(function(){c("body").append("<div id='divSmallBoxes'></div>").append("<div id='divMiniIcons'></div>").append("<div id='divBigBoxes'></div>")});function f(){c(".divMessageBox").fadeOut(300,function(){c(this).remove()});c(".LoadingBoxContainer").fadeOut(300,function(){c(this).remove()})}var a=0,b=0,h,j=0,g=0,i=0;var e=d.MyAMS;e.notify={messageBox:function(w,v){var s,n,l=e.browser.isIE8orlower();var o={title:"",content:"",NormalButton:undefined,ActiveButton:undefined,buttons:undefined,input:undefined,placeholder:"",options:undefined,sound:undefined};var m=c.extend({},o,w);if(m.sound&&(l===0)){var u=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){u.setAttribute("src",e.baseURL+"../sound/message.ogg")}else{u.setAttribute("src",e.baseURL+"../sound/message.mp3")}c.get();u.addEventListener("load",function(){u.play()},true);u.pause();u.play()}b=b+1;if(a===0){a=1;s="<div class='MessageBox animated fadeIn fast' id='MsgBoxBack'></div>";c("body").append(s);if(e.browser.isIE8orlower()===1){c("#MsgBoxBack").addClass("MessageIE")}}var r;var p="";var t=0;var q="";var k=0;if(m.input!==undefined){t=1;m.input=m.input.toLowerCase();switch(m.input){case"text":p="<input class='form-control' type='"+m.input+"' id='txt"+b+"' placeholder='"+m.placeholder+"'/><br/><br/>";break;case"password":p="<input class='form-control' type='"+m.input+"' id='txt"+b+"' placeholder='"+m.placeholder+"'/><br/><br/>";break;case"select":if(m.options===undefined){if(d.alert){d.alert("For this type of input, the options parameter is required.")}}else{p="<select class='form-control' id='txt"+b+"'>";for(r=0;r<=m.options.length-1;r++){if(m.options[r]==="["){q=""}else{if(m.options[r]==="]"){k=k+1;q="<option>"+q+"</option>";p+=q}else{q+=m.options[r]}}}p+="</select>"}break;default:if(d.alert){d.alert("That type of input is not handled yet")}}}n="<div class='MessageBoxContainer animated fadeIn fast' id='Msg"+b+"'>";n+="<div class='MessageBoxMiddle'>";n+="<span class='MsgTitle'>"+m.title+"</span class='MsgTitle'>";n+="<p class='pText'>"+m.content+"</p>";n+=p;n+="<div class='MessageBoxButtonSection'>";if(m.buttons===undefined){m.buttons="[Accept]"}m.buttons=c.trim(m.buttons);m.buttons=m.buttons.split("");if(m.NormalButton===undefined){m.NormalButton="#232323"}if(m.ActiveButton===undefined){m.ActiveButton="#ed145b"}for(r=0;r<=m.buttons.length-1;r++){if(m.buttons[r]==="["){q=""}else{if(m.buttons[r]==="]"){k=k+1;q="<button id='bot"+k+"-Msg"+b+"' class='btn btn-default btn-sm botTempo'> "+q+"</button>";n+=q}else{q+=m.buttons[r]}}}n+="</div>";n+="</div>";n+="</div>";if(b>1){c(".MessageBoxContainer").hide();c(".MessageBoxContainer").css("z-index",99999)}c(".MessageBox").append(n);if(t===1){c("#txt"+b).focus()}c(".botTempo").hover(function(){var x=c(this).attr("id")},function(){var x=c(this).attr("id")});c(".botTempo").click(function(){var B=c(this).attr("id");var A=B.substr(B.indexOf("-")+1);var y=c.trim(c(this).text());if(t===1){if(typeof v==="function"){var z=A.replace("Msg","");var x=c("#txt"+z).val();if(v){v(y,x)}}}else{if(typeof v==="function"){if(v){v(y)}}}c("#"+A).addClass("animated fadeOut fast");b=b-1;if(b===0){c("#MsgBoxBack").removeClass("fadeIn").addClass("fadeOut").delay(300).queue(function(){a=0;c(this).remove()})}})},bigBox:function(k,r){var n,o;k=c.extend({title:"",content:"",icon:undefined,number:undefined,color:undefined,sound:true,timeout:undefined,colortime:1500,colors:undefined},k);if(k.sound===true){if(e.browser.isIE8orlower()===0){var q=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){q.setAttribute("src",e.baseURL+"../snd/bigbox.ogg")}else{q.setAttribute("src",e.baseURL+"../snd/bigbox.mp3")}c.get();q.addEventListener("load",function(){q.play()},true);q.pause();q.play()}}j=j+1;n="<div id='bigBox"+j+"' class='BigBox animated fadeIn fast'><div id='bigBoxColor"+j+"'><i class='btnClose fa fa-times' id='btnClose"+j+"'></i>";if(k.icon===undefined){k.icon="fa fa-cloud"}n+="<span><i class='"+k.icon+"'></i>&nbsp; "+k.title+"</span>";n+="<p>"+k.content+"</p>";n+="<div class='bigboxnumber'>";if(k.number!==undefined){n+=k.number}n+="</div></div>";n+="</div>";c("#divBigBoxes").append(n);if(k.color===undefined){k.color="#004d60"}c("#bigBox"+j).css("background-color",k.color);c("#divMiniIcons").append("<div id='miniIcon"+j+"' class='cajita animated fadeIn' style='background-color: "+k.color+";'><i class='"+k.icon+"'/></i></div>");c("#miniIcon"+j).bind("click",function(){var w=c(this).attr("id");var v=w.replace("miniIcon","bigBox");var u=w.replace("miniIcon","bigBoxColor");c(".cajita").each(function(y){var x=c(this).attr("id");var z=x.replace("miniIcon","bigBox");c("#"+z).css("z-index",9998)});c("#"+v).css("z-index",9999);c("#"+u).removeClass("animated fadeIn").delay(1).queue(function(){c(this).show();c(this).addClass("animated fadeIn");c(this).clearQueue()})});var l=c("#btnClose"+j);var p=c("#bigBox"+j);var t=c("#miniIcon"+j);var s;if(k.colors!==undefined&&k.colors.length>0){l.attr("colorcount","0");s=setInterval(function(){var u=l.attr("colorcount");l.animate({backgroundColor:k.colors[u].color});p.animate({backgroundColor:k.colors[u].color});t.animate({backgroundColor:k.colors[u].color});if(u<k.colors.length-1){l.attr("colorcount",((u*1)+1))}else{l.attr("colorcount",0)}},k.colortime)}l.bind("click",function(){clearInterval(s);if(typeof r==="function"){if(r){r()}}var v=c(this).attr("id");var u=v.replace("btnClose","bigBox");var w=v.replace("btnClose","miniIcon");c("#"+u).removeClass("fadeIn fast");c("#"+u).addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()});c("#"+w).removeClass("fadeIn fast");c("#"+w).addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()})});if(k.timeout!==undefined){var m=j;setTimeout(function(){clearInterval(s);var v=c("#bigBox"+m);v.removeClass("fadeIn fast");v.addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()});var u=c("#miniIcon"+m);u.removeClass("fadeIn fast");u.addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()})},k.timeout)}},smallBox:function(l,r){var n,o;l=c.extend({title:"",content:"",icon:undefined,iconSmall:undefined,sound:true,color:undefined,timeout:undefined,colortime:1500,colors:undefined},l);if(l.sound===true){if(e.browser.isIE8orlower()===0){var p=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){p.setAttribute("src",e.baseURL+"../snd/smallbox.ogg")}else{p.setAttribute("src",e.baseURL+"../snd/smallbox.mp3")}c.get();p.addEventListener("load",function(){p.play()},true);p.pause();p.play()}}g=g+1;n="";var m="",k="smallbox"+g;if(l.iconSmall===undefined){m="<div class='miniIcon'></div>"}else{m="<div class='miniIcon'><i class='miniPic "+l.iconSmall+"'></i></div>"}if(l.icon===undefined){n="<div id='smallbox"+g+"' class='SmallBox animated fadeInRight fast'><div class='textoFull'><span>"+l.title+"</span><p>"+l.content+"</p></div>"+m+"</div>"}else{n="<div id='smallbox"+g+"' class='SmallBox animated fadeInRight fast'><div class='foto'><i class='"+l.icon+"'></i></div><div class='textoFoto'><span>"+l.title+"</span><p>"+l.content+"</p></div>"+m+"</div>"}if(g===1){c("#divSmallBoxes").append(n);i=c("#smallbox"+g).height()+40}else{var q=c(".SmallBox").size();if(q===0){c("#divSmallBoxes").append(n);i=c("#smallbox"+g).height()+40}else{c("#divSmallBoxes").append(n);c("#smallbox"+g).css("top",i);i=i+c("#smallbox"+g).height()+20;c(".SmallBox").each(function(u){if(u===0){c(this).css("top",20);h=c(this).height()+40;i=c(this).height()+40}else{c(this).css("top",h);h=h+c(this).height()+20;i=i+c(this).height()+20}})}}var t=c("#smallbox"+g);if(l.color===undefined){t.css("background-color","#004d60")}else{t.css("background-color",l.color)}var s;if(l.colors!==undefined&&l.colors.length>0){t.attr("colorcount","0");s=setInterval(function(){var u=t.attr("colorcount");t.animate({backgroundColor:l.colors[u].color});if(u<l.colors.length-1){t.attr("colorcount",((u*1)+1))}else{t.attr("colorcount",0)}},l.colortime)}if(l.timeout!==undefined){setTimeout(function(){clearInterval(s);var v=c(this).height()+20;var u=k;var w=c("#"+k).css("top");if(c("#"+k+":hover").length!==0){c("#"+k).on("mouseleave",function(){i=i-v;c("#"+k).remove();if(typeof r==="function"){if(r){r()}}var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x},350);x=x+c(this).height()+20;i=i+c(this).height()+20}})})}else{clearInterval(s);i=i-v;if(typeof r==="function"){if(r){r()}}c("#"+k).removeClass().addClass("SmallBox").animate({opacity:0},300,function(){c(this).remove();var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x});x=x+c(this).height()+20;i=i+c(this).height()+20}})})}},l.timeout)}c("#smallbox"+g).bind("click",function(){clearInterval(s);if(typeof r==="function"){if(r){r()}}var v=c(this).height()+20;var u=c(this).attr("id");var w=c(this).css("top");i=i-v;c(this).removeClass().addClass("SmallBox").animate({opacity:0},300,function(){c(this).remove();var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x},350);x=x+c(this).height()+20;i=i+c(this).height()+20}})})})}}})(jQuery,this);
\ No newline at end of file
+(function(c,d){c(document).ready(function(){c("body").append("<div id='divSmallBoxes'></div>").append("<div id='divMiniIcons'></div>").append("<div id='divBigBoxes'></div>")});function f(){c(".divMessageBox").fadeOut(300,function(){c(this).remove()});c(".LoadingBoxContainer").fadeOut(300,function(){c(this).remove()})}var a=0,b=0,h,j=0,g=0,i=0;var e=d.MyAMS;e.notify={messageBox:function(x,w){var t,o,m=e.browser.isIE8orlower();var p={title:"",content:"",status:"",NormalButton:undefined,ActiveButton:undefined,buttons:undefined,input:undefined,placeholder:"",options:undefined,sound:undefined};var n=c.extend({},p,x);if(n.sound&&(m===0)){var v=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){v.setAttribute("src",e.baseURL+"../sound/message.ogg")}else{v.setAttribute("src",e.baseURL+"../sound/message.mp3")}c.get();v.addEventListener("load",function(){v.play()},true);v.pause();v.play()}b=b+1;if(a===0){a=1;t="<div class='MessageBox animated fadeIn fast' id='MsgBoxBack'></div>";c("body").append(t);if(e.browser.isIE8orlower()===1){c("#MsgBoxBack").addClass("MessageIE")}}var s;var q="";var u=0;var r="";var l=0;var k;if(n.input!==undefined){u=1;n.input=n.input.toLowerCase();switch(n.input){case"text":q="<input class='form-control' type='"+n.input+"' id='txt"+b+"' placeholder='"+n.placeholder+"'/><br/><br/>";break;case"password":q="<input class='form-control' type='"+n.input+"' id='txt"+b+"' placeholder='"+n.placeholder+"'/><br/><br/>";break;case"select":if(n.options===undefined){if(d.alert){d.alert("For this type of input, the options parameter is required.")}}else{q="<select class='form-control' id='txt"+b+"'>";for(s=0;s<=n.options.length-1;s++){if(n.options[s]==="["){r=""}else{if(n.options[s]==="]"){l=l+1;r="<option>"+r+"</option>";q+=r}else{r+=n.options[s]}}}q+="</select>"}break;default:if(d.alert){d.alert("That type of input is not handled yet")}}}o="<div class='MessageBoxContainer "+n.status+" animated fadeIn fast' id='Msg"+b+"'>";o+="<div class='MessageBoxMiddle'>";o+="<span class='MsgTitle'>"+n.title+"</span class='MsgTitle'>";o+="<p class='pText'>"+n.content+"</p>";o+=q;o+="<div class='MessageBoxButtonSection'>";if(n.buttons===undefined){n.buttons="[Accept]"}n.buttons=c.trim(n.buttons);n.buttons=n.buttons.split("");if(n.NormalButton===undefined){n.NormalButton="#232323"}if(n.ActiveButton===undefined){n.ActiveButton="#ed145b"}for(s=0;s<=n.buttons.length-1;s++){if(n.buttons[s]==="["){r=""}else{if(n.buttons[s]==="]"){l=l+1;if(l===1){k="btn-primary"}else{k="btn-default"}r="<button id='bot"+l+"-Msg"+b+"' class='btn "+k+" btn-sm botTempo'> "+r+"</button>";o+=r}else{r+=n.buttons[s]}}}o+="</div>";o+="</div>";o+="</div>";if(b>1){c(".MessageBoxContainer").hide();c(".MessageBoxContainer").css("z-index",99999)}c(".MessageBox").append(o);if(u===1){c("#txt"+b).focus()}c(".botTempo").hover(function(){var y=c(this).attr("id")},function(){var y=c(this).attr("id")});c(".botTempo").click(function(){var C=c(this).attr("id");var B=C.substr(C.indexOf("-")+1);var z=c.trim(c(this).text());if(u===1){if(typeof w==="function"){var A=B.replace("Msg","");var y=c("#txt"+A).val();if(w){w(z,y)}}}else{if(typeof w==="function"){if(w){w(z)}}}c("#"+B).addClass("animated fadeOut fast");b=b-1;if(b===0){c("#MsgBoxBack").removeClass("fadeIn").addClass("fadeOut").delay(300).queue(function(){a=0;c(this).remove()})}})},bigBox:function(k,r){var n,o;k=c.extend({title:"",content:"",icon:undefined,number:undefined,color:undefined,sound:true,timeout:undefined,colortime:1500,colors:undefined},k);if(k.sound===true){if(e.browser.isIE8orlower()===0){var q=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){q.setAttribute("src",e.baseURL+"../snd/bigbox.ogg")}else{q.setAttribute("src",e.baseURL+"../snd/bigbox.mp3")}c.get();q.addEventListener("load",function(){q.play()},true);q.pause();q.play()}}j=j+1;n="<div id='bigBox"+j+"' class='BigBox animated fadeIn fast'><div id='bigBoxColor"+j+"'><i class='btnClose fa fa-times' id='btnClose"+j+"'></i>";if(k.icon===undefined){k.icon="fa fa-cloud"}n+="<span><i class='"+k.icon+"'></i>&nbsp; "+k.title+"</span>";n+="<p>"+k.content+"</p>";n+="<div class='bigboxnumber'>";if(k.number!==undefined){n+=k.number}n+="</div></div>";n+="</div>";c("#divBigBoxes").append(n);if(k.color===undefined){k.color="#004d60"}c("#bigBox"+j).css("background-color",k.color);c("#divMiniIcons").append("<div id='miniIcon"+j+"' class='cajita animated fadeIn' style='background-color: "+k.color+";'><i class='"+k.icon+"'/></i></div>");c("#miniIcon"+j).bind("click",function(){var w=c(this).attr("id");var v=w.replace("miniIcon","bigBox");var u=w.replace("miniIcon","bigBoxColor");c(".cajita").each(function(y){var x=c(this).attr("id");var z=x.replace("miniIcon","bigBox");c("#"+z).css("z-index",9998)});c("#"+v).css("z-index",9999);c("#"+u).removeClass("animated fadeIn").delay(1).queue(function(){c(this).show();c(this).addClass("animated fadeIn");c(this).clearQueue()})});var l=c("#btnClose"+j);var p=c("#bigBox"+j);var t=c("#miniIcon"+j);var s;if(k.colors!==undefined&&k.colors.length>0){l.attr("colorcount","0");s=setInterval(function(){var u=l.attr("colorcount");l.animate({backgroundColor:k.colors[u].color});p.animate({backgroundColor:k.colors[u].color});t.animate({backgroundColor:k.colors[u].color});if(u<k.colors.length-1){l.attr("colorcount",((u*1)+1))}else{l.attr("colorcount",0)}},k.colortime)}l.bind("click",function(){clearInterval(s);if(typeof r==="function"){if(r){r()}}var v=c(this).attr("id");var u=v.replace("btnClose","bigBox");var w=v.replace("btnClose","miniIcon");c("#"+u).removeClass("fadeIn fast");c("#"+u).addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()});c("#"+w).removeClass("fadeIn fast");c("#"+w).addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()})});if(k.timeout!==undefined){var m=j;setTimeout(function(){clearInterval(s);var v=c("#bigBox"+m);v.removeClass("fadeIn fast");v.addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()});var u=c("#miniIcon"+m);u.removeClass("fadeIn fast");u.addClass("fadeOut fast").delay(300).queue(function(){c(this).clearQueue();c(this).remove()})},k.timeout)}},smallBox:function(l,r){var n,o;l=c.extend({title:"",content:"",icon:undefined,iconSmall:undefined,sound:true,color:undefined,timeout:undefined,colortime:1500,colors:undefined},l);if(l.sound===true){if(e.browser.isIE8orlower()===0){var p=document.createElement("audio");if(navigator.userAgent.match("Firefox/")){p.setAttribute("src",e.baseURL+"../snd/smallbox.ogg")}else{p.setAttribute("src",e.baseURL+"../snd/smallbox.mp3")}c.get();p.addEventListener("load",function(){p.play()},true);p.pause();p.play()}}g=g+1;n="";var m="",k="smallbox"+g;if(l.iconSmall===undefined){m="<div class='miniIcon'></div>"}else{m="<div class='miniIcon'><i class='miniPic "+l.iconSmall+"'></i></div>"}if(l.icon===undefined){n="<div id='smallbox"+g+"' class='SmallBox animated fadeInRight fast'><div class='textoFull'><span>"+l.title+"</span><p>"+l.content+"</p></div>"+m+"</div>"}else{n="<div id='smallbox"+g+"' class='SmallBox animated fadeInRight fast'><div class='foto'><i class='"+l.icon+"'></i></div><div class='textoFoto'><span>"+l.title+"</span><p>"+l.content+"</p></div>"+m+"</div>"}if(g===1){c("#divSmallBoxes").append(n);i=c("#smallbox"+g).height()+40}else{var q=c(".SmallBox").size();if(q===0){c("#divSmallBoxes").append(n);i=c("#smallbox"+g).height()+40}else{c("#divSmallBoxes").append(n);c("#smallbox"+g).css("top",i);i=i+c("#smallbox"+g).height()+20;c(".SmallBox").each(function(u){if(u===0){c(this).css("top",20);h=c(this).height()+40;i=c(this).height()+40}else{c(this).css("top",h);h=h+c(this).height()+20;i=i+c(this).height()+20}})}}var t=c("#smallbox"+g);if(l.color===undefined){t.css("background-color","#004d60")}else{t.css("background-color",l.color)}var s;if(l.colors!==undefined&&l.colors.length>0){t.attr("colorcount","0");s=setInterval(function(){var u=t.attr("colorcount");t.animate({backgroundColor:l.colors[u].color});if(u<l.colors.length-1){t.attr("colorcount",((u*1)+1))}else{t.attr("colorcount",0)}},l.colortime)}if(l.timeout!==undefined){setTimeout(function(){clearInterval(s);var v=c(this).height()+20;var u=k;var w=c("#"+k).css("top");if(c("#"+k+":hover").length!==0){c("#"+k).on("mouseleave",function(){i=i-v;c("#"+k).remove();if(typeof r==="function"){if(r){r()}}var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x},350);x=x+c(this).height()+20;i=i+c(this).height()+20}})})}else{clearInterval(s);i=i-v;if(typeof r==="function"){if(r){r()}}c("#"+k).removeClass().addClass("SmallBox").animate({opacity:0},300,function(){c(this).remove();var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x});x=x+c(this).height()+20;i=i+c(this).height()+20}})})}},l.timeout)}c("#smallbox"+g).bind("click",function(){clearInterval(s);if(typeof r==="function"){if(r){r()}}var v=c(this).height()+20;var u=c(this).attr("id");var w=c(this).css("top");i=i-v;c(this).removeClass().addClass("SmallBox").animate({opacity:0},300,function(){c(this).remove();var y=1;var x=0;c(".SmallBox").each(function(z){if(z===0){c(this).animate({top:20},300);x=c(this).height()+40;i=c(this).height()+40}else{c(this).animate({top:x},350);x=x+c(this).height()+20;i=i+c(this).height()+20}})})})}}})(jQuery,this);
\ No newline at end of file