function startTicker() { // Define run time values theCurrentStory = -1; theCurrentLength = 0; tickerPaused = 0; // Locate base objects if (document.getElementById) { theAnchorObject = document.getElementById("tickerAnchor"); theAnchorObjectHid = document.getElementById('tickerAnchorHid'); runTheTicker(); } else { document.write(""); return true; } } var advStart; // Ticker main run loop function runTheTicker() { var myTimeout; // Go for the next story data block if(theCurrentLength == 0) { if (tickerPaused == 1) { setTimeout("runTheTicker()", myTimeout); return; } theCurrentStory++; theCurrentStory = theCurrentStory % theItemCount; var pom = theSummaries[theCurrentStory].replace(/"/g,'"'); pom = pom.replace(/'/g,"'"); pom = pom.replace(/'/g,"'"); var theStorySummaryWIthoutStripped = pom; var stripped = stripHTML(pom); if(stripped == theStorySummaryWIthoutStripped) { theStorySummary = theStorySummaryWIthoutStripped; advStart = 0; thePrefix = ""; thePostfix = ""; } else { theStorySummary = stripped; advStart = theStorySummaryWIthoutStripped.length - stripped.length - 7; thePrefix = theStorySummaryWIthoutStripped.substring(0,advStart); thePostfix = ""; advStart = 0; } theTargetLink = theSiteLinks[theCurrentStory]; theAnchorObject.href = theTargetLink; } // Stuff the current ticker text into the anchor var text = thePrefix + theStorySummary.substring(advStart,theCurrentLength) + whatWidget() + thePostfix; theAnchorObjectHid.innerHTML = text var widthpx = theAnchorObjectHid.offsetWidth //alert(advStart+"; "+widthpx+" - "+796) if(widthpx>=796) { advStart++; advStart++; } var text = thePrefix + theStorySummary.substring(advStart,theCurrentLength) + whatWidget() + thePostfix; theAnchorObject.innerHTML = text // Modify the length for the substring and define the timer if(theCurrentLength != theStorySummary.length) { theCurrentLength++; myTimeout = theCharacterTimeout; } else { theCurrentLength = 0; myTimeout = theStoryTimeout; } // Call up the next cycle of the ticker setTimeout("runTheTicker()", myTimeout); } // Widget generator function whatWidget() { if(theCurrentLength == theStorySummary.length) { return theWidgetNone; } if((theCurrentLength % 2) == 1) { return theWidgetOne; } else { return theWidgetTwo; } } function pauseTicker(){ tickerPaused = 1; } function unpauseTicker(){ tickerPaused = 0; } function stripHTML(value){ var re= /<\S[^><]*>/g; return value.replace(re, ""); } var theCharacterTimeout = 60; var theStoryTimeout = 2000; var theWidgetOne = "_"; var theWidgetTwo = "-"; var theWidgetNone = ""; var theLeadString = ""; // LATEST var theSummaries = new Array(); var theSiteLinks = new Array(); theSummaries[0] = "ADV: Easily Generate Creative Domain Names"; theSiteLinks[0] = "http://tickermyfeed.com/adv.php/Mw=="; theSummaries[1] = "ADV: Add This Ticker to Your Website for Free"; theSiteLinks[1] = "http://tickermyfeed.com/adv.php/NA=="; theSummaries[2] = "ADV: Slide in Banner Exchange for Webmasters"; theSiteLinks[2] = "http://tickermyfeed.com/adv.php/MTE="; theSummaries[3] = "ADV: Automated Link Exchange for Webmasters"; theSiteLinks[3] = "http://tickermyfeed.com/adv.php/MTI="; theSummaries[4] = "ADV: Win a Apple MacBook 13-inch Notebook Computer Now"; theSiteLinks[4] = "http://tickermyfeed.com/adv.php/NTk="; theSummaries[5] = "Still no winner in 6/49 SuperLotto"; theSiteLinks[5] = "http://tickermyfeed.com/news.php/MHx8/still_no_winner_in_6/49_superlotto/?link=aHR0cDovL25ld3NpbmZvLmlucXVpcmVyLm5ldC9icmVha2luZ25ld3MvbmF0aW9uL3ZpZXcvMjAxMDAyMTAtMjUyMjk4L1N0aWxsLW5vLXdpbm5lci1pbi02NDktU3VwZXJMb3R0bw==&title=U3RpbGwgbm8gd2lubmVyIGluIDYvNDkgU3VwZXJMb3R0bw=="; var theItemCount = theSummaries.length; if (window.addEventListener) window.addEventListener("load", startTicker, false) else if (window.attachEvent) window.attachEvent("onload", startTicker) else if (document.getElementById) window.onload=startTicker document.write('
ADV: Easily Generate Creative Domain Names
'); document.write('
ADV: Add This Ticker to Your Website for Free
'); document.write('
ADV: Slide in Banner Exchange for Webmasters
'); document.write('
ADV: Automated Link Exchange for Webmasters
'); document.write('
ADV: Win a Apple MacBook 13-inch Notebook Computer Now
'); document.write(''); document.write('
'); document.write('
'); document.write('
'); document.write('');