$.fn.cakeDebug = function () {
	$(document).ready(function() {
		var _cakeLog = $(".cake-sql-log");
		_cakeLog.hide();
		_cakeLog.css({position:'fixed',top:'10px',right:'10px',backgroundColor:'red',zIndex:99999});
		$('body').append("<div id='cakeDebugControl'>On</div>");
		var _controller = $('#cakeDebugControl');
		_controller.css({position:'fixed',bottom:'2px',right:'2px',backgroundColor:'green',fontWeight:'bold',padding:'1px 0px',color:'white',width:'20px',textAlign:'center',cursor:'pointer',fontSize:'9px'}).click(function() {
			var _controller = $(this)
			if (_controller.text() == 'On') {
				_cakeLog.show();
				_controller.css({backgroundColor:'red'}).text('Off');
			} else {
				_cakeLog.hide();
				_controller.css({backgroundColor:'green'}).text('On');			 
			}
		})
	});
};

//
$().cakeDebug();