In RichFaces 3.x you can use javascript for show/hide the modal panel:
Show:
Richfaces.showModalPanel('modalPanelId')
or
#{rich:component('modalPanelId')}.show()
Hide:
Richfaces.hideModalPanel('modalPanelId')
or
#{rich:component('popup')}.hide()
Example:
<h:graphicImage value="/images/icons/close.png" style="cursor:pointer"
onclick="Richfaces.hideModalPanel('modalPanelId')" />