I use a bit different code for that and have had no problems. some of my posters are overseas and they tell me that the greeting is in their time zone.
here is the code i have been using for about 2 years.
you can change the color and font about half way down.
You will notice that mine is set fot the cookies function in the first part..
Instead of the greplace function
<!--
function ReadCookie(cookieName){
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return "";
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length;
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
var today = new Date();
expiry = new Date(today.getTime() + 6*60*24*60*60*1000);
function SetCookie (name, value){
document.cookie=name + "=" + escape (value) + "; expires=" + expiry.toGMTString();
}
// -->
</script></div>
<center><font face="Helvetica,Arial" size="2" color="#FF00ff"><b>
<script>
<!--
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour > 18) displayEvent = "Evening";
else if (thehour >12) displayEvent = "Afternoon";
else displayEvent = "Morning";
var yourname=ReadCookie("nbabauth")
if ((yourname=="") || (yourname=="Anonymous")){yourname="Guest"}
var greeting = ("Good " + displayEvent + " " + yourname + "")
document.write("<b>"+greeting+"</b>");
// -->
</script>

Kitty, KD, Blackkats4, Cindy
East Texas, 50 miles north of Houston
Ducks and Geese