/* 
* addOnUnLoadEvent
this is a stand alone script
can be called from other scripts if the scripts are in the proper order in the files head element
*/
function addOnUnLoadEvent(func) {
	//alert("hello from addOnUnLoadEvent");
	var oldonunload = window.onunload;
	if (typeof window.onunload != 'function') {
		window.onunload = func;
	} else {
		window.onunload = function() {
			if (oldonunload) {
				oldonunload();
			}
			func();
		}
	}
}
