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+" - "+560) if(widthpx>=560) { 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] = "Twelve killed in suicide assault on Iraq army base (Reuters)"; theSiteLinks[0] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/twelve_killed_in_suicide_assault_on_iraq_army_base"; theSummaries[1] = "Diverse water sources key to food security: report (Reuters)"; theSiteLinks[1] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/diverse_water_sources_key_to_food_security_report"; theSummaries[2] = "ADV: Win a Apple MacBook 13-inch Notebook Computer Now"; theSiteLinks[2] = "http://tickermyfeed.com/adv.php/NTk="; theSummaries[3] = "Despite formal combat end, US joins Baghdad battle (AP)"; theSiteLinks[3] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/despite_formal_combat_end_us_joins_baghdad_battle"; theSummaries[4] = "Oracle offered job to ex-HP CEO Hurd says source (Reuters)"; theSiteLinks[4] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/oracle_offered_job_to_ex-hp_ceo_hurd_says_source"; theSummaries[5] = "ADV: Add a Breaking News Ticker to Your Web Browser"; theSiteLinks[5] = "http://tickermyfeed.com/adv.php/NTg="; theSummaries[6] = "Guatemala mudslides kill at least 38; 2 buses hit (AP)"; theSiteLinks[6] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/guatemala_mudslides_kill_at_least_38_2_buses_hit"; theSummaries[7] = "Basque ETA call to halt attacks met with caution (Reuters)"; theSiteLinks[7] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/basque_eta_call_to_halt_attacks_met_with_caution"; theSummaries[8] = "Taxpayers may face initial loss on GM IPO: sources (Reuters)"; theSiteLinks[8] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/taxpayers_may_face_initial_loss_on_gm_ipo_sources"; theSummaries[9] = "Want cheapskates to spend? Hawk gizmos that save (AP)"; theSiteLinks[9] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/want_cheapskates_to_spend_hawk_gizmos_that_save"; theSummaries[10] = "ETA declares ceasefire in Basque independence battle (AFP)"; theSiteLinks[10] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/eta_declares_ceasefire_in_basque_independence_battle"; theSummaries[11] = "Future hiring will mainly benefit the high-skilled (AP)"; theSiteLinks[11] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/future_hiring_will_mainly_benefit_the_high-skilled"; theSummaries[12] = "Quake-hit New Zealand city remains shut (Reuters)"; theSiteLinks[12] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/quake-hit_new_zealand_city_remains_shut"; theSummaries[13] = "Obama to propose permanent research tax credit (Reuters)"; theSiteLinks[13] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/obama_to_propose_permanent_research_tax_credit"; theSummaries[14] = "US troops fire back as suicide bombers kill 12 in Baghdad (AFP)"; theSiteLinks[14] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/us_troops_fire_back_as_suicide_bombers_kill_12_in_baghdad"; theSummaries[15] = "Backyard volunteers helping track firefly numbers (AP)"; theSiteLinks[15] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/backyard_volunteers_helping_track_firefly_numbers"; theSummaries[16] = "Japanese public backs PM Kan vs Ozawa by wide margin (Reuters)"; theSiteLinks[16] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/japanese_public_backs_pm_kan_vs_ozawa_by_wide_margin"; theSummaries[17] = "Congo: 70 dead, 200 missing in 2 boat capsizes (AP)"; theSiteLinks[17] = "http://tickermyfeed.com/news.php/MHx8eWFob28=/congo_70_dead_200_missing_in_2_boat_capsizes"; 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: 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('');