function insertAfter(node, referenceNode) { referenceNode.parentNode.insertBefore(node, referenceNode.nextSibling); } function loadGrins() { var grinsDiv = document.createElement('div'); grinsDiv.id = 'wp_grins'; grinsDiv.innerHTML = ':mrgreen: :neutral: :twisted: :arrow: :shock: :smile: :???: :cool: :evil: :grin: :idea: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: :!: :?: '; if ($('postdiv')) { var type = 'child'; var node = $('postdiv'); } else if (document.getElementById('postdivrich')) { var type = 'child'; var node = $('postdivrich'); } else if (document.getElementById('comment')) { var type = 'before'; var node = $('comment'); } else { return; } switch (type) { case 'child': grinsDiv.style.paddingTop = '5px'; node.appendChild(grinsDiv); break; case 'before': node.parentNode.insertBefore(grinsDiv, node); break; } } Event.observe(window, 'load', loadGrins, false); function grin(tag) { var myField; if ($('content') && $('content').type == 'textarea') { myField = document.getElementById('content'); if ($('postdivrich') && typeof tinyMCE != 'undefined' && (!$('edButtons') || $('quicktags').style.display == 'none')) { tinyMCE.execInstanceCommand('mce_editor_0', 'mceInsertContent', false, ' ' + tag + ' '); tinyMCE.selectedInstance.repaint(); return; } } else if ($('comment') && $('comment').type == 'textarea') { myField = $('comment'); } else { return false; } if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = ' ' + tag + ' '; myField.focus(); } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var cursorPos = endPos; myField.value = myField.value.substring(0, startPos) + ' ' + tag + ' ' + myField.value.substring(endPos, myField.value.length); cursorPos += tag.length + 2; myField.focus(); myField.selectionStart = cursorPos; myField.selectionEnd = cursorPos; } else { myField.value += tag; myField.focus(); } } /* FILE ARCHIVED ON 10:35:52 Sep 27, 2009 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 05:57:44 Apr 28, 2017. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */