function getbyid(id) { itm = null; if (document.getElementById) { itm = document.getElementById(id); } else if (document.all) { itm = document.all[id]; } else if (document.layers) { itm = document.layers[id]; } return itm; } function hide_div(itm) { if ( ! itm ) return; itm.style.display = "none"; } function show_div(itm) { if ( ! itm ) return; itm.style.display = ""; } function resizeTextarea(itm,direction) { var txtarea = document.getElementById(itm); if (direction == 'down') { txtarea.rows = txtarea.rows + 3; } else { txtarea.rows = txtarea.rows - 3; } } function openCentered(theURL,winName,winWidth,winHeight,features) { var w = (screen.width - winWidth)/2; var h = (screen.height - winHeight)/2 - 30; features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w; window.open(theURL,winName,features); } function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)'); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } return classElements; } function toggleview(id) { if ( ! id ) return; if ( itm = getbyid('options_' + id + '_open') ) { if (itm.style.display == "none") { show_div(itm); itmtext = getbyid('options_' + id); itmtext.innerHTML = 'hide options'; } else { hide_div(itm); itmtext = getbyid('options_' + id); itmtext.innerHTML = 'show options'; } } }