Hi, Im new to javascript and this forum and was wondering if someone could help with this issue;

This is the html/php element (within a form called orderForm)

HTML Code:
    echo "\t<div class='item'>
            <span class=gameTitle>{$book[gameTitle]}</span>
            <span class='relYear'>{$book['relYear']}</span>
            <span class='genDesc'>{$book['genDesc']}</span>
            <span class=’price’>{$book['price']}</span>
            <span class='chosen'><input type='checkbox' name='game[]' value='{$game['gameID']}' title='{$game['price']} id='price' /></span>
All I'm wanting to do is to add up the total of the selected game checkboxes. I find JS quite tricky to get my head around. So far I have this (don't laugh);

function totalPrice(price)
var money = document.orderForm.price.title;
var working = 0;
var total = 0;
if (price.checked)

I've been at this for hours and haven't made any head way, any ideas are welcomed!