>> I have a hard time getting hold of the parameter value in that procedure (how do I do that?)
p_web.GetValue('whatever')
>> How do find the real key value that corresponds with the _bdiv_ parameter in the url?
you don't use bdiv directly, you go stright to the underlying key fields. for example
p_web.GetSessionValue('cus:id')
Cheers
Bruce