CURL session problem with javascript

Dear all,

I’m trying to make a script that posts our company its products to a website, I have got everything working apart from 1 detail, which I hope you guys could help me with.
I’d like to add pictures so there’s an image upload page but the ID of the uploaded image is retrieved using a javascript code and I cannot figure out howto retrieve that in PHP/CURL, perhaps any of you could help me?

The website is:

Just select the 2 first values from the 2 drop down boxes and enter a random e-mail address to get to the image upload. You’ll find 3 Browse buttons, and if you look into the source there are 3 according fields:

<input type="hidden" id="uploadedFileIds_0" name="uploadedFileIds[0]" value="" />
<input type="hidden" id="uploadedFileIds_1" name="uploadedFileIds[1]" value="" />
<input type="hidden" id="uploadedFileIds_2" name="uploadedFileIds[2]" value="" />

They’re hidden but become populated as soon as an image has been uploaded, I’m almost certain this is done using Javascript and I can’t simulate that with PHP/CURL so I’m trying to find a way to do it… I’m desperate for help so thought I’d ask some clever people?

Thanks a lot!