﻿function getObject(name) {
	var object;
	if (document.all && !document.getElementById) {
		object = document.all[name];
	} else if (document.getElementById) {
		object = document.getElementById(name);
	}
	return object;
}

function openWin(url,id,height,width) {
	var x = (640 - width)/2;
	var y = (480 - height)/2;
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}
	var options = "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes"
	if (width != null) 
		{options = options+",width="+width+",screenX="+x+",left="+x;}
	if (height != null)
		{options = options+",height="+height+",screenY="+y+",top="+y;}

	remote = window.open(url,id,options)
	remote.focus();
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		if (oldonload) {
			oldonload();
		}
			func();
		}
	}
}
