function updateSalePrice(){			
	with (document.forms.frmProduct) {	
		if(discount.value.length == 0)
			discount.value = 0;
		if (regularprice.value.length>0 && discount.value.length>0){
			price.value=parseFloat(regularprice.value)-parseFloat(discount.value);
		}
		else
			price.value="";				
	}
}

function updateSalePrice2(){			
	with (document.forms.frmProduct) {	
		if(discount2.value.length == 0)
			discount2.value = 0;
		if (regularprice2.value.length>0 && discount2.value.length>0){
			price2.value=parseFloat(regularprice2.value)-parseFloat(discount2.value);
		}
		else
			price2.value="";				
	}
}

		
function valButton(btn) {
	var cnt = -1;
	for (var i=btn.length-1; i > -1; i--) {
	   if (btn[i].checked) {cnt = i; i = -1;}
	   }
	if (cnt > -1) return btn[cnt].value;
	else return null;
}

