// Version 2.5.12.16.1541 - ck - added n_Extra_mText // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); var appVer = navigator.appVersion.toLowerCase(); // *** BROWSER VERSION *** var is_minor = parseFloat(appVer); var is_major = parseInt(is_minor); var iePos = appVer.indexOf('msie'); var is_opera = (agt.indexOf("opera") != -1); var is_konq = (agt.indexOf("konqueror") != -1); var is_safari = (agt.indexOf("safari") != -1); var is_ie = ((iePos!=-1) && (!is_opera) && (!is_konq) && (!is_safari)); var is_win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ); // *** FLASH CHECK *** var is_Flash = false; var is_FlashVersion = 0; if (!is_ie) { var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; if (plugin&&plugin.description) { is_Flash = true; is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)); } } if (is_win&&is_ie){ document.write('' + '\n' + 'Dim hasPlayer, playerversion' + '\n' + 'hasPlayer = false' + '\n' + 'playerversion = 10' + '\n' + 'Do While playerversion > 0' + '\n' + 'On Error Resume Next' + '\n' + 'hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion)))' + '\n' + 'If hasPlayer = true Then Exit Do' + '\n' + 'playerversion = playerversion - 1' + '\n' + 'Loop' + '\n' + 'is_FlashVersion = playerversion' + '\n' + 'is_Flash = hasPlayer' + '\n' + '<\/sc' + 'ript>'); } ///// News Box Alert Scroller v1.1 Written for the Pennsylvania Turnpike Commission by Voicenet ///// Modify the following 4 lines to suit your needs or include these values in the function call var n_txtArrDef="Roadway is clear. No major incidents to report." ///// Add additional text for the scroller below, sepparate multiple entries with \r\n and end with \r\n //var n_Extra_mText="Hbg.East Exit 247 Travel Restriction|Entry traffic to Harrisburg East Interchange #247 changing traffic pattern. Westbound motorists must use lanes 1 and 2 (to the right) while eastbound motorists must use lanes 3 and 4 (to the left). All four entry lanes will be operated in \'E-ZPass and Ticket\' mode.|rttc/AdvisoryInfo.aspx?ID=3463\r\n" var n_Extra_mText=""; ///// For hyperlinks format text as follows - "TITLE|MESSAGE|URL" - Example: //var n_txtArrDef="1/1/2001 12:30 PM: Test Title|This is a test message link to go back home.|home.htm" var n_marqueewidth="706px" // Width of the scrolling box in pixels (-42 for padding/images) var n_marqueebgcolor="#FDFFE6" // Background color of the Scroll Box ///// Other useful variables which might need modification to suit your needs var n_marqueeborder="#CECECE" // Color of the Scroll Box Border var n_marqueeborderwidth=2 // Width of the Scroll Box Border var n_marqueeheight="14px" // Height of the Scroll Box var n_stoplightwidth=36 var n_stoplightheight=18 var n_stoplightimage='stoplight' var n_addbottomspacer=1 var n_addstoplight=1 var n_addalttitle=1 var n_isremotelinked=0 // a 1 will add www.ptc and target=blank /////////////////////////////////////////////////////////////////////////////// var n_ii=0 var n_marqueespeed=2 var n_pauseit=1 var n_scrollborder=1 var n_stoplight=0 var n_timerRunning = false var n_timerRunning2 = false //n_marqueespeed=(document.all)? n_marqueespeed : Math.max(1, n_marqueespeed-1) //slow speed down by 1 for NS //n_marqueespeed=is_nav ? Math.max(1, n_marqueespeed-1) : n_marqueespeed //slow speed down by 1 for NS var n_copyspeed=n_marqueespeed var n_pausespeed=(n_pauseit==0)? n_copyspeed: 0 var n_iedom=document.all||document.getElementById var n_marqueecontent, n_cross_marquee, n_ns_marquee, n_lefttime, n_lefttime_var2 //var n_cross_list, n_ns_list var n_actualwidth=1 var n_movetonext=0 //var n_mozposdiff=is_fx?-10:-10 var n_mozposdiff=is_ie?0:-10 n_mozposdiff=(is_ie&&(document.documentMode==8||document.documentMode==10))?-10:n_mozposdiff var n_txtArr = new Array() n_txtArr[0]=n_txtArrDef var n_lastMsg='Roadway is clear' function n_mkTextArrayNorm() { n_mkTextArray('','','') } function n_mkTextArray(n_sclText, n_sclMarqueewidth, n_sclMarqueebgcolor) { n_mtext = 'Roadway is clear, no major incidents to report. .. '; if (n_Extra_mText.length > 0) { if (n_mtext.substr((n_mtext.length-4),4) != '\r\n' && n_mtext.length > 0) n_mtext = n_mtext + '\r\n' n_mtext = n_mtext + n_Extra_mText; } if (n_sclText.length > 0) n_mtext = n_sclText if (n_sclMarqueewidth.length > 0) n_marqueewidth = n_sclMarqueewidth if (n_sclMarqueebgcolor.length > 0) n_marqueebgcolor = n_sclMarqueebgcolor n_txtArr = new Array() var n_mstring = n_mtext var n_txtArrL = 0 if (n_mstring.length > 0) { n_mstring = n_mstring + "\r\n"; n_myarray = n_mstring.split("\r\n"); for (n_key in n_myarray) { var n_tline = n_myarray[n_key]; if (n_tline.length > 0) { if (n_tline.substr(0,16) == 'Roadway is clear') { n_stoplight=0; //n_tline = 'National Work-Zone Awareness Week is April 3-9. The PA Turnpike reminds you to "Slow Down or Pay Up" in highway construction zones.'; //n_tline = 'Attention: The PA Turnpike Customer Service and E-ZPass Customer Service Center phone systems are temporarily unavailable due to technical difficulties. All efforts are being made to restore service as quickly as possible.'; n_lastMsg = n_tline; } else { n_stoplight=1; if (n_lastMsg.substr(0,16) == 'Roadway is clear') n_lastMsg = ''; n_myarrayTmp = n_tline.split("|"); n_lastMsg += '' + n_myarrayTmp[0] + '

'; } n_txtArr[n_txtArrL] = n_tline; n_txtArrL ++; //if (n_tline.substr(0,16) != 'Roadway is clear') n_stoplight=1; } } }else{ n_txtArr[0]=n_txtArrDef; n_scrollborder=0; n_copyspeed=1; n_pauseit=0; } n_writeScroller(); } function n_populate(){ if (n_iedom){ n_cross_marquee=document.getElementById? document.getElementById("n_iemarquee") : document.all.n_iemarquee; //n_cross_list=document.getElementById? document.getElementById("strScrollMsg") : document.all.strScrollMsg; } else if (document.layers){ n_ns_marquee=document.n_ns_marquee.document.n_ns_marquee2; //n_ns_list=document.strScrollMsg; } n_addText(n_ii) } function n_addText(n_z){ n_myarray = n_txtArr[n_z].split("|"); if (n_myarray.length == 3){ //if (n_lastMsg.substr(0,16) == 'Roadway is clear') n_lastMsg = ''; //n_lastMsg = '' + n_myarray[0] + ''; if (n_isremotelinked == 1){ n_marqueecontent = '' + n_myarray[0] + '  ' + n_myarray[1] + ''; }else{ n_marqueecontent = '' + n_myarray[0] + '  ' + n_myarray[1] + ''; } }else{ n_marqueecontent = '' + n_txtArr[n_z] + '' } if (n_iedom){ n_cross_marquee.style.left=parseInt(n_marqueewidth)+8+"px" n_cross_marquee.innerHTML=n_marqueecontent if (n_addalttitle==1) { n_cross_marquee.title='Emergency Notification Alert Message: ' + (n_ii+1) + ' of ' + n_txtArr.length + '\n** CLICK ON MESSAGE FOR MORE DETAILS **' } n_actualwidth=document.all? n_iemarquee.offsetWidth : document.getElementById("n_iemarquee").offsetWidth //n_cross_list.innerHTML = n_lastMsg } else if (document.layers){ n_ns_marquee.left=parseInt(n_marqueewidth)+8 n_ns_marquee.document.write(n_marqueecontent) n_ns_marquee.document.close() n_actualwidth=n_ns_marquee.document.width //n_ns_list.document.write(n_lastMsg) //n_ns_list.document.close() } n_doTimer() } function n_scrollmarquee(){ if (n_iedom){ if (n_actualwidth == 0) n_actualwidth=document.all? n_iemarquee.offsetWidth : document.getElementById("n_iemarquee").offsetWidth var n_cleft = parseInt(n_cross_marquee.style.left) var n_cright = n_actualwidth + n_cleft if (n_cleft parseInt(n_marqueewidth) && n_cright < parseInt(n_marqueewidth)) )) n_movetonext = 1 else if (n_cleft>(n_actualwidth*(-1)+8)) n_cross_marquee.style.left=n_cleft-n_copyspeed+"px" else if (n_cleft>(n_actualwidth*(-1))) n_movetonext = 2 else n_cross_marquee.style.left=parseInt(n_marqueewidth)+8+"px" } else if (document.layers){ if (n_actualwidth == 0) n_actualwidth=n_ns_marquee.document.width var n_cleft = n_ns_marquee.left var n_cright = n_actualwidth + n_cleft if (n_cleft < n_marqueespeed && n_scrollborder == 1 && (n_actualwidth < parseInt(n_marqueewidth) || (n_actualwidth > parseInt(n_marqueewidth) && n_cright < parseInt(n_marqueewidth)) )) n_movetonext = 1 else if (n_cleft>(n_actualwidth*(-1)+8)) n_ns_marquee.left-=n_copyspeed else if (n_cleft>(n_actualwidth*(-1))) n_movetonext = 2 else n_ns_marquee.left=parseInt(n_marqueewidth)+8 } if (n_movetonext == 1){ n_doTimer(); n_doTimer2(2000); } else if (n_movetonext == 2){ n_doTimer(); n_doTimer2(10); } } function n_nextMsg(){ if (n_timerRunning2) { if (n_ii 0) { n_timerRunning2 = true; n_lefttime_var2 = setTimeout("n_nextMsg()",n_t2dur); } } function n_killTimers() { if (n_timerRunning){ clearInterval(n_lefttime); n_timerRunning = false; } if (n_timerRunning2){ clearTimeout(n_lefttime_var2); n_timerRunning2 = false; } } function n_writeScroller(){ if (n_iedom||document.layers){ with (document){ write('') write('') if (n_addbottomspacer == 1) write('') write('
') write('') if (n_addstoplight==1) { write('') } else { write('') } write('
') if (n_iedom){ write('
') write('
') write('
') write('
') } else if (document.layers){ write('') write('') write('') } write('
') } } n_populate(); }