var agt = navigator.userAgent.toLowerCase(); var is_mac = (agt.indexOf("mac")!= -1); if (is_mac == false) { /* Cross browser Marquee script- ? Dynamic Drive (www.dynamicdrive.com) For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com Credit MUST stay intact */ var marqueecontent; //Specify the marquee's width (in pixels) var marqueewidth; //Specify the marquee's height var marqueeheight; //Specify the marquee's pixel count per move. DO NOT ADJUST THIS. ADJ pixelRate INSTEAD var marqueespeed=1 //configure background color: var marqueebgcolor; //Pause marquee onMousever (0=no. 1=yes)? var pauseit=1 // various inits var iedom; //marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS var copyspeed=marqueespeed var pausespeed=(pauseit==0)? copyspeed: 0 var actualwidth='' var cross_marquee, ns_marquee var pixelRate = 20; // this is the pixel move rate (ms) var refreshInterval = Math.round(1000/20); //time between screen updates (ms). last figure is the FPS /* performance tweaks, @see scrollmarquee() */ var lastScrollUpdate; function runTick(inMarqueecontent,inW,inH,inBg){ marqueewidth = inW; marqueeheight = inH; marqueebgcolor = inBg; //Specify the marquee's content (don't delete tag) //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great): marqueecontent = '' + inMarqueecontent + ''; iedom=document.all||document.getElementById; if (iedom||document.layers){ with (document){ document.write('
') if (iedom){ write('
') write('
') write('
') write('
') } else if (document.layers){ write('') write('') write('') } document.write('
') } } if (iedom){ document.write('') } populate(); } function populate(){ if (iedom){ cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee cross_marquee.style.left=parseInt(marqueewidth)+8+"px" cross_marquee.innerHTML=marqueecontent actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth } else if (document.layers){ ns_marquee=document.ns_marquee.document.ns_marquee2 ns_marquee.left=parseInt(marqueewidth)+8 ns_marquee.document.write(marqueecontent) ns_marquee.document.close() actualwidth=ns_marquee.document.width } /* performance tweaks, @see scrollmarquee() */ lastScrollUpdate = (new Date()).getTime(); lefttime=setInterval("scrollmarquee()",refreshInterval) } function scrollmarquee(){ /** * Performance tweaks: There is an observed issue on Firefox where the ticker scrolls slower when * it's overwhelmed by heavy screen updates (e.g., animation from advertisments). * This is now rewritten so that the animation is based on time elapsed, as opposed * to the assumption of a constant interval. Animation now runs at the same speed across * ANY browser, and the best smoothness is acheived. * Display updates are now against a configurable FPS, as to reduce the workload on unnecessary * visual updates not discernable to the eye */ var now = (new Date()).getTime(); var elapsedFrameCount = Math.floor((now - lastScrollUpdate)/pixelRate); lastScrollUpdate += elapsedFrameCount*pixelRate; scrollAmount = copyspeed * elapsedFrameCount if (iedom){ if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)) cross_marquee.style.left=parseInt(cross_marquee.style.left)-scrollAmount+"px" else cross_marquee.style.left=parseInt(marqueewidth)+8+"px" } else if (document.layers){ if (ns_marquee.left>(actualwidth*(-1)+8)) ns_marquee.left-=scrollAmount else ns_marquee.left=parseInt(marqueewidth)+8 } } }