i am sure i am doing something wrong but can't figure out what

HTML Code:
<script>
function sum()
var num1=parseInt(prompt("please enter 1st no"));
var num2=parseInt(prompt("please enter 2nd no"));
var sum=num1+num2;
{
document.write("sum is"+sum);
}
function subs(num1,num2)
var sub1=num1-num2;
{
document.write("sub is"+subs);
}
var opt=parseInt(prompt("do you want sum or subs"));
switch(opt)
{
case1:
 sum();
break;
case2:
 subs();
break;
default:
document.write("hg")
}
</script>
</body>
</html>