jQuery(document).ready(function(){
if(false){alert('ololo')};
jQuery(".calc-checkbox").mousedown(function() {
	changeCheck(jQuery(this));
	if($(this).find('input').attr('checked')){
		$('#debug').text($(this).find('input').attr('checked'));
	}else{
		$('#debug').text('false');
	}
});


jQuery(".calc-checkbox").each(function(){
     changeCheckStart(jQuery(this));
});

});

function changeCheck(el){
	var el = el, input = el.find("input").eq(0);
	if(!input.attr("checked")) {
		el.css("background-position","0px -107px");	
		input.attr("checked", true)
	} else {
		el.css("background-position","-18px -107px");	
		input.attr("checked", false)
	}
	return true;
}

function changeCheckStart(el){
	var el = el, input = el.find("input").eq(0);
	if(input.attr("checked")) {
		input.attr("checked",false);	
	}
	return true;
}

$('#debug').click(function(){
	alert();
})
		
