$(function(){
	$("form:eq(1)").attr("id","htf001");

	$("#htf001").validate({
        rules : {
            "id[txt_1]" : {
                required: true,
                minlength: 2
            },
            "id[txt_2]" : {
                required: true,
                minlength: 2
            },
            "id[txt_3]" : {
                required: true,
                minlength: 1
            }
        }
    });
	
	$("input#attrib-1-0").blur(function() {
			keisan();
	});  
	$("input#attrib-2-0").blur(function() {
			keisan();
	});  
	$("input#attrib-3-0").blur(function() {
			keisan();
	});  
	
	function keisan() {
		var heibei= $("input#attrib-1-0").val() * $("input#attrib-2-0").val() / 1000000;
		var heibei= heibei * $("input#attrib-3-0").val();
		var heibei = heibei * 100 ;
		heibei = Math.round(heibei); //
		console.log(heibei);
		heibei = heibei / 100
		console.log(heibei);
		if (heibei <  0.3) {var heibei = 0.7	}
		else if (heibei <  1) {var heibei = 0.87	};
 		$("input[name='cart_quantity']").val(heibei);
	};


});

