Access is Denied when closing a Window

I am opening a window in a parent frame and passing through URL to attach. That wall works fine expect when I click the close button on the window I get a javascript error saying “Access is Denied”

The code on one page is :-

function loadlink(passedURL)
{

parent.loadModalPopUp(passedURL);

}

then on the parent I have:-

var dhxWins, w0; function loadModalPopUp(passedURL) {
dhxWins = new dhtmlXWindows();
dhxWins.setImagePath("images/dhtmlx/");

	w0 = dhxWins.createWindow("w_link", 100, 100, 750, 750);
	w0.denyResize();
	w0.denyPark();
	dhxWins.window('w_link').button('close').show();
	dhxWins.window('w_link').button('close').enable();
	dhxWins.window('w_link').button('minmax1').hide();
	dhxWins.window('w_link').button('minmax2').hide();
	dhxWins.window('w_link').button('park').hide();
	dhxWins.window('w_link').denyMove();
	w0.setText("Link");
	w0.attachURL(passedURL);
	dhxWins.window('w_link').centerOnScreen();
	dhxWins.window('w_link').show();
            dhxWins.window('w_link').setModal(true);		

}

I’ve attached the working demo
01.zip (40.4 KB)