<script language="javascript">
function sum() {
var i,arglen,temp=0;
arglen=arguments.length;
for (i=0; i<arglen; i++) {
sig=(i!=(arglen-1))?"+":"="
document.write(arguments[i]+sig);
temp+=arguments[i];
}
return(temp);
}
</script>
<script language="javascript">
<!--
document.write(sum(10,20,30));
document.write("<br>");
document.write(sum(10,20,30,40));
document.write("<br>");
document.write(sum(10,20,30,40+50));
-->
</script>