function addLoadEvent(func) {	var oldonload = window.onload;	if (typeof window.onload != 'function') {		window.onload = func;		}	else {		window.onload = function() {			oldonload();			func();			}		}	}var popup = {	window : null,	click : function(event) {		if (popup.window) {			popup.window.close()			}		popup.window = window.open(popup.href(this.href), "illustration", "resizable=yes, scrollbars=yes, status=yes, height=200, width=400");		popup.window.focus();		return false;		},	href : function(file) {		return "/popup/index.php?file="+file;		},	init : function(id, width, height) {		var re = new RegExp(/\bpopup\b/);		var links = document.all || document.getElementsByTagName("*");		for (var i = links.length - 1; i >= 0; i--) {			if (links[i].href && re.exec(links[i].className)) {				links[i].onclick = popup.click;				}			}		},	resize : function(image_height, image_width) {		document.getElementById("loading").id = "";		if (window.innerHeight) {			var window_height = window.innerHeight;			}		else {			var window_height = document.documentElement.clientHeight;			}		var window_width = document.body.clientWidth;		var adj_h = image_height - window_height;		var adj_w = image_width - window_width		if (window.outerHeight) {			if (window.outerHeight + adj_h > screen.availHeight) {				adj_h = screen.availHeight - window.outerHeight;				}			if (window.outerWidth + adj_w > screen.availWidth) {				adj_w = screen.availWidth - window.outerWidth;				}			}		window.resizeBy(adj_w, adj_h);		adj_h = document.body.clientHeight - document.documentElement.clientHeight;		adj_w = image_width - document.body.clientWidth;		window.resizeBy(adj_w, adj_h);		}	}addLoadEvent(popup.init);