Не могу разобраться 
Задача понять что в скрипте отвечает за закрытие  окна 
хочу сделать чтобы окно закрывалось по нажатию на кнопку,
а сейчас окно закрывается по нажатию на любою область 
всей странице 
скрипт который вызывает модальное  по нажатию на кнопку 
[JS]
<script src="js/jquery.tools.min.js"></script>
<script>
$(function() {
	// if the function argument is given to overlay, it is assumed to be the onBeforeLoad event listener
	$("a[rel]").overlay(function() {
		// grab wrapper element inside content
		var wrap = this.getContent().find("div.wrap");
		// load only for the first time it is opened
		if (wrap.is(":empty")) {
			wrap.load(this.getTrigger().attr("href"));
		}
	});
});
</script>
<link rel="stylesheet" type="text/css" href="css/overlay-minimal.css"/>
<title>Untitled Document</title>
</head>
<body>
<a href="external-content.htm" rel="#overlay">
	<!-- remember that you can use any element inside the anchor tag -->
	<button type="button">Показать внешний файл в модальном окне!!!</button>
</a>
<!-- overlayed element -->
<div class="overlay" id="overlay">
	<!-- the external content is loaded inside this tag -->
	<div class="wrap"></div>
</div>
[/JS]
библиотека