This seemed so trivial when I started off with it! My objective is this:
Here's how I ended up doing this:
function closeSelf(){
document.forms['certform'].submit();
hide(document.getElementById('divform'));
unHide(document.getElementById('closelink'));
}
Where hide() and unhide() set the style.display to 'none' and 'block' respectively.
Not exactly what I had in mind, but this will have to do for the time being. Works on IE, Safari, FF and Chrome.