How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?

I have just sussed out the answer. I was missing the mediaUploader.open(); entry. I have amended my original code, accordingly, just in case anyone is having the same issue.