
//	Swift GRB Tool Delete Confirmation
//	Name: warning.js
//	Version: 2.5 (July 2009)
//	Author: J.D. Myers (john.d.myers@nasa.gov)


// Execute all window.onload functions - Simon Willison, http://simon.incutio.com/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// Prepare the menu events
function confirmDelete() {
	// Test browser compatability
	if (!document.getElementById) {
		return false;
	}
	if (!document.getElementsByTagName) {
		return false;
	}
	var links = document.getElementsByTagName("a");
	for (var i = 0; i < links.length; i++) {
		if (links[i].className == "delete") {
			links[i].onclick = function() {
				var answer = confirm("Are you sure you want to delete that burst? It cannot be undone.");
				if (answer) {
					return true;
				} else {
					return false;
				}
			}
		}
	}
}

addLoadEvent(confirmDelete);
