
(function($){


/*
* jQuery Plugin : jConfirmAction
* 
* by Hidayat Sagita
* http://www.webstuffshare.com
* Licensed Under GPL version 2 license.
*
*/
jQuery.fn.jConfirmAction = function (options) {
	
	// Some jConfirmAction options (limited to customize language) :
	// question : a text for your question.
	// yesAnswer : a text for Yes answer.
	// cancelAnswer : a text for Cancel/No answer.
	var theOptions = jQuery.extend ({
		question: "Are You Sure ?",
		yesAnswer: "Yes",
		cancelAnswer: "Cancel"
	}, options);
	
	return this.each (function () {
		
		$(this).bind('click', function(e) {

			e.preventDefault();
			thisHref	= $(this).attr('href');
			
			if($(this).next('.question').length <= 0)
				$(this).after('<div class="question">'+theOptions.question+'<br/> <span class="yes">'+theOptions.yesAnswer+'</span><span class="cancel">'+theOptions.cancelAnswer+'</span></div>');
			
			$(this).next('.question').animate({opacity: 1}, 300);
			
			$('.yes').bind('click', function() {
				
				$.post(thisHref, function(result) {
					if (result) {
						$arr_str = thisHref.split('/');
						$('#del'+$arr_str[5]).remove();
					}
				});

			});
	
			$('.cancel').bind('click', function(){
				$(this).parents('.question').fadeOut(300, function() {
					$(this).remove();
				});
			});
			
		});
		
	});
}


})(this.jQuery);




window.log = function(){
  log.history = log.history || [];   
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



