//Name		:	KK_ui.checkbox
//Need		:	Css, image
//Site		:	www.kangk.com
//Author	:	Kangk.L
//Checkbox style

$("input[type='checkbox']").each(function(){
	if($(this).attr("checked")==true){
		$(this).replaceWith("<input name='"+$(this).attr("name")+"' title='"+$(this).attr("value")+"' type='button' class='checkbox checkbox_checked' /><input type='hidden' value='"+$(this).attr("value")+"' name='"+$(this).attr("name")+"' />");
	}else{
		$(this).replaceWith("<input name='"+$(this).attr("name")+"' title='"+$(this).attr("value")+"' type='button' class='checkbox checkbox_static' />");
	}
});

$(".checkbox").click(function(){
	if($(this).attr("class") == "checkbox checkbox_static"){
		$(this).after("<input type='hidden' value='"+$(this).attr("title")+"' name='"+$(this).attr("name")+"' />");
		$(this).removeClass("checkbox_static");
		$(this).addClass("checkbox_checked");
	}else{
		$(this).attr("id","checkbox_click");
		$("#checkbox_click + input[type='hidden']").remove();
		$(this).attr("id","");
		$(this).removeClass("checkbox_checked");
		$(this).addClass("checkbox_static");
	}
});
