Popup Window Issues in 7.2f1

On our quote page I've added a button to open a popup window to add a new address for the customer.

var buttonaction = crm.url(241).replace("Key0=86", "Key0=1").replace("Mode=3", "Mode=1")+"&PopupWin=Y";
var xURL = "<a id='btnnewaddress' href='#'><img src='..\\Themes/Img/default/Buttons/smalladd.gif' border=0 title='New Address'></a>";
document.getElementById('_Captquot_billaddressid').innerHTML += xURL;
$('#btnnewaddress').click(function(){OpenWindow(buttonaction, 'New Address', 350, 900);});

First I had to overcome the issues with the url, I had to change the Key0 back to 1, so the address would tie to the company. I also had to change the mode to 1 so it would actually give me the add address url and not the address list grid.

Second PopupWin=Y is still showing me the tabs...

Third issue. Even though it's a popup clicking Save or Cancel does not close the popup. Instead it redirects back to the address list page. Am I going to have to add custom script to every page we want to be a popup to hijack the save and cancel buttons and add in window.close() action? I also won't be able to do this to only those buttons since THEY DONT HAVE A FRIGGIN ID.. so I'll have to add the action to class buttonitem...(clicking help would close the window too in this case)

I tried using the .NET API and creating a custom new entry page, that loads up the AddressBoxLong screen. This all works fine, I can even close the popup using my own code. the Problem here is the built in DataPageNew base class doesn't tie my address back to the company. There is no address link record created. This is a common issue on all of the pages where I inherit the API base classes. If I build my own I can obviously overcome the problem...

Also, I would have put this post in the Partner forums.. except they aren't accessible today....