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+" - "+700) if(widthpx>=700) { 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] = "Fire consumes 2 Texas churches amid spate of arson (AP)"; theSiteLinks[0] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/fire_consumes_2_texas_churches_amid_spate_of_arson"; theSummaries[1] = "Nigerian parliament votes to suspend ailing president (AFP)"; theSiteLinks[1] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/nigerian_parliament_votes_to_suspend_ailing_president"; theSummaries[2] = "ADV: Add This Ticker to Your Website for Free"; theSiteLinks[2] = "http://tickermyfeed.com/adv.php/NA=="; theSummaries[3] = "John Murtha, defense appropriations chair, dies (Reuters)"; theSiteLinks[3] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/john_murtha_defense_appropriations_chair_dies"; theSummaries[4] = "U.S. missionary in Haiti says trusts God to free her (Reuters)"; theSiteLinks[4] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/us_missionary_in_haiti_says_trusts_god_to_free_her"; theSummaries[5] = "ADV: Slide in Banner Exchange for Webmasters"; theSiteLinks[5] = "http://tickermyfeed.com/adv.php/MTE="; theSummaries[6] = "Taiwan drops request for U.S. military subs: source (Reuters)"; theSiteLinks[6] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/taiwan_drops_request_for_us_military_subs_source"; theSummaries[7] = "Toyota recalls new Prius in latest safety fix (Reuters)"; theSiteLinks[7] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_recalls_new_prius_in_latest_safety_fix"; theSummaries[8] = "ADV: Automated Link Exchange for Webmasters"; theSiteLinks[8] = "http://tickermyfeed.com/adv.php/MTI="; theSummaries[9] = "U.S. wants Iran sanctions in weeks; Russia gets tough (Reuters)"; theSiteLinks[9] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/us_wants_iran_sanctions_in_weeks_russia_gets_tough"; theSummaries[10] = "Toyota announces mass hybrid vehicle recall (AFP)"; theSiteLinks[10] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_announces_mass_hybrid_vehicle_recall"; theSummaries[11] = "ADV: Win a Apple MacBook 13-inch Notebook Computer Now"; theSiteLinks[11] = "http://tickermyfeed.com/adv.php/NTk="; theSummaries[12] = "Toyota recalls 437,000 Priuses, hybrids globally (AP)"; theSiteLinks[12] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_recalls_437000_priuses_hybrids_globally"; theSummaries[13] = "Defiant Iran accelerates nuclear program (AP)"; theSiteLinks[13] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/defiant_iran_accelerates_nuclear_program"; theSummaries[14] = "ADV: Add a Breaking News Ticker to Your Web Browser"; theSiteLinks[14] = "http://tickermyfeed.com/adv.php/NTg="; theSummaries[15] = "Another major storm headed to snowy Mid-Atlantic (AP)"; theSiteLinks[15] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/another_major_storm_headed_to_snowy_mid-atlantic"; theSummaries[16] = "Weather closes government offices a second day (Reuters)"; theSiteLinks[16] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/weather_closes_government_offices_a_second_day"; theSummaries[17] = "FDA aims to rein in radiation-based medical scans (AP)"; theSiteLinks[17] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/fda_aims_to_rein_in_radiation-based_medical_scans"; theSummaries[18] = "Parade to give another jolt of Saints euphoria (AP)"; theSiteLinks[18] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/parade_to_give_another_jolt_of_saints_euphoria"; theSummaries[19] = "US Army closes in on targeted southern Afghan town (AP)"; theSiteLinks[19] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/us_army_closes_in_on_targeted_southern_afghan_town"; 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: 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('
ADV: Add a Breaking News Ticker to Your Web Browser
'); document.write(''); document.write('
'); document.write('
'); document.write('
'); document.write('');