var tooltiparray = new Array ("4","5","6","7","8") // ids var tooltiptextarray = new Array ("ניקוטין","ראות","סרטן","עיטרן","האגודה למלחמה בסרטן") // names to search and display tooltip for them var tooltipbodyarray = new Array ("הניקוטין הוא החומר בסיגריה הגורם להתמכרות\n\n","ריאה, איבר הנשימה. תפקידה העיקרי הוא שחלוף הגזים חמצן ופחמן דו-חמצני בין האוויר לבין הדם. בבני אדם נמצאות שתי ריאות בחלל בית החזה, והן חלק מדרכי הנשימה (המסלול שבו האוויר חודר לגוף) הכוללות את האף, הפה, הקנה, הסימפונות והריאות.","סרטן, קבוצת מחלות המאופיינת בגידול בלתי מבוקר של תאים, תוך נטייה לחדור לרקמות בריאות ולהתפשט למקומות אחרים בגוף. ללא טיפול סופה בדרך כלל מוות. יותר מ-100 סוגים של מחלה זו מופיעים אצל האדם. לא לכל סרטן תכונה של ממאירות אבל בלשון הדיבור כשאומרים סתם סרטן מתכוונים לגידול ממאיר. השם סרטן ניתן למחלה זו משום שחתך של גידול סרטני בשד יש לו צורת עקרב או סרטן.","עיטרן=זפת. הזפת הוא שם כללי לחומרים המזיקים בסיגריה","\nהאגודה למלחמה בסרטן, העמותה ההתנדבותית הגדולה ביותר בישראל, הוקמה בשנת 1952 מאז, היא מובילה את המאבק במחלות הסרטן בישראל ופועלת בכל החזיתות במטרה להפחית את התחלואה והתמותה מסרטן בישראל. המאבק במחלת הסרטן נוגע לכלל הציבור במדינת ישראל. ההתמודדות עם מחלת הסרטן מהווה יעד לאומי מן הדרגה הראשונה ולכן פעילויות האגודה למלחמה בסרטן חשובות ורלוונטיות לכלל הציבור - בריאים וחולים. פעילות האגודה מתאפשרת הודות לתרומות הציבור וללא מימון מתקציב משרד ממשלתי כלשהו.") // the tooltip text document.onreadystatechange=fnStartInit; function fnStartInit() { if (document.readyState=="complete") { // add the tootips texts to the HTML var TollTipHolder= document.createElement("") var ToolTipHolderText = "" for (var i=0 ;i" + tooltipbodyarray[i] + "" } TollTipHolder.innerHTML = ToolTipHolderText document.body.insertBefore(TollTipHolder); // get all elemets from the html that i need to do the text replacement var rcontent = "" var elem for (var i=0 ;i<, !\@#$%^&*()-\/\\\t`~;'"]/ while (inTextSearch.indexOf(inWordSearch,startSearchAt) != -1) { // alert (inText.indexOf(inWord,startSearchAt)) startSearchAt = inTextSearch.indexOf(inWordSearch,startSearchAt) + 1 // i need to check if it's a stand alone text charBefore = new String(inTextSearch.charAt(startSearchAt -2)) charAfter = new String(inTextSearch.charAt(startSearchAt+inWordSearch.length -1)) // first or is if its the first word in the string only next char should be empty // OR if it's in the middle both chars should be empty // OR if it's the last word then only before char should be empty // i dont handle a single word check if ((startSearchAt==1 && blankre.test(charAfter)) || (startSearchAt>0 && blankre.test(charBefore) && blankre.test(charAfter)) || ((startSearchAt + inWord.length)-1==inTextSearch.length && blankre.test(charBefore))) { // it's word in the sentance // now i'm checking that i'm not within an html tag openHtmlBefore = inText.lastIndexOf("<",startSearchAt) closeHtmlBefore = inText.lastIndexOf(">",startSearchAt) openHtmlAfter = inText.indexOf("<",startSearchAt) closeHtmlAfter = inText.indexOf(">",startSearchAt) if (!( openHtmlBefore > -1 && openHtmlBefore > closeHtmlBefore && closeHtmlAfter > -1 && ( (openHtmlAfter == -1) || (openHtmlAfter > closeHtmlAfter ) ) )) { // ok i have a word now i need to put it into the transfer // alert (inTextSearch.substring(lastStartIs + inWordSearch.length-1,startSearchAt+inWordSearch.length-1)) //outText+= inText.substring(lastStartIs +inWordSearch.length-1,startSearchAt-1) + "*" + inText.substr(startSearchAt-1,inWordSearch.length) + "*"; outText+= inText.substring(lastStartIs +inWordSearch.length-1,startSearchAt-1) + "" + inText.substr(startSearchAt-1,inWordSearch.length) + ""; lastStartIs = startSearchAt } } else { // alert ("word not maching * " + (startSearchAt+inWord.length) + " * " + inText.length + " * " + charBefore + " * " + charAfter) } // i have the text now i need to check if im not in a tag : "<" tag ">" // alert (openHtmlBefore + " * " + closeHtmlBefore + " * " + openHtmlAfter + " * " + closeHtmlAfter + " * " ) } if (lastStartIs <=0) //did nothing outText = inText else { if (lastStartIs + inWordSearch.length -1 < inTextSearch.length) { //i need to add the last part outText+= inText.substring(lastStartIs +inWordSearch.length-1,inText.length) } } //alert (outText + "\n" + inText + "\n" + startSearchAt + "\n" + lastStartIs + "\n" +inText.length) return outText } function HideTip(elemid) { var myelem = document.getElementById("oTipZ"+elemid); myelem.style.display = "none"; } function ShowTip(elemid) { var oBody = window.document.body; var iOffsetX = window.event.x - 10; var iOffsetY = window.event.y + 18; var myelem = document.getElementById("oTipZ"+elemid); myelem.style.position = "absolute"; myelem.style["padding"] = "0 2 0 2"; myelem.style["backgroundColor"] = "#ffffe7"; myelem.style["borderStyle"] = "solid"; myelem.style["borderWidth"] = "1px"; myelem.style["borderColor"] = "black"; myelem.style["color"] = "black"; var iOffsetW = parseInt(myelem.style.width); var iOffsetH = parseInt(myelem.style.height); // Set the horizontal position of the tooltip if (iOffsetX + iOffsetW > oBody.clientWidth) { myelem.style.left = oBody.clientWidth + oBody.scrollLeft - iOffsetW; } else myelem.style.left = iOffsetX + oBody.scrollLeft; // Set the vertical position of the tooltip if (iOffsetY + iOffsetH > oBody.offsetHeight) { myelem.style.top = oBody.clientHeight + oBody.scrollTop - iOffsetH; } else myelem.style.top = iOffsetY + oBody.scrollTop; // Make the tooltip visible myelem.style.display = "block"; }