
var ui = null;

function xalert() {}


function findUi()
{
var n=50
var f = window
while (n > 0 && f != null && typeof f != "undefined") {
n--;
if (f.ui && f.ui.select) { return f.ui }
if (f.parent != null && f.parent != f && typeof f.parent != "undefined") { f = f.parent; xalert("parent " + f.name); }
else if (f.opener != null && f.opener != f) { f = f.opener; xalert("opener " + f.name); }
else { xalert("no opener: " + f.name); return null; }
}
}

function dummyUi()
{
function noop() {}
this.noop = noop;
this.setSelection=noop;
this.getSelect=noop;
this.getClip=noop;
this.swap=noop;
this.args = noop;
this.action=noop;
this.load = noop;
this.loadHref = noop;
this.getModePath = noop;
this.error = noop;
this.set=noop;
this.select=noop;
this.clip=noop;
this.more=noop;
this.aux=noop;
this.selectEdit=noop;
this.retools=noop;
this.menuEdit=noop;
this.displayEdit=noop;
this.create=noop;
this.createAction=noop;
this.wizard=noop;
this.find=noop;
this.creates=noop;
this.wizard=noop;
this.split=noop;
this.menu=noop;
this.browse=noop;
this.browseall=noop;
this.up=noop;
this.down=noop;
this.rebrowse=noop;
this.unbrowse=noop;
this.exbrowse=noop;
this.execute=noop;
this.cut=noop;
this.copy=noop;
this.paste=noop;
this.move=noop;
this.link=noop;
this.del=noop;
this.open=noop;
this.display=noop;
this.displays=noop;
this.edit=noop;
this.edits=noop;
this.reedit=noop;
this.properties=noop;
this.setBrowsePath=noop;
this.setTasksPath=noop;
this.setBrowseWidth=noop;
this.setLang=noop;
this.setTools=noop;
this.setView=noop;
this.setCurrentBrowse=noop;
this.setFind=noop;
this.setSession=noop;
this.setWorkspace=noop;
this.togglePanel=noop;
this.restart=noop;
this.review=noop;
this.setServerModule=noop;
this.setLabel=noop;
this.home=noop;
this.setDefaultOpenInBlank=noop;
this.reload=noop;
this.reset=noop;
this.preset=noop;
this.mouseMove = noop;
this.dragStart = noop;
this.cancelEvent = noop;
this.dragOver  = noop;
this.dragEnter = noop;
this.dragLeave = noop;
this.drop = noop;
this.use = noop;
this.getWorkspace = noop;
}

ui = findUi();
if (ui == null) ui = new dummyUi()


