function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function insertAfter(newElement,targetElement) {
	var parent = targetElement.parentNode;
	if (parent.lastChild == targetElement) {
		parent.appendChild(newElement);
	} else {
		parent.insertBefore(newElement,targetElement.nextSibling);
	}
}

function addClass(element,value) {
	if (!element.className) {
		element.className = value;
	} else {
		newClassName = element.className;
		newClassName+= " ";
		newClassName+= value;
		element.className = newClassName;
	}
}

function submitButtonHover() { /* IE Hack - doesn't allow CSS :hover on non-A tags */
	if (!document.getElementsByTagName) return false;
	var inputs = document.getElementsByTagName("input");
	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].className != "submit") continue;
		inputs[i].onmouseover = function() {
			this.className = "submithover";
			//this.style.backgroundColor = "#A5BAD6";
			//this.style.color = "#000";
 		}
	    inputs[i].onmouseout = function(){
			this.className = "submit";
			//this.style.backgroundColor = "#FFF";
			//this.style.color = "#6A8FB3";
		}
    }
}

function closeWindowPrompt() {
	var alert = "Click Ok to any following prompt to close this window.";
	
	window.alert(alert);
	window.close();
	
	return false;
}

addLoadEvent(submitButtonHover);

