// Global variables var doTip=0; var timerTip; function hilite(theElem) { if (isDrag) return; if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; if (isSelected(theElem)) theElem.mcselected=1; theElem.mchilite=1; theElem.className=setSuffix(theElem.className,'_h'); theElem.style.cursor='pointer'; } function unhilite(theElem) { if (isDrag) return; if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; theElem.mchilite=0; if (theElem.mcselected) theElem.className=setSuffix(theElem.className,'_s'); else theElem.className=setSuffix(theElem.className,''); theElem.style.cursor='pointer'; } function isHilited(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return(false); if (theElem.className.match('_h')) { return(true); } return(false); } function isHilitedByProperty(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return(false); if (typeof(theElem.mchilite)=='undefined') return(false); else return(theElem.mchilite); } function selected(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; if (isHilited(theElem)) theElem.mchilite=1; theElem.mcselected=1; theElem.className=setSuffix(theElem.className,'_s'); theElem.style.cursor='pointer'; } function unselected(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; theElem.mcselected=0; if (theElem.mchilite) theElem.className=setSuffix(theElem.className,'_h'); else theElem.className=setSuffix(theElem.className,''); theElem.style.cursor='pointer'; } function isSelected(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return(false); if (theElem.className.match('_s')) { return(true); } return(false); } function isSelectedByProperty(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return(false); if (typeof(theElem.mcselected)=='undefined') return(false); else return(theElem.mcselected); } function hover(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; theElem.mccolor=theElem.style.color; theElem.style.color='red'; theElem.style.cursor='pointer'; } function unhover(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; theElem.style.color=theElem.mccolor; theElem.style.cursor='pointer'; } function setCursor(name) { document.body.style.cursor=name; } function unsetCursor() { document.body.style.cursor=defCursor; } function setSuffix(name,suffix) { name=name.replace('_s',''); name=name.replace('_h',''); return(name+suffix); } function setEnabled(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; if (theElem.id=='BUT_search') theElem.className='buttonitem'; else theElem.className=null; theElem.disabled=false; } function setDisabled(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return; if (theElem.id=='BUT_search') theElem.className='buttonitemd'; else theElem.className='disabled'; theElem.disabled=true; } function isEnabled(theElem) { if (typeof(theElem)=='string') theElem=document.getElementById(theElem); if (!theElem) return(false); if (theElem.id=='BUT_search') { if (theElem.className.match(/^buttonitemd/)) return(false); else return(true); } else { if (theElem.className=='disabled') return(false); else return(true); } } // Fix existing shadow divs (by classname) function fixShadow() { if (!isNetscape && !isSafari) return; fixHideShadow(); setTimeout('fixShowShadow()',100); } function fixHideShadow() { var divs=document.getElementsByTagName("div"); for (var i=0; i "20041010" && (navigator.userAgent.indexOf("rv:1.8") != -1 || navigator.userAgent.indexOf("rv:1.9") != -1) ) { // Mozilla 1.8alpha; see bug 76497 and bug 242368; must be higher than 1.7.x var ColumnCollection = table.getElementsByTagName("col"); ColumnCollection[column].style.visibility = vis; } else if (document.all && !window.opera && document.compatMode && document.compatMode == "CSS1Compat") { var ColumnCollection = table.getElementsByTagName("col"); if (vis == "visible") { ColumnCollection[column].style.display = "block"; } else if (vis == "collapse") { ColumnCollection[column].style.display = "none"; } } else if (document.addEventListener) { // Mozilla and Opera 7.x // var TDCollection = table.getElementsByTagName("td"); // for (var CellIterator = column; CellIterator < TDCollection.length; CellIterator += table.rows.length) { // if (vis == "visible") { // TDCollection[CellIterator].style.display = "table-cell"; // } // else if (vis == "collapse") { // TDCollection[CellIterator].style.display = "none"; // } // } var TRCollection = table.getElementsByTagName("tr"); for (var RowIterator = 0; RowIterator < TRCollection.length; RowIterator++) { if (vis == "visible") { TRCollection[RowIterator].childNodes[column].style.display = "table-cell"; } else if (vis == "collapse") { TRCollection[RowIterator].childNodes[column].style.display = "none"; } } } } function setRowVisibility(table, row, vis) { if (navigator.product == "Gecko" && navigator.productSub && navigator.productSub > "20041010" && (navigator.userAgent.indexOf("rv:1.8") != -1 || navigator.userAgent.indexOf("rv:1.9") != -1) ) { table.rows[row].style.visibility = vis; } else if (vis == "visible") { if (document.all && document.compatMode && document.compatMode == "CSS1Compat" && !window.opera) { table.rows[row].style.display = "block"; } else if (document.getElementById && table.rows) { table.rows[row].style.display = "table-row"; } } else if (vis == "collapse") { table.rows[row].style.display = "none"; } } function handleKey(e) { if (getCookie('keyboard')==2) return; var targ; if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3) targ = targ.parentNode; // defeat Safari bug if (targ.type == 'text' || targ.type == 'textarea' || targ.type == 'password' || targ.type == 'select-one' || targ.type == 'select-multiple') { return(false); } var code = 0; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; else code = e.charCode; code = fixCode(code); switch (code) { case 83: // s toggleSearch(); break; case 80: // p togglePrefs(); break; case 68: // d toggleDebug(); break; case 67: // c toggleCollapse(); break; case 69: // e toggleExpand(); break; case 72: // h toggleHelp(); break; case 82: // r reloadSearch(); break; case 33: // pgup lastScroll=getScrollTop(); procScroll=1; break; case 34: // pgdown lastScroll=getScrollTop(); procScroll=1; break; } } // Fix for browsers (I'm looking at you, Safari) that send weird keycodes function fixCode(code) { switch (code) { case 63232: return 38; break; case 63233: return 40; break; case 63234: return 37; break; case 63235: return 39; break; case 63273: return 36; break; case 63275: return 35; break; case 63276: return 33; break; case 63277: return 34; break; } return code; }