If you mean the same Greybox as I do then you might want to try this:
var GB = function(caption, height, width, callback_fn) {
var options = {
caption: caption,
height: height || 500,
width: width || 500,
fullscreen: false,
show_loading: false,
callback_fn: callback_fn
}
var win = new GB_Window(options);
return win;
}
The above code is in a script tag on your page. GB is a global variable that now holds a reference to the greybox. So it's easy to do stuff like this with it:
GB.show(someURL);
GB.hide();
The button should call javascript GB.hide() in order to close the greybox.
Cheers!