jQuery.log = function(message) {
   if(window.console) {
       console.debug(message);
   } else {
      //alert(message);
    //document.write(message);
   }
};
	(function($){
	 var startDate;
	 var endDate;
	 var count={};
	 $.startTimer=function(){
	  startDate=new Date();
	 };
	 $.logTime=function(){
	  endDate=new Date();
	  $.log(endDate-startDate);
	 };
	 $.getTime=function(){
	  endDate=new Date();
	  return endDate-startDate;
	 };
	 $.addCount = function(to, nr, node){if (!count[to]) count[to]=0; count[to]=count[to]+nr;$.log(nr);$.log(node);};
	 $.logCount = function(){$.log(count);};
	})(jQuery);

var MojoSells={
	selectMenuItem:function(){
		$('.menu ul li a').live('click',function(){
			$(this).addClass('selected');
		});
	},
	checkbox:function(){
		$('b.checkbox').live('click', function(){
			var checkbox = $(this).find('input');
			if (checkbox.attr('checked')){
				checkbox.removeAttr('checked');$(this).removeClass('checked');
			}else{
				checkbox.attr('checked','checked');$(this).addClass('checked');
			}
			return false;
		});
	},
	buttonLinkFix:function(){
		$('a button').live('click', function(){
			window.location = $(this).parent('a')[0].href;
		});
	}
};

	
	
$(function() {
	MojoSells.selectMenuItem();
	MojoSells.checkbox();
	MojoSells.buttonLinkFix();
});
