function JHshNumberText(a)
{ 
	var fa="";
	if(a.value.substring(0,1)=="-")
		fa="-";
	var str=(a.value.replace(/[^0-9.]/g,'')).replace(/[.][0-9]*[.]/, '.');
	if (str.substring(0,1)==".")
		str="0"+str;
		a.value=fa+str;
} 
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==-1)  
	return (false);
}
return (true);
}

function check1()
{
	total();
	if (document.form1.huohao1.value==emptyProduit)
	{
		alert(EmptyAlert);
		return false;
	}
	if (document.form1.shulian1.value=="")
	{
		alert(EmptyAlert);
		return false;
	}
	if (document.form1.sshk.value=="")
	{
		alert(EmptyAlert);
		document.form1.sshk.focus();
		return false;
	}
	if (document.form1.priceother.value=="")
	{
		alert(EmptyAlert);
		document.form1.priceother.focus();
		return false;
	}
	if (document.form1.id_gys.value=="0")
	{
		alert(EmptySelAlert);
		document.form1.id_gys.focus();
		return false;
	}
	var btnSave=document.getElementById("btnSave");
	if(!isEmpty(btnSave))
	{
		btnSave.disabled=true;
	}
	document.form1.submit();
	return true;
}

function chg(objName, objName2, zekou)
{
	var obj;
	obj = document.getElementById(objName);
	obj2 = document.getElementById(objName2);
	temp = obj2.value*zekou
	obj.value = Math.round(temp*1000)/1000;
}
function youhui()
{
	var temp=document.getElementById('ysk').value;
	var ssk=document.getElementById('sshk').value;
	var yh=document.getElementById('yh').value;
	document.getElementById('qk').value=Math.round((temp*1-ssk*1-yh*1)*1000)/1000;
}

function zhonger()
{
	var ssk=document.getElementById('sshk').value;
	var temp=document.getElementById('priceother').value;
	var qk=document.getElementById('qk').value;
	document.getElementById('ssze').value=Math.round((temp*1+ssk*1+qk*1)*1000)/1000;
}

function total()
{
	heji();
	youhui();
	zhonger();
}