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 = 30; var theStoryTimeout = 6000; var theWidgetOne = "_"; var theWidgetTwo = "-"; var theWidgetNone = ""; var theLeadString = ""; // LATEST var theSummaries = new Array(); var theSiteLinks = new Array(); theSummaries[0] = "Defiant Florida church says Koran burning to go ahead (AFP)"; theSiteLinks[0] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/defiant_florida_church_says_koran_burning_to_go_ahead"; theSummaries[1] = "Health reforms trigger spending shift (Reuters)"; theSiteLinks[1] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/health_reforms_trigger_spending_shift"; theSummaries[2] = "US losing war in Afghanistan: Taliban leader (AFP)"; theSiteLinks[2] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/us_losing_war_in_afghanistan_taliban_leader"; theSummaries[3] = "Appeals court lets government halt torture lawsuit (AP)"; theSiteLinks[3] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/appeals_court_lets_government_halt_torture_lawsuit"; theSummaries[4] = "Economists cut U.S. growth forecast again (Reuters)"; theSiteLinks[4] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/economists_cut_us_growth_forecast_again"; theSummaries[5] = "BP report blames itself, others for oil spill (AP)"; theSiteLinks[5] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/bp_report_blames_itself_others_for_oil_spill"; theSummaries[6] = "Colorado wildfire destroys more than 130 homes (AP)"; theSiteLinks[6] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/colorado_wildfire_destroys_more_than_130_homes"; theSummaries[7] = "Karzai aims to limit foreign role in probes: report (Reuters)"; theSiteLinks[7] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/karzai_aims_to_limit_foreign_role_in_probes_report"; theSummaries[8] = "Seven Mexican gunmen arrested in migrant massacre (Reuters)"; theSiteLinks[8] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/seven_mexican_gunmen_arrested_in_migrant_massacre"; theSummaries[9] = "Highway deaths fall to lowest level since 1950 (AP)"; theSiteLinks[9] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/highway_deaths_fall_to_lowest_level_since_1950"; theSummaries[10] = "AP Exclusive: Backers of NYC mosque appear divided (AP)"; theSiteLinks[10] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/ap_exclusive_backers_of_nyc_mosque_appear_divided"; theSummaries[11] = "Federer tops Soderling, reaches US Open semifinals (AP)"; theSiteLinks[11] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/federer_tops_soderling_reaches_us_open_semifinals"; theSummaries[12] = "Fla. minister determined to hold 9/11 Quran burn (AP)"; theSiteLinks[12] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/fla_minister_determined_to_hold_9/11_quran_burn"; theSummaries[13] = "BP points fingers in oil spill blame game (Reuters)"; theSiteLinks[13] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/bp_points_fingers_in_oil_spill_blame_game"; theSummaries[14] = "Florida pastor not backing down on Koran-burning (Reuters)"; theSiteLinks[14] = "http://tickermyfeed.com/news.php/MzIyN3w2YjE5NDJiNGI4OTE0OTM3ZTFlNjY0OWY0NzBkMzQ3Znx5YWhvbw==/florida_pastor_not_backing_down_on_koran-burning"; 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('');