prueba esto seguro te sirve
function porcien(form)
{
by="
[email protected]"
var c=parseInt(form.c.value)
var v=parseInt(form.v.value)
var l=parseInt(form.l.value)
var e=parseInt(form.e.value)
var h=parseInt(form.h.value)
var p=parseInt(form.p.value)
var suma=c+v+l+h+p+e
isNaN(suma)?suma=0:null
if(suma<=100)
form.r.value=suma
else
document.all.corrige.innerHTML="Te has exedido en "+(suma-100)+" Corrige por favor"
}
//-->
</script>
<form name="los">
<pre>
Compras <input name="c" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
Ventas <input name="v" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
Limpias <input name="l" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
E-mail <input name="e" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
Hosting <input name="h" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
Publisidad <input name="p" onKeyDown="porcien(this.form)" onKeyUp="porcien(this.form)" type="text" value="0">
total de <input name="r" type="text" value="0">
</pre>
<div id="corrige"></div>
</form>