/* Vielen Dank an http://www.kryogenix.org/code/browser/searchhi für das Rohscript */                                             /* Modifiziert für Superclix-Partnerprogramme von                                  */
/* Montessori-Shop.de - www.montessori-shop.de 2007                                */
/*Einstellungen **************************************************/
var partnerlink = "http://clix.superclix.de/cgi-bin/tclix.cgi?id="+partner+"&pp=4645&linknr=5057";
var highlightcount = 0;
/*Keyword-Array definieren****************************************/
words = new Array ("schreibübungen schreibschrift","schriftarten schreibschrift","rechnen mit rechenstäbchen","therapeutische materialien","raum lage differenzierung","sielzeug für kindergärten","rechenstäbe rechenwürfel","montersori materialien","Montessoro materialien","pädagogisches lexikon","monrtessori material","montessorri material","mopntessori material","montersorie material","montesssori-material","sandpapierbuchstaben","monzessori material","motessorie material","montesorri material","montesorie material","montisouri material","montesoori material","reformpädagogisches","montesurri material","material montesorie","trinomischer würfel","geometrische körper","montessori-material","montesouru material","montessorr material","montessoir material","motessori material","mondisori material","binomischer würfel","motessori-material","montssori material","motessori material","montesori material","montessor material","logopädie material","wärmeleittäfelchen","numerische stangen","montessuri schulen","montesorrimaterial","montesori-material","montesouri-schule","montessuri-schule","nickitin material","monetssori verein","monessorimaterial","montessori schule","reformpädagogisch","maria montessorri","maria montesorrie","maria montesourie","nikitin-material","schulausstattung","nikitin material","maria montessuri","muskelgedächtnis","montessurie shop","maria montesouri","montesorie spiel","rechtschreibung","pythagorasbrett","montesory spiel","Bildungsangebot","reformpädagogik","motesuri schule","montesorie shop","montesorischule","maria montesuri","maria monessori","montesorridshop","einsatzzylinder","perlenmaterial","rechenstäbchen","motessori shop","schwungübungen","arbeitsblätter","montesuri-shop","lern speilzeug","montesori shop","sinnesmaterial","hunderterbrett","lernspielwaren","nikin material","uhrzeit lernen","sandbuchstaben","mengenstempel","mountessourie","spielmaterial","spindelkasten","multipliziern","geräuschdosen","übungsblätter","rechenaufgabe","rechenrahmen","seguintafeln","rechenstühen","musterwürfel","subtrahieren","kinderspiele","kindergarten","kinderspiel","Kleinkinder","pustespiele","jahreskreis","lern-verlag","montesourie","Grundschule","montessouti","montessouri","monterssori","montesorrie","monte sorie","leermittel","erzieherin","montesorri","monzesorri","montesoori","montessory","montissori","fühlzahlen","tastwürfel","dividieren","montesurie","wortschatz","lehrmittel","kinderhaus","Spielwaren","einmaleins","montesouri","montesorry","montessori","muntesurie","montessuri","lernspiele","freiarbeit","montessore","montesorie","spielzeug","geometrie","montesory","bankspiel","monessori","montssori","klangmemo","logopädie","motessori","montesore","geowürfel","montesori","montesuri","pädagogik","motesori","erzieher","lehrerin","pädagoge","geobrett","addieren","fühlmemo","therapie","fühlbuch","Bildung","spielen","freinet","nikitin","lernuhr","lernen","lehrer","schule","kinder","fröbel","Spiel","Kind","Montessori");/*Text-Array definieren*******************************************/
monti_text = new Array();
monti_text[0]="Mehr Infos zu";
monti_text[1]="Erfahren Sie mehr zu";
monti_text[2]="Alles zum Thema";
monti_text[3]="Mehr Wissen zu";
monti_text[4]="Jetzt Info zu";
/**Styles schreiben***********************************************/
document.write("<style>");
document.write("#monti_head {font-family: \"Arial, Helvetica, Verdana\"; font-weight: bold; font-size: 13px}");
document.write("#monti_base {font-family: \"Arial, Helvetica, Verdana\"; font-weight: normal; font-size: 12px}");
document.write (".searchword {border-top-width: "+borderwidth+" px; border-bottom-width: "+borderwidth+" px; border-left-width: 0px; border-right-width: 0px; border-style:dashed; text-decoration: none; border-color:"+bordercol+"}");
document.write("a.monti_exit {font-family: \"Arial, Helvetica, Verdana\"; font-weight: bold; text-decoration: none; font-size: 12px; color: #000000}");
document.write("</style>");
/*Layer in document schreiben*************************************************/
document.writeln("<div id=\"montistick\" style=\"position:absolute; top:0px; left500px; z-index:500; width:150px; height:100px; background-color:#FFFFFF; margin:0px; padding:0px; border-width:1px; border-style:solid; border-color:dark-grey;visibility: hidden\">");
document.writeln("<table width='100%' cellspacing=0; cellpadding=2><tr style='background-color:#FF9850' valign='top'><td><A href='"+partnerlink+"' target='_blank'><span id='monti_head'></span></A></td><td><a href='javascript:hidesticky()' class='monti_exit'>x</A></td></tr><tr colspan='2'><td><A href='"+partnerlink+"' target='_blank'><span id='monti_base'></span></a></td></tr></table></div>");
document.writeln("<div id=\"montistickback\" style=\"position:absolute; top:0px; left:500px; z-index:499; width:150px; height:100px; background-color:#7C7B7A; padding:2px; visibility:hidden\">");
document.writeln("</div>");
/*Maus-Pos prüfen**************************************************/
document.onmousemove = updateMOUSE;
function updateMOUSE(e)
{
	mostx = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	mosty = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;

}
/*Funktion Layer anzeigen******************************************/
function showsticky(word)
{
document.getElementById ("montistick").style.top = mosty;
document.getElementById ("montistick").style.left = mostx;
document.getElementById ("montistickback").style.top = mosty+5;
document.getElementById ("montistickback").style.left = mostx+5;
document.getElementById ("montistickback").style.visibility = "visible";
document.getElementById("monti_head").innerHTML = word;
monti_zuftext = Math.round(monti_text.length*(Math.random()));
if (monti_zuftext >=monti_text.length)
   {
   monti_zuftext = monti_text.length-1;
   }
document.getElementById("monti_base").innerHTML = monti_text[monti_zuftext]+" "+word+".";
document.getElementById ("montistick").style.visibility = "visible";
if (runtimeout)
{
window.clearTimeout(runtimeout);
delete runtimeout;
}
var runtimeout = window.setTimeout("hidesticky()", 9000);
}
/*Function Layer weg**********************************************/
function hidesticky()
{
document.getElementById("montistick").style.visibility = "hidden";
document.getElementById("montistickback").style.visibility = "hidden";
}
/*HIGHLIGHT Funktion**********************************************/
function highlightWord(node,word) {
	// Iterate into this nodes childNodes
	if (node.hasChildNodes) {
		var hi_cn;
		for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
			highlightWord(node.childNodes[hi_cn],word);
		}
	}
	
	// And do this node itself
	if (node.nodeType == 3)
        { // text node
		tempNodeVal = node.nodeValue.toLowerCase();
		tempWordVal = word.toLowerCase();
		if (tempNodeVal.indexOf(tempWordVal) != -1)
        {
		pn = node.parentNode;
		if (pn.className != "searchword" && pn.nodeName !="A" && pn.nodeName !="H1" && highlightcount < maxhighlight)
            {
			// word has not already been highlighted!
				nv = node.nodeValue;
    			ni = tempNodeVal.indexOf(tempWordVal);
				// Create a load of replacement nodes
				before = document.createTextNode(nv.substr(0,ni));
				docWordVal = nv.substr(ni,word.length);
				after = document.createTextNode(nv.substr(ni+word.length));
				hiwordtext = document.createTextNode(docWordVal);
				hiword = document.createElement("a");
				hiword.className = "searchword";
				hiword.href = partnerlink;
				hiword.onmouseover = function() { showsticky(word); return false; };
                hiword.appendChild(hiwordtext);
				pn.insertBefore(before,node);
				pn.insertBefore(hiword,node);
				pn.insertBefore(after,node);
				pn.removeChild(node);
				highlightcount++;
			}
		}
	}
}
/*Dokument-Suche starten******************************************************/
function DoHighlight()
{
if (!document.createElement) return;
var w=0;
while (w < words.length)
 {
  highlightWord(document.getElementsByTagName("body")[0],words[w]);
  if (highlightcount >= maxhighlight)
     {
     break;
     } 
  w++;
 }
}
/*Onload ausführen************************************************************/
window.onload = DoHighlight;
