Resize window by javascript

Hi,
I want the program to set the size of the viewing window if the user calls in different files.

Is there a way to resize the Skin with javascript, such as window.resizeTo(500,500);

Also, is there a way to close the entire application via javascript.

Try this code:

function resizeWindow(){
window.external.SetUIProp('fview', 'Width', '500');
window.external.SetUIProp('fview', 'Height', '500');
window.external.SetUIProp('fview', 'Top', '30');
window.external.SetUIProp('fview', 'Left', '30');
}

I test this code. But error in console sasys “Uncaught TypeError: window.external.SetUIProp is not a function”.
Is there any settings to enable access UI from javascript?
Thanks