Mymovieclip.onMouseUp = function()

Hi Guys,
I have just developed a simple xml photo gallery. Below is the code that I have used to generate the gallery:

var gallery = createEmptyMovieClip("galleryImage",0);
for (i=0; i<total; i++) {
	 cur_item = gallery.attachMovie("mainImage","spec"+i, i);
	 cur_item.loadMovie(thumb*, "mainImage");
	 cur_item.onMouseUp = function() {
    		    getURL(javascript:openWindow("products/"+id+"/"+image*));
	  };
}

I am having difficulties to make each movie clip generated into a button that will call the javascript button:

cur_item.onMouseUp = function() {
    		    getURL(javascript:openWindow("products/"+id+"/"+image*));
	  };

What i want to do is to allow the user to click on the movie clip and it will call javascript and open the image in a html window. For some reason I can’t get it to do anything. Am i using the correct code to do this?

Please advise

Much appreciated

Daniel