<input type="button" value="ya.ru" onclick="this.win = this.win ? this.win.close() : window.open('http://ya.ru')">