jQuery.feedback=function(){var E;var D={conIn:600,conOut:100,inAnim:10,outAnim:800,showInfoFor:6000,errorFlash:150};var B={inputErrorClass:"error",infoClass:"feedbackInfo",errorClass:"feedbackError"};
var C=true;var A=false;return{checkContainerState:function(F){if(F){jQuery(E).slideDown(D.conIn);A=true;}else{if(jQuery(E).size()<1){alert("Error: No feedback container");
return ;}C=jQuery(E).children().size()<1&&jQuery(E).html().length<1;if(C&&A){A=false;}if(!C&&!A){jQuery(E).slideDown(D.conIn);A=true;}}},addInfo:function(F){if(F==undefined||F.length<1){return ;
}var G=jQuery("<div></div>").attr("class",B.infoClass).html(F).fadeIn(D.inAnim,function(){$.feedback.checkContainerState();jQuery(this).animate({marginLeft:0},D.showInfoFor,function(){$.feedback.removeFeedback(this);
});});jQuery(E).append(G);},addError:function(J,G){if(J==undefined||J.length<1){return ;}var I=jQuery("<div></div>").attr("class",B.errorClass).html(J).fadeIn(D.inAnim,function(){$.feedback.checkContainerState();
});jQuery(E).append(I);if(G==undefined){return ;}if(G.indexOf(",")!=-1){var F=G.split(",");for(var H=0;H<F.length;H++){jQuery(':input[@name="'+F[H]+'"]').each(function(){$.feedback.markInput(this);
});}}else{jQuery(':input[@name="'+G+'"]').each(function(){$.feedback.markInput(this);});}jQuery(I).attr("belongsto",G);},removeFeedback:function(F){jQuery(F).slideUp(D.outAnim,function(){jQuery(this).empty().remove();
$.feedback.checkContainerState();});},markInput:function(F){jQuery(F).addClass(B.inputErrorClass);},unmarkInput:function(F){jQuery(F).removeClass(B.inputErrorClass);
},resetContainer:function(){var F=jQuery(E).children().filter(function(){return jQuery(this).attr("class")==B.infoClass;});var G=jQuery(E).children().filter(function(){return jQuery(this).attr("class")==B.errorClass;
});jQuery(F).each(function(){$.feedback.removeFeedback(this);});jQuery(G).each(function(){if(jQuery(this).attr("belongsto")!=undefined){var I=jQuery(this).attr("belongsto");
if(I.indexOf(",")!=-1){var H=I.split(",");for(var J=0;J<H.length;J++){$.feedback.unmarkInput(jQuery(':input[@name="'+H[J]+'"]'));}}else{$.feedback.unmarkInput(jQuery(':input[@name="'+I+'"]'));
}$.feedback.removeFeedback(this);}else{$.feedback.removeFeedback(this);}});},setCon:function(F){E=F;}};}();jQuery.fn.feedback=function(){$.feedback.setCon(this);
return this;};