<script>
<!--
document.write(unescape("%0A//%20JavaScript%20Document%0Afunction%20com_stewartspeak_replacement%28%29%20%7B%0A/*%0A%09Dynamic%20Heading%20Generator%0A%20%20%20%20By%20Stewart%20Rosenberger%0A%20%20%20%20http%3A//www.stewartspeak.com/headings/%0A%0A%09This%20script%20searches%20through%20a%20web%20page%20for%20specific%20or%20general%20elements%0A%09and%20replaces%20them%20with%20dynamically%20generated%20images%2C%20in%20conjunction%20with%0A%09a%20server-side%20script.Code%20standard%0A*/%0A%0A%0AreplaceSelector%28%22h2%22%2C%22font.php%22%2Ctrue%29%3B%0Avar%20testURL%20%3D%20%22skins/pink/styleImages/mail.gif%22%20%3B%0A%0Avar%20doNotPrintImages%20%3D%20false%3B%0A%0Avar%20hideFlicker%20%3D%20false%3B%0Avar%20hideFlickerTimeout%20%3D%201000%3B%0A%0A%0A%0A%0A/*%20---------------------------------------------------------------------------%0A%20%20%20%20For%20basic%20usage%2C%20you%20should%20not%20need%20to%20edit%20anything%20below%20this%20comment.%0A%20%20%20%20If%20you%20need%20to%20further%20customize%20this%20script%27s%20abilities%2C%20make%20sure%0A%09you%27re%20familiar%20with%20Javascript.%20And%20grab%20a%20soda%20or%20something.%20Code%20standard.%0A*/%0A%0Avar%20items%3B%0Avar%20imageLoaded%20%3D%20false%3B%0Avar%20documentLoaded%20%3D%20false%3B%0A%0Afunction%20replaceSelector%28selector%2Curl%2Cwordwrap%29%0A%7B%0A%09if%28typeof%20items%20%3D%3D%20%22undefined%22%29%0A%09%09items%20%3D%20new%20Array%28%29%3B%0A%0A%09items%5Bitems.length%5D%20%3D%20%7Bselector%3A%20selector%2C%20url%3A%20url%2C%20wordwrap%3A%20wordwrap%7D%3B%0A%7D%0A%0Aif%28hideFlicker%29%0A%7B%09%09%0A%09document.write%28%27%0A%09%3Clink%20id%3D%22hide-flicker%22%20rel%3D%22stylesheet%22%20media%3D%22screen%22%20href%3D%22%27%20+%20hideFlickerCSS%20+%20%27%22%20/%3E%27%29%3B%09%09%0A%09window.flickerCheck%20%3D%20function%28%29%0A%09%7B%0A%09%09if%28%21imageLoaded%29%0A%09%09%09setStyleSheetState%28%27hide-flicker%27%2Cfalse%29%3B%0A%09%7D%3B%0A%09setTimeout%28%27window.flickerCheck%28%29%3B%27%2ChideFlickerTimeout%29%0A%7D%0A%0Aif%28doNotPrintImages%29%0A%09document.write%28%27%3Clink%20id%3D%22print-text%22%20rel%3D%22stylesheet%22%20media%3D%22print%22%20href%3D%22%27%20+%20printerCSS%20+%20%27%22%20/%3E%27%29%3B%0A%0Avar%20test%20%3D%20new%20Image%28%29%3B%0Atest.onload%20%3D%20function%28%29%20%7B%20imageLoaded%20%3D%20true%3B%20if%28documentLoaded%29%20replacement%28%29%3B%20%7D%3B%0Atest.src%20%3D%20testURL%20+%20%22%3Fdate%3D%22%20+%20%28new%20Date%28%29%29.getTime%28%29%3B%0A%0AaddLoadHandler%28function%28%29%7B%20documentLoaded%20%3D%20true%3B%20if%28imageLoaded%29%20replacement%28%29%3B%20%7D%29%3B%0A%0A%0Afunction%20documentLoad%28%29%0A%7B%0A%09documentLoaded%20%3D%20true%3B%0A%09if%28imageLoaded%29%0A%09%09replacement%28%29%3B%0A%7D%0A%0Afunction%20replacement%28%29%0A%7B%0A%09for%28var%20i%3D0%3Bi%3Citems.length%3Bi++%29%0A%09%7B%0A%09%09var%20elements%20%3D%20getElementsBySelector%28items%5Bi%5D.selector%29%3B%0A%09%09if%28elements.length%20%3E%200%29%20for%28var%20j%3D0%3Bj%3Celements.length%3Bj++%29%0A%09%09%7B%0A%09%09%09if%28%21elements%5Bj%5D%29%0A%09%09%09%09continue%20%3B%0A%09%09%0A%09%09%09var%20text%20%3D%20extractText%28elements%5Bj%5D%29%3B%0A%20%20%20%20%09%09while%28elements%5Bj%5D.hasChildNodes%28%29%29%0A%09%09%09%09elements%5Bj%5D.removeChild%28elements%5Bj%5D.firstChild%29%3B%0A%0A%09%09%09var%20tokens%20%3D%20items%5Bi%5D.wordwrap%20%3F%20text.split%28%27%20%27%29%20%3A%20%5Btext%5D%20%3B%0A%09%09%09for%28var%20k%3D0%3Bk%3Ctokens.length%3Bk++%29%0A%09%09%09%7B%0A%09%09%09%09var%20url%20%3D%20items%5Bi%5D.url%20+%20%22%3Ftext%3D%22+escape%28tokens%5Bk%5D+%27%20%27%29+%22%26selector%3D%22+escape%28items%5Bi%5D.selector%29%3B%0A%09%09%09%09var%20image%20%3D%20document.createElement%28%22img%22%29%3B%0A%09%09%09%09image.className%20%3D%20%22replacement%22%3B%0A%09%09%09%09image.alt%20%3D%20tokens%5Bk%5D%20%3B%0A%09%09%09%09image.src%20%3D%20url%3B%0A%09%09%09%09elements%5Bj%5D.appendChild%28image%29%3B%0A%09%09%09%7D%0A%0A%09%09%09if%28doNotPrintImages%29%0A%09%09%09%7B%0A%09%09%09%09var%20span%20%3D%20document.createElement%28%22span%22%29%3B%0A%09%09%09%09span.style.display%20%3D%20%27none%27%3B%0A%09%09%09%09span.className%20%3D%20%22print-text%22%3B%0A%09%09%09%09span.appendChild%28document.createTextNode%28text%29%29%3B%0A%09%09%09%09elements%5Bj%5D.appendChild%28span%29%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09if%28hideFlicker%29%0A%09%09setStyleSheetState%28%27hide-flicker%27%2Cfalse%29%3B%0A%7D%0A%0Afunction%20addLoadHandler%28handler%29%0A%7B%0A%09if%28window.addEventListener%29%0A%09%7B%0A%09%09window.addEventListener%28%22load%22%2Chandler%2Cfalse%29%3B%0A%09%7D%0A%09else%20if%28window.attachEvent%29%0A%09%7B%0A%09%09window.attachEvent%28%22onload%22%2Chandler%29%3B%0A%09%7D%0A%09else%20if%28window.onload%29%0A%09%7B%0A%09%09var%20oldHandler%20%3D%20window.onload%3B%0A%09%09window.onload%20%3D%20function%20piggyback%28%29%0A%09%09%7B%0A%09%09%09oldHandler%28%29%3B%0A%09%09%09handler%28%29%3B%0A%09%09%7D%3B%0A%09%7D%0A%09else%0A%09%7B%0A%09%09window.onload%20%3D%20handler%3B%0A%09%7D%0A%7D%0A%0Afunction%20setStyleSheetState%28id%2Cenabled%29%20%0A%7B%0A%09var%20sheet%20%3D%20document.getElementById%28id%29%3B%0A%09if%28sheet%29%0A%09%09sheet.disabled%20%3D%20%28%21enabled%29%3B%0A%7D%0A%0Afunction%20extractText%28element%29%0A%7B%0A%09if%28typeof%20element%20%3D%3D%20%22string%22%29%0A%09%09return%20element%3B%0A%09else%20if%28typeof%20element%20%3D%3D%20%22undefined%22%29%0A%09%09return%20element%3B%0A%09else%20if%28element.innerText%29%0A%09%09return%20element.innerText%3B%0A%0A%09var%20text%20%3D%20%22%22%3B%0A%09var%20kids%20%3D%20element.childNodes%3B%0A%09for%28var%20i%3D0%3Bi%3Ckids.length%3Bi++%29%0A%09%7B%0A%09%09if%28kids%5Bi%5D.nodeType%20%3D%3D%201%29%0A%09%09text%20+%3D%20extractText%28kids%5Bi%5D%29%3B%0A%09%09else%20if%28kids%5Bi%5D.nodeType%20%3D%3D%203%29%0A%09%09text%20+%3D%20kids%5Bi%5D.nodeValue%3B%0A%09%7D%0A%0A%09return%20text%3B%0A%7D%0A%0A/*%0A%09Code%20standard.Finds%20elements%20on%20page%20that%20match%20a%20given%20CSS%20selector%20rule.%20Some%0A%09complicated%20rules%20are%20not%20compatible.%0A%09Based%20on%20Simon%20Willison%27s%20excellent%20%22getElementsBySelector%22%20function.%0A%09Original%20code%20%28with%20comments%20and%20description%29%3A%0A%09%09http%3A//simon.incutio.com/archive/2003/03/25/getElementsBySelector%0A*/%0Afunction%20getElementsBySelector%28selector%29%0A%7B%0A%09var%20tokens%20%3D%20selector.split%28%27%20%27%29%3B%0A%09var%20currentContext%20%3D%20new%20Array%28document%29%3B%0A%09for%28var%20i%3D0%3Bi%3Ctokens.length%3Bi++%29%0A%09%7B%0A%09%09token%20%3D%20tokens%5Bi%5D.replace%28/%5E%5Cs+/%2C%27%27%29.replace%28/%5Cs+%24/%2C%27%27%29%3B%0A%09%09if%28token.indexOf%28%27%23%27%29%20%3E%20-1%29%0A%09%09%7B%0A%09%09%09var%20bits%20%3D%20token.split%28%27%23%27%29%3B%0A%09%09%09var%20tagName%20%3D%20bits%5B0%5D%3B%0A%09%09%09var%20id%20%3D%20bits%5B1%5D%3B%0A%09%09%09var%20element%20%3D%20document.getElementById%28id%29%3B%0A%09%09%09if%28tagName%20%26%26%20element.nodeName.toLowerCase%28%29%20%21%3D%20tagName%29%0A%09%09%09%09return%20new%20Array%28%29%3B%0A%09%09%09currentContext%20%3D%20new%20Array%28element%29%3B%0A%09%09%09continue%3B%0A%09%09%7D%0A%0A%09%09if%28token.indexOf%28%27.%27%29%20%3E%20-1%29%0A%09%09%7B%0A%09%09%09var%20bits%20%3D%20token.split%28%27.%27%29%3B%0A%09%09%09var%20tagName%20%3D%20bits%5B0%5D%3B%0A%09%09%09var%20className%20%3D%20bits%5B1%5D%3B%0A%09%09%09if%28%21tagName%29%0A%09%09%09%09tagName%20%3D%20%27*%27%3B%0A%0A%09%09%09var%20found%20%3D%20new%20Array%3B%0A%09%09%09var%20foundCount%20%3D%200%3B%0A%09%09%09for%28var%20h%3D0%3Bh%3CcurrentContext.length%3Bh++%29%0A%09%09%09%7B%0A%09%09%09%09var%20elements%3B%0A%09%09%09%09if%28tagName%20%3D%3D%20%27*%27%29%0A%09%09%09%09%09elements%20%3D%20currentContext%5Bh%5D.all%20%3F%20currentContext%5Bh%5D.all%20%3A%20currentContext%5Bh%5D.getElementsByTagName%28%27*%27%29%3B%0A%09%09%09%09else%0A%09%09%09%09%09elements%20%3D%20currentContext%5Bh%5D.getElementsByTagName%28tagName%29%3B%0A%0A%09%09%09%09for%28var%20j%3D0%3Bj%3Celements.length%3Bj++%29%0A%09%09%09%09%09found%5BfoundCount++%5D%20%3D%20elements%5Bj%5D%3B%0A%09%09%09%7D%0A%0A%09%09%09currentContext%20%3D%20new%20Array%3B%0A%09%09%09var%20currentContextIndex%20%3D%200%3B%0A%09%09%09for%28var%20k%3D0%3Bk%3Cfound.length%3Bk++%29%0A%09%09%09%7B%0A%09%09%09%09if%28found%5Bk%5D.className%20%26%26%20found%5Bk%5D.className.match%28new%20RegExp%28%27%5C%5Cb%27+className+%27%5C%5Cb%27%29%29%29%0A%09%09%09%09%09currentContext%5BcurrentContextIndex++%5D%20%3D%20found%5Bk%5D%3B%0A%09%09%09%7D%0A%0A%09%09%09continue%3B%0A%09%20%20%20%20%7D%0A%0A%09%09if%28token.match%28/%5E%28%5Cw*%29%5C%5B%28%5Cw+%29%28%5B%3D%7E%5C%7C%5C%5E%5C%24%5C*%5D%3F%29%3D%3F%22%3F%28%5B%5E%5C%5D%22%5D*%29%22%3F%5C%5D%24/%29%29%0A%09%09%7B%0A%09%09%09var%20tagName%20%3D%20RegExp.%241%3B%0A%09%09%09var%20attrName%20%3D%20RegExp.%242%3B%0A%09%09%09var%20attrOperator%20%3D%20RegExp.%243%3B%0A%09%09%09var%20attrValue%20%3D%20RegExp.%244%3B%0A%09%09%09if%28%21tagName%29%0A%09%09%09%09tagName%20%3D%20%27*%27%3B%0A%0A%09%09%09var%20found%20%3D%20new%20Array%3B%0A%09%09%09var%20foundCount%20%3D%200%3B%0A%09%09%09for%28var%20h%3D0%3Bh%3CcurrentContext.length%3Bh++%29%0A%09%09%09%7B%0A%09%09%09%09var%20elements%3B%0A%09%20%20%20%20%20%20%20%20%09if%28tagName%20%3D%3D%20%27*%27%29%0A%09%09%09%09%09elements%20%3D%20currentContext%5Bh%5D.all%20%3F%20currentContext%5Bh%5D.all%20%3A%20currentContext%5Bh%5D.getElementsByTagName%28%27*%27%29%3B%0A%09%09%09%09else%0A%09%09%09%09%09elements%20%3D%20currentContext%5Bh%5D.getElementsByTagName%28tagName%29%3B%0A%0A%09%09%09%09for%28var%20j%3D0%3Bj%3Celements.length%3Bj++%29%0A%09%09%09%09%09found%5BfoundCount++%5D%20%3D%20elements%5Bj%5D%3B%0A%09%09%09%7D%0A%0A%09%09%09currentContext%20%3D%20new%20Array%3B%0A%09%09%09var%20currentContextIndex%20%3D%200%3B%0A%09%09%09var%20checkFunction%3B%0A%09%09%09switch%28attrOperator%29%0A%09%09%09%7B%0A%09%09%09%09case%20%27%3D%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29%20%3D%3D%20attrValue%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09case%20%27%7E%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29.match%28new%20RegExp%28%27%5C%5Cb%27+attrValue+%27%5C%5Cb%27%29%29%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09case%20%27%7C%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29.match%28new%20RegExp%28%27%5E%27+attrValue+%27-%3F%27%29%29%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09case%20%27%5E%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29.indexOf%28attrValue%29%20%3D%3D%200%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09case%20%27%24%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29.lastIndexOf%28attrValue%29%20%3D%3D%20e.getAttribute%28attrName%29.length%20-%20attrValue.length%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09case%20%27*%27%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20%28e.getAttribute%28attrName%29.indexOf%28attrValue%29%20%3E%20-1%29%3B%20%7D%3B%0A%09%09%09%09%09break%3B%0A%09%09%09%09default%20%3A%0A%09%09%09%09%09checkFunction%20%3D%20function%28e%29%20%7B%20return%20e.getAttribute%28attrName%29%3B%20%7D%3B%0A%09%09%09%7D%0A%0A%09%09%09currentContext%20%3D%20new%20Array%3B%0A%09%09%09var%20currentContextIndex%20%3D%200%3B%0A%09%09%09for%28var%20k%3D0%3Bk%3Cfound.length%3Bk++%29%0A%09%09%09%7B%0A%09%09%09%09if%28checkFunction%28found%5Bk%5D%29%29%0A%09%09%09%09%09currentContext%5BcurrentContextIndex++%5D%20%3D%20found%5Bk%5D%3B%0A%09%09%09%7D%0A%0A%09%09%09continue%3B%0A%09%09%7D%0A%0A%09%09tagName%20%3D%20token%3B%0A%09%09var%20found%20%3D%20new%20Array%3B%0A%09%09var%20foundCount%20%3D%200%3B%0A%09%09for%28var%20h%3D0%3Bh%3CcurrentContext.length%3Bh++%29%0A%09%09%7B%0A%09%09%09var%20elements%20%3D%20currentContext%5Bh%5D.getElementsByTagName%28tagName%29%3B%0A%09%09%09for%28var%20j%3D0%3Bj%3Celements.length%3B%20j++%29%0A%09%09%09%09found%5BfoundCount++%5D%20%3D%20elements%5Bj%5D%3B%0A%09%09%7D%0A%0A%09%09currentContext%20%3D%20found%3B%0A%09%7D%0A%0A%09return%20currentContext%3B%0A%7D%0A%0A%0A%7D//%20end%20of%20scope%2C%20execute%20code%0Aif%28document.createElement%20%26%26%20document.getElementsByTagName%20%26%26%20%21navigator.userAgent.match%28/opera%5C/%3F6/i%29%29%0A%09com_stewartspeak_replacement%28%29%3B"));
//-->
</script>