(function($){
jQuery.fn.jConfirmAction = function (options) {
var theOptions = jQuery.extend ({
question: "Bạn có chắc không ?",
yesAnswer: "Xác nhận",
cancelAnswer: "Bỏ qua"
}, options);
return this.each (function () {
$(this).bind('click', function(e) {
e.preventDefault();
thisHref = $(this).attr('href');
if($(this).next('.question').length <= 0)
$(this).after('
'+theOptions.question+'
'+theOptions.yesAnswer+''+theOptions.cancelAnswer+'
');
$(this).next('.question').animate({opacity: 1}, 300);
$('.yes').bind('click', function(){
window.location = thisHref;
});
$('.cancel').bind('click', function(){
$(this).parents('.question').fadeOut(300, function() {
$(this).remove();
});
});
});
});
}
})(jQuery);
$(document).ready(function() {
$('#logout').jConfirmAction();
});