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+" - "+450) if(widthpx>=450) { 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] = "Stocks climb on hopes for Greece debt assistance (AP)"; theSiteLinks[0] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/stocks_climb_on_hopes_for_greece_debt_assistance"; theSummaries[1] = "Parade to give another jolt of Saints euphoria (AP)"; theSiteLinks[1] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/parade_to_give_another_jolt_of_saints_euphoria"; theSummaries[2] = "ADV: Win a Apple MacBook 13-inch Notebook Computer Now"; theSiteLinks[2] = "http://tickermyfeed.com/adv.php/NTk="; theSummaries[3] = "Nigerian parliament votes to suspend ailing president (AFP)"; theSiteLinks[3] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/nigerian_parliament_votes_to_suspend_ailing_president"; theSummaries[4] = "Toyota adds new Prius to global recall list (Reuters)"; theSiteLinks[4] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_adds_new_prius_to_global_recall_list"; theSummaries[5] = "ADV: Add a Breaking News Ticker to Your Web Browser"; theSiteLinks[5] = "http://tickermyfeed.com/adv.php/NTg="; 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] = "John Murtha, defense appropriations chair, dies (Reuters)"; theSiteLinks[7] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/john_murtha_defense_appropriations_chair_dies"; theSummaries[8] = "U.S. missionary in Haiti says trusts God to free her (Reuters)"; theSiteLinks[8] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/us_missionary_in_haiti_says_trusts_god_to_free_her"; theSummaries[9] = "Weather closes government offices a second day (Reuters)"; theSiteLinks[9] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/weather_closes_government_offices_a_second_day"; theSummaries[10] = "Iran says starts making 20 percent nuclear fuel (Reuters)"; theSiteLinks[10] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/iran_says_starts_making_20_percent_nuclear_fuel"; theSummaries[11] = "Rapper Lil Wayne to be sentenced in NYC gun case (AP)"; theSiteLinks[11] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/rapper_lil_wayne_to_be_sentenced_in_nyc_gun_case"; theSummaries[12] = "NATO to Afghan assault villagers: keep heads down (Reuters)"; theSiteLinks[12] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/nato_to_afghan_assault_villagers_keep_heads_down"; theSummaries[13] = "Astronauts inspect shuttle on way to space station (AP)"; theSiteLinks[13] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/astronauts_inspect_shuttle_on_way_to_space_station"; theSummaries[14] = "US Army closes in on south Afghan town (AP)"; theSiteLinks[14] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/us_army_closes_in_on_south_afghan_town"; theSummaries[15] = "Toyota recalls 437,000 Priuses, hybrids globally (AP)"; theSiteLinks[15] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_recalls_437000_priuses_hybrids_globally"; theSummaries[16] = "State Farm says it warned NHTSA on Toyota in 2007 (AP)"; theSiteLinks[16] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/state_farm_says_it_warned_nhtsa_on_toyota_in_2007"; theSummaries[17] = "Another major storm headed to snowy Mid-Atlantic (AP)"; theSiteLinks[17] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/another_major_storm_headed_to_snowy_mid-atlantic"; theSummaries[18] = "Defiant Iran accelerates nuclear program (AP)"; theSiteLinks[18] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/defiant_iran_accelerates_nuclear_program"; theSummaries[19] = "Toyota announces mass hybrid vehicle recall (AFP/File)"; theSiteLinks[19] = "http://tickermyfeed.com/news.php/MHx8ZnJlZQ==/toyota_announces_mass_hybrid_vehicle_recall"; 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('
'); document.write(''); document.write('| '); document.write(''); document.write(' |