function makeWindow(url, windowname, properties, windowwidth, windowheight, screenx, screeny) {
	var windowwidth = parseInt(windowwidth);
	var windowheight = parseInt(windowheight);
	var toolbar;
	var location;
	var directories;
	var status;
	var menubar;
	var resizable;
	var scrollbars;
	var dependent;
	var windowattribute;

	properties.charAt(0) == '1' ? toolbar = 'yes' : toolbar = 'no';
	properties.charAt(1) == '1' ? location = 'yes' : location = 'no';
	properties.charAt(2) == '1' ? directories = 'yes' : directories = 'no';
	properties.charAt(3) == '1' ? status = 'yes' : status = 'no';
	properties.charAt(4) == '1' ? menubar = 'yes' : menubar = 'no';
	properties.charAt(5) == '1' ? resizable = 'yes' : resizable = 'no';
	properties.charAt(6) == '1' ? scrollbars = 'yes' : scrollbars = 'no';
	properties.charAt(7) == '1' ? dependent = 'yes' : dependent = 'no';

	if(scrollbars == 'yes') {
		if(gNN6 || gNN7) {
			windowwidth -= 2;
			windowheight -= 6;
		} else if(gMacintosh && gNN4) {
			windowwidth -= 16;
			windowheight -= 23;
		} else if(gWindows && gNN4) {
			windowheight += 12;
		} else if(gMacintosh && gIE5) {
			windowwidth -= 17;
			windowheight -= 24;
		} else if(gMacintosh && gIE4) {
			windowwidth -= 17;
			windowheight -= 20;
		}
	} else {
		if(gNN6 || gNN7) {
			windowwidth -= 2;
		} else if(gMacintosh && gNN4) {
			windowwidth -= 16;
		} else if(gMacintosh && gIE5) {
			windowwidth -= 17;
		} else if(gMacintosh && gIE4) {
			windowwidthwidth -= 17;
		}
	}

	if(gMacintosh && gIE4) {
		windowheight += 16;
	}

	if(screen.availWidth && screen.availHeight) {
		if(screenx == '' || screeny == '') {
				screenx = Math.round((screen.availWidth - windowwidth) / 2);
				screeny = Math.round((screen.availHeight - windowheight) / 2);
		} else if(screenx < 0 || screeny < 0) {
			screenx = 0;
			screeny = 0;
		}
	} else if(screenx == '' || screeny == '' || screenx < 0 || screeny < 0) {
		screenx = 0;
		screeny = 0;
	}

	windowattribute = 'width=' + windowwidth + ',height=' + windowheight + ',';
	windowattribute += 'toolbar=' + toolbar + ',location=' + location + ',directories=' + directories + ',status=' + status + ',menubar=' + menubar + ',resizable=' + resizable + ',scrollbars=' + scrollbars + ',dependent=' + dependent + ',left=' + screenx + ',top=' + screeny;
	var madewindow = window.open(url, windowname, windowattribute);

	if (!(gWindows && (gIE4 || gIE5))) {
		madewindow.focus();
	}
	return false;
}

function closeSubwin(x) {
	if (!!x) {
		if (gMacintosh && gIE) {
			return x.close();
		} else {
			return typeof x.document != 'object';
		}
	} else {
		return true;
	}
}

function openerCheck() {
	if (!!window.opener) {
		if (gIE4 && gWindows || gIE4 && gMacintosh || gGecko) {
			return !window.opener.closed;
		} else {
			return typeof window.opener.document == 'object';
		}
	} else {
		return false;
	}
}

function windowOpener(a) {
	if (openerCheck()) {
		window.opener.location.href = a.href;
		window.opener.focus();
		return false;
	} else {
		if (gIE && gMacintosh) {
			return true;
		}
		mainWindow = window.open(a.href, a.target);
		mainWindow.focus();
		return false;
	}
}
