var DTP = {};

DTP.onload = function(func) {
	if (window.attachEvent)
		window.attachEvent('onload', func);
	else
		window.addEventListener('load', func, false);
}

DTP.onload(function() {
	if (document.forms.length > 0 && document.forms[0].elements.length > 0) {
		try {
			var e = document.forms[0].elements[0];
			if (e.focus) e.focus();
			if (e.select) e.select();
		} catch (x) { }
	}
});


// From HTMLArea, works arround IE bugs
DTP.getElementById = function(tag, id) {
	var el, i, objs = document.getElementsByTagName(tag);
	for (i = objs.length; --i >= 0 && (el = objs[i]);)
		if (el.id == id)
			return el;
	return null;
};

