var lastHere = GetCookie("lastHere");
var today = new Date();
var expdate = new Date();
expdate.setTime(expdate.getTime()+(180*24*60*60*1000)); //180 days to expire
if (lastHere == null) {
        // set the cookie for the first time
        SetCookie("lastHere",today.toLocaleString(),expdate);
        document.writeln("Welcome! I see that this is your first visit.");
        } else {
        document.writeln("Good to see you again! I noticed you haven't been around since "+lastHere+".");
        SetCookie("lastHere",today.toLocaleString(),expdate); 
}
