tried writing DOM traversal function. Failed. simple string subs thing for time being. Will have another go after I've had a rest.