1) It's javascript. Java is a completely separate language.
2) Your functions are more complex than they need to be
3) Store referenced data (you can do this by declaring a variable or class containing it globally, otherwise you can also put it on the page for reference via document.getElementById('name').InnerHTML... that's how the ons and offs system works here : )
4) Use the code tags
<script type="text/javascript">
var pot=50; // You can declare global variables in javascript
function roll2d6 () {
return Math.floor(Math.random() * 6) Math.floor(Math.random() * 6) 2;
}
function takebet (betvalue) {
// And here you place the logic, checking the bet against the remaining pot, rolling again if they need to match, etc. etc.
}
</script>