function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function sahar_calc()
{ var total;
  var wage125;
  var wage150;

a = $("#age").val();
b = $("#hours").val();

total = 0;

if ((Number(b) > 8) && (Number(b) < 11))
   {
    wage125= (Number(a) * 1.25) * (Number(b) - 8);
	total = Number(a) * 8;
	//total = Math.ceil((total + wage125)*10)/10
	total = (total + wage125);
   }
else if (Number(b) > 10)
   {
    wage125= (Number(a) * 1.25) * 2;
	wage150= (Number(a) * 1.5) * (Number(b) - 10);
	total = Number(a) * 8;
	total = (total + wage125 + wage150);
   }
   else 
   {
	total = (Number(a) * Number(b));
   }

if (($("#shabbat").attr("checked"))) {
  total = (total * 1.5);
}
total = roundNumber(total,2);

$("#result").fadeOut("slow").fadeIn("slow");
document.getElementById("result").value=total;
}

