function popup(href, width, height, target){
	if(href == "" || href == null) return;
	if(target == "" || target == null) var target = "_blank";

	if(width == "" || width == null || height == "" || height == null){
		var width = screen.availWidth/2;
		var height = screen.availHeight/2;
	} else {
		var width = width + 20;
		var height = height + 20;
	}

	var wx = (screen.availWidth/3)-(width/3);
	var wy = (screen.availHeight/3)-(height/3);

	wnd = window.open(href, target, "left="+wx+",top="+wy+",width="+width+",height="+height+",menubar=no,toolbar=no,status=no,location=no,scrollbars=auto,fullscreen=no,directories=no,resizable=yes,screenX="+wx+",screenY="+wy);
	window.wnd.moveTo(wx, wy);
	return false;
}

function setGlobalOnLoad(f){
	 var root = window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null
	 if(root){
			if(root.addEventListener) root.addEventListener("load", f, false)
			else if(root.attachEvent) root.attachEvent("onload", f)
	 } else {
			if(typeof window.onload == 'function'){
				 var existing = window.onload
				 window.onload = function(){
						existing()
						f()
				 }
			} else {
				 window.onload = f
			}
	 }
}