/*
	Based on http://www.alistapart.com/articles/popuplinks/.
*/

var _EXIT_POPUP_FEATURES = 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,width=600,height=400';

function raw_popup(url, target, features) {
	if (isUndefined(features)) {
    	features = _EXIT_POPUP_FEATURES;
  	}
  	if (isUndefined(target)) {
    	target = '_blank';
  	}
	
	if(external_popup()) {
		var theWindow = window.open(url, target, features);
		theWindow.focus();
		return theWindow;
	}
}

function link_exit(src, features) {
	return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function external_popup() {
	if(confirm("Thank you for visiting amatochiropractic.com. Amato Chiropractic Center does not review or control the content at the site to which this hyperlink connects; therefore, this hyperlink does not constitute an endorsement by Amato Chiropractic Center of the content of any non-Amato Chiropractic Center site.\n\nDo you wish to continue?"))
    	return true;
}

function isUndefined(v) {
    var undef;
    return v===undef;
}