// Breite des Tickers var nt_width = 300; // Grössere Zahlen -> langsamer var nt_speed = 10; // var nt_step = 1; // Positionsangaben des Tickers var posLeft = 0; var posRight = 0; var posTop = 0; // Content aus Datenbank holen var nt_content = 'Giornate soleggiati e notti fresche!! Un estate ideale in montagna!'; var nt_textwidth = 0 var nt_timer = 0; var nt_clipleft = 0; var nt_clipright = 0; var nt_cliptop = 0; var nt_clipbottom = 15; var nt_dom = document.all || document.getElementById?true:false; var nt_actualleft = 0; function fctSetContent(p_left, p_top, p_width, p_height) { posLeft = p_left; posRight = p_width; posTop = p_top; nt_width = p_width; nt_clipbottom = p_height; if(nt_dom) { document.getElementById("eu_ntContent").innerHTML = nt_content; document.getElementById("eu_ntContent").style.position = "absolute"; document.getElementById("eu_ntContent").style.posTop = posTop; document.getElementById("eu_ntContent").style.width = p_width; document.getElementById("eu_ntContent").style.height = p_height; document.getElementById("eu_ntContent").style.overflow = "hidden"; nt_actualleft = p_width; } else { document.eu_ntContent.document.write(''+nt_content); document.eu_ntContent.document.close(); nt_textwidth = document.eu_ntContent.document.width; document.eu_ntContent.top = posTop; document.eu_ntContent.left = posLeft + nt_width; document.eu_ntContent.clip.left = 0; document.eu_ntContent.clip.right = 0; document.eu_ntContent.clip.top = 0; document.eu_ntContent.clip.bottom = nt_clipbottom; } // Add a container to determine the text width var hiddenTempContainer = document.createElement( "span" ); hiddenTempContainer.setAttribute( "ID", "hiddenTempContainer" ); hiddenTempContainer.className = "euNewsTicker"; hiddenTempContainer.style.borderWidth = "1px"; hiddenTempContainer.style.borderStyle = "solid"; hiddenTempContainer.style.borderColor = "#000000"; // Add a text container to determine the text width var hiddenTempText = document.createElement( "FONT" ); hiddenTempText.setAttribute( "ID", "hiddenTempFont" ); hiddenTempText.className = "euNewsTicker"; hiddenTempText.innerHTML = "Giornate soleggiati e notti fresche!! Un estate ideale in montagna!<\/a>"; hiddenTempContainer.appendChild( hiddenTempText ); document.body.appendChild( hiddenTempContainer ); if(document.all) { nt_speed = 10; nt_textwidth = hiddenTempText.scrollWidth; } else { nt_speed = 10; nt_textwidth = hiddenTempText.offsetWidth; } // Hide temp container hiddenTempContainer.style.display = "none"; document.getElementById("eu_ntInnerContent").style.width = nt_textwidth + 10 + "px"; setInterval( "fctScroll()", nt_speed ); } function fctScroll() { if(nt_dom) { /* nt_textwidth = document.getElementById("eu_ntContent").offsetWidth; if (document.getElementById("eu_ntContent").style.posLeft >= posLeft - nt_textwidth) { document.getElementById("eu_ntContent").style.posLeft -= nt_step; nt_clipright += nt_step; if (nt_clipright > nt_width) { nt_clipleft += nt_step; } document.getElementById("eu_ntContent").style.clip = "rect("+nt_cliptop+" "+nt_clipright+" "+nt_clipbottom+" "+nt_clipleft+")"; var nt_timer = setTimeout("fctScroll()",nt_speed); } else { document.getElementById("eu_ntContent").style.posLeft = posLeft + nt_width; nt_clipleft = 0; nt_clipright = 0; document.getElementById("eu_ntContent").style.clip = "rect("+nt_cliptop+" "+nt_clipright+" "+nt_clipbottom+" "+nt_clipleft+")"; fctScroll(); } */ if(document.all) { nt_textwidth = document.getElementById("eu_ntInnerContent").scrollWidth; } else { nt_textwidth = document.getElementById("eu_ntInnerContent").offsetWidth; } //if (nt_actualleft > posLeft - nt_textwidth) if (nt_actualleft > 0 - nt_textwidth) { nt_actualleft -= nt_step; document.getElementById("eu_ntInnerContent").style.left = nt_actualleft + "px"; } else { document.getElementById("eu_ntInnerContent").style.left = posRight + "px"; nt_actualleft = posRight; } } else { if (document.eu_ntContent.left >= posLeft - nt_textwidth) { document.eu_ntContent.left -= nt_step; document.eu_ntContent.clip.right += nt_step; if (document.eu_ntContent.clip.right > nt_width) { document.eu_ntContent.clip.left += nt_step; } var nt_timer=setTimeout("fctScroll()",nt_speed); } else { document.eu_ntContent.left = posLeft + nt_width; document.eu_ntContent.clip.left = 0; document.eu_ntContent.clip.right = 0; fctScroll(); } } }