ksa,
спасибо уже не надо) сам разобрался
вот так написал
var calculate = {
_oldType: 0,
_oldDost: 0,
_TypeDiff: 0,
_DostDiff: 0,
clickDost: function(obj){
var val=calculate._oldDost-obj.value;
val=(val<0)? 0: val;
calculate._DostDiff = val;
calculate._oldDost = obj.value;
calculate.showDiff();
},
clickType: function(obj){
var val = calculate._oldType-obj.value;
val=(val<0)? 0: val;
calculate._TypeDiff = val;
calculate._oldType = obj.value;
calculate.showDiff();
},
showDiff: function(){
value = parseInt(calculate._TypeDiff) + parseInt(calculate._DostDiff);
if(value <= 0){
$('#resultViq').html('');
$('#profit').hide();
}else{
$('#resultViq').html(value);
$('#profit').show();
}
}
}
$(function (){
$('[name="radiog_infoprod"]').click(function (){
calculate.clickType(this);
});
});
$(function (){
$('[name="radiog_dostavka"]').click(function (){
calculate.clickDost(this);
});
});