/*
	tagScanner
	- A TrueTyper tool
	-------------------------------------------------------
	Copyright (c) 2006 mittermayr.com	
       software@mittermayr.com
*/
/*
  This file is based on the ploneCustom.css.dtml shipped with Plone.

   (do not remove this)
   (not this either)

*/

var graphicTag = 'h6';

function tagScanner()
{
  if(document.getElementsByTagName && document.createElement)
  {
      allTags = document.getElementsByTagName(graphicTag);
      scanandreplace(allTags, graphicTag);
  }
}
  
function scanandreplace(allTags,tag)
{
  for(i=0;i<allTags.length;i++)
  {
   thisTag=allTags[i];      
   if (thisTag.firstChild && String(thisTag.firstChild.nodeValue) != 'null') {
      // splits by words so that it can wrap onto more than one line
      var elements = thisTag.firstChild.nodeValue.split(' ');
      new_text = '';
      for (var j = 0; j < elements.length; j++) {
	 if (elements[j].length) {
            new_text = new_text + '<img src="http://wrj.org/TrueTyper?outputText='+escape(elements[j])+'" alt="'+elements[j].replace('"', '&quot;')+'" /> '
	 }
      }
      thisTag.innerHTML = new_text;
    }
  }
}
  
window.onload=tagScanner;

/*  */
