function onlyNum()
 {
        var realKey = String.fromCharCode(event.keyCode) 
        var myReg = /^(-|\+)?\d+(((\.\d+)|(\.))|((\/\d+)|(\/)))?$/;
        alert(event.srcElement.value + realKey);
        alert(myReg.test(event.srcElement.value + realKey));
        if (myReg.test(event.srcElement.value + realKey) == false)
        {
            event.returnValue=false;
        }
 }

function changdu(){
	if (document.all.du1.value == "15") {
		document.getElementById("du2").innerHTML="3";
		document.all.du.value = 12;
	}
	if (document.all.du1.value == "25") {
		document.getElementById("du2").innerHTML="5";
		document.all.du.value = 20;
	}
	if (document.all.du1.value == "40") {
		document.getElementById("du2").innerHTML="8";
		document.all.du.value = 32;
	}
	if (document.all.du1.value == "60") {
		document.getElementById("du2").innerHTML="11";
		document.all.du.value = 49;
	}
	if (document.all.du1.value == "90") {
		document.getElementById("du2").innerHTML="14";
		document.all.du.value = 76;
	}
	if (document.all.du1.value == "110") {
		document.getElementById("du2").innerHTML="18";
		document.all.du.value = 92;
	}
	if (document.all.du1.value == "140") {
		document.getElementById("du2").innerHTML="22";
		document.all.du.value = 118;
	}
	if (document.all.du1.value == "175") {
		document.getElementById("du2").innerHTML="27";
		document.all.du.value = 148;
	}
	if (document.all.du1.value == "200") {
		document.getElementById("du2").innerHTML="30";
		document.all.du.value = 170;
	}
	if (document.all.du1.value == "280") {
		document.getElementById("du2").innerHTML="42";
		document.all.du.value = 238;
	}
	if (document.all.du1.value == "420") {
		document.getElementById("du2").innerHTML="68";
		document.all.du.value = 352;
	}
} 
function NumPrice()
{ if ((document.all.price.value=="")||(document.all.usetime.value=="")||(document.all.num.value=="")){
      document.getElementById("sPrice").innerHTML="0";
  }
  else
  { 
		var du = document.all.du.value ; 
	  var price = document.all.price.value ; 
	  var usetime = document.all.usetime.value ; 
	  var num = document.all.num.value ; 
	  var val = du*price*usetime*num*365/1000;
		//alert(du);
    document.getElementById("sPrice").innerHTML=val.toFixed(2);
  }    
}
