Checkbox Values calculation

Can anyone please help me solve the following bearing in mind I’m a complete novice at javascript.

I saw a tutorial which calculated a value based upon whether or not a checkbox(s) value was selected/ticked. Each time the checkbox was checked or unchecked by a user the form re-cacluated the value. This works fine but now I’m trying to send the resulting information to another page where I can display only the selected items along with other information. I have listed the script that does the caculation each time the boxes are chekced/unchecked as I’d like to think the answer lies here.

<script>
function calculate(inObj){
//I Don’t need to pass inObj here since it is not used in the function
BasicPrice=<%=VehiclePricesRs(“BasicTotal”)%>
ttl = 0
grandttl = 0
//sets the total couter to 0
allInput = document.getElementsByTagName(“input”)
//loads all INPUT elements into an array called “allInput”
for(x=0; x<allInput.length; x++){
//prepares to loop through the allInput array
if (allInput[x].type == “checkbox”){
//if the input type is a checkbox proceed
if (allInput[x].checked){
//if the checkbox is checked proceed
val = parseFloat(allInput[x].value)
//load the number value into a var called val
if (!isNaN(val)) ttl += val
//if val is a valid number (ie - not Not a Number) add it to the total
}
}
}
document.getElementById(“box4”).value = currency(ttl)
document.getElementById(“box5”).value=currency(ttl +<%=VehiclePricesRs(“BasicTotal”)%>)
//Now I write the total to an input with the ID box4 & box5
}
</script>