UI = function() {
}
UI.pb = function(elem, ev) {
	if(window.__uiPrepostBack) {
		window.__uiPrepostBack();
	}
	var id = '';
	if(typeof(elem)=='string') {
		id = elem;
	} else {
		id = elem.id;
	}
	document.forms[0].__uievent.value=id+':'+ev;
	document.forms[0].submit();
}
UI.confirm = function(txt) {
	return window.confirm(txt);
}
UI.alert = function(txt) {
	return window.alert(txt);
}
UI.setFocusOn = function(id) {
	var el = UI.getElementById(id);
	if(el && el.focus) {
		el.focus();
	}
}
UI.getElementById = function(id) {
	return UI._getElementByIdRec(id,window.document);
}
UI._getElementByIdRec = function(id, doc) {
	if (doc.getElementById) {
		var o = doc.getElementById(id);
		if(o) {
			return o;
		}
	}
	if (doc.all) {
		var o = doc.all[id];
		if(o) {
			return o;
		}
	}
	if(doc.layers) {
		for (var i=0; i<doc.layers.length; i++) {
			o = UI._getElementByIdRec(id, doc.layers[i].document);
			if(o) {
				return o;
			}
		}
	}
	return null;
}


