/**
 * @author David Buttar
 * 
 * Places an area on the page that can display useful state information
 * 
 *
 */

(function(){
       
      var debug = function(opts, c){

         var that = {};
         opts = opts || {};
         if(opts.on){
            $('body').append('<div class="cb-debug"><h2 class="cb-debug-head">CB Debug</h2></div>');
         }
         
         that.log = function(label, message,value){
            if(opts.on){    
               $label = $(".cb-debug-"+label);
               if($label.length){
                  $label.html('<span>'+message+': </span>'+value);
               }else{
                  $('.cb-debug').append('<div class="cb-debug-label cb-debug-'+label+'"><span>'+message+': </span>'+value+'</div>');
               }
            }
         }

         return that;
      };
       

       
       cb.debug = debug;
       
})();

