Ok, so I think I have found the answer. Reading from here http://theelitist.net/passing-additional-arguments-to-a-callback-function-in-javascript I have realised that Dawson Loudon's response was almost complete, but he missed the "tx" variable that should be passed on the first function that calls the 2nd one, that would be:
db.transaction(function(tx) { queryDB(tx, myParam); }, errorCB);
function queryDB(tx, myParam) {
//logic here
}
Thanks for your time and help.