if(obj.style.background == btnSelected.toLowerCase()) return true; else{ oldColor = obj.style.background; obj.style.background = btnHover; } } function btnMouseOut(obj){ if(obj.style.background == btnSelected.toLowerCase()) return true; obj.style.background = oldColor; } function changePage(obj){ for(i=1;i<footPages.length;i++) footPages[i].style.background = btnColor; obj.style.background = btnSelected; imageList = ''; pageNum = obj.innerHTML.match(/\d+/); if(pageNum != pages){ begin = (pageNum-1)*max; end = pageNum*max - 1; } else{ begin = (pageNum-1)*max; end = imgLinks.length-1; } for(i=begin;i<=end;i++){ imageList += '<div style=\x22border:'+imgBorder+';opacity:'+imgOpacity+';margin:2px;cursor:pointer;width:'+imgWidth+';height:'+imgHeight+';float:left\x22 onmouseover=\x22imgOver(this);\x22 onmouseout=\x22imgOut(this)\x22><table style=\x22width:100%;height:100%\x22><tr><td valign=\x22center\x22 align=\x22center\x22><img style=\x22width:100%\x22 src=\x22' + imgLinks[i] + '\x22 onclick=\x22addFace(this);\x22/></td></tr></table></div>'; } oldDiv = document.getElementById('faceBody'); newDiv = document.createElement('div'); newDiv.id = 'faceBody'; newDiv.setAttribute('style','clear:both;margin-left:1px;margin-top:1px;'); newDiv.innerHTML = imageList; oldDiv.parentNode.replaceChild(newDiv,oldDiv); } function addFace(imgObj){ imgLink = imgObj.src; imgTag = '[img]' + imgLink + '[/img]'; textArea = document.getElementById('message');/*phpbb*/ if(textArea == null || textArea.tagName.toLowerCase() != 'textarea')/*dz7.0.0*/ textArea = document.getElementById('e_textarea'); if(textArea == null || textArea.tagName.toLowerCase() != 'textarea'){/*others*/ textArea = document.getElementsByTagName('textarea'); textArea = textArea[textArea.length-1]; } cursorStart = textArea.selectionStart; cursorEnd = textArea.selectionEnd; textArea.value = textArea.value.slice(0,cursorStart) + imgTag + textArea.value.slice(cursorEnd); textArea.focus(); textArea.selectionStart = cursorStart + imgTag.length; textArea.selectionEnd = cursorEnd + imgTag.length; } function getPageNumWitchZero(num, bit){ var num = '' + num; var zero = '', i = 0; if(num.length >= bit) return num; for(i = 0; i < (bit - num.length); i++){ zero += '0'; } return (zero + num); } window.addEventListener( 'click', function(e){ obj = e.target; while(obj){ if(obj.id && obj.id == 'faceDialog' || obj.nodeName.toLowerCase() == 'textarea') return false; else obj = obj.parentNode; } temp = document.getElementById('faceDialog'); if(temp) temp.parentNode.removeChild(temp); },false ); void(0);
</script>
</body>
</head>