var _timer; function checkBrowser() { if (Ext.isIE6 || Ext.isGecko2 || Ext.isSafari2) { Ext.getDom('oldbrowser').style.display = 'block'; } } function showWaitIcon() { _timer = setTimeout(function(){Ext.getDom('waitIcon').style.display = 'block';}, 1000); } function hideWaitIcon() { clearTimeout(_timer); Ext.getDom('waitIcon').style.display = 'none'; } function onDOMLoaded(initFunc) { if (Ext.getDom('waitIcon')) { initFunc(); } else { var _timer = setInterval(function() { if (Ext.getDom('waitIcon')) { clearInterval(_timer); initFunc(); } }, 500); } } function changeToText(elid){ var oldEl = Ext.getDom(elid); if (oldEl.tag === 'input' && oldEl.type === 'text') { oldEl.value = ''; return; } var oldClass = oldEl.className; var newEl = Ext.DomHelper.insertBefore(oldEl, {tag: 'input', type: 'text'}); Ext.removeNode(oldEl); newEl.id = elid; newEl.name = elid; newEl.className = oldClass; } function changeToSelect(elid){ var oldEl = Ext.getDom(elid); if (oldEl.tag === 'select') { oldEl.options.length = 0; return; } var oldClass = oldEl.className; var newEl = Ext.DomHelper.insertBefore(oldEl, {tag: 'select'}); Ext.removeNode(oldEl); newEl.id = elid; newEl.name = elid; newEl.className = oldClass; } function popUpPage(page, height, width) { var popwin = window.open(page, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height); popwin.focus(); } onDOMLoaded(function() { Ext.get('header_logo').on('click', function(){location='index.html';}, this, {preventDefault: true}); Ext.select('a[class=_popup]').on('click', function(evt,el,o){window.open(el.href);}, this, {preventDefault: true}); checkBrowser(); });