function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open (href, windowname, 'width=625,height=500,scrollbars=yes');
}

function MM_openBrWindow(theURL,winName,features){
window.open(theURL,winName,features);
}

<!-- Start DHTML Menu -->
Menu = {timer : null, current : null};
Menu.getStyle = function(name){
	if(document.getElementById) return document.getElementById(name).style;
	else if(document.all) return document.all[name].style;
	else if(document.layers) return document.layers[name];
}
Menu.show = function(name){
	if(this.timer) clearTimeout(this.timer);
	this.getStyle(name).visibility = "visible";
	this.current = name;
}
Menu.hide = function(){
	this.timer = setTimeout("Menu.doHide()",300);
}
Menu.doHide = function(){
	if(this.current){
		this.getStyle(this.current).visibility = "hidden";
		this.current = null;
	}
}

// ||||||||||||||||||||||||||||||||||||||||||||||||||

// change bgColor (id, color)
function ID_setbgcolor(i,color) 
	{ if (document.layers) 
		window.document.layers[i].bgColor = color;
	else if (document.all)
		window.document.all[i].style.background = color; }
		
<!-- End DHTML script -->


var openedWin = null;
var wpercent = 100;

function launch()
{
	var args = launch.arguments;
	var url = args[0];
	var width = args[1];
	var height = args[2];
	
	if (!url || !width || !height) {
		alert('Error in arguments');
	} else {
		var scr_w = screen.availWidth;
		var scr_h = screen.availHeight;
		var target_w = 0;
		var target_h = 0;
		
		wpercent = 100;
		var scr_w = screen.availWidth;
		var scr_h = screen.availHeight;
		
		if (width >= scr_w || height >= scr_h) {
			if (width >= scr_w && height < scr_h) {
				wpercent = Math.floor(((scr_w - 8) * 100) / width);
			} else if (height > scr_h) {
				wpercent = Math.floor(((scr_h - 27) * 100) / height);
			}
			width = Math.floor((width * wpercent) / 100);
			height = Math.floor((height * wpercent) / 100);
		}
		
		_launch(url, width, height, args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
	}
}

function _launch()
{
	closeChild();
	
	var args = _launch.arguments;
	var url = args[0];
	var width = args[1];
	var height = args[2];
	var resizable = args[3] ? 'yes' : 'no';
	var scrollbars = args[4] ? 'yes' : 'no';
	var toolbar = args[5] ? 'yes' : 'no';
	var menubar = args[6] ? 'yes' : 'no';
	var status = args[7] ? 'yes' : 'no';
	var address = args[8] ? 'yes' : 'no';
	var directories = args[9] ? 'yes' : 'no';
	
	var NewX = Math.max(0, Math.floor((screen.availWidth - (width + 8)) / 2));
	var NewY = Math.max(0, Math.floor((screen.availHeight - (height + 27)) / 2));
	
	var params = new Array();
	params.push('width=' + width);
	params.push('height=' + height);
	params.push('screenx=' + NewX);
	params.push('screeny=' + NewY);
	params.push('left=' + NewX);
	params.push('top=' + NewY);
	params.push('resizable=' + resizable);
	params.push('scrollbars=' + scrollbars);
	params.push('toolbar=' + toolbar);
	params.push('menubar=' + menubar);
	params.push('status=' + status);
	params.push('location=' + address);
	params.push('directories=' + directories);
	
	openedWin = window.open(url, '', params.join(','));
}

function closeChild()
{
	if (openedWin != null) {
		if (!openedWin.closed) {
			openedWin.close();
		}
	}
}

onunload = closeChild;