<!-- Begin Script

//  personal Visit Count - a JavaScript example -

//  Written by : Olaf Walkowiak, BikeConnection <si0015@aixrs1.hrz.uni-essen.de>



//  ********************* Some variables you may edit  *********************



var expAfterDays = 30;          // The number of days the Counter will "remember" the visits

                                // if the visitor hasnt been there for expAfterDays, the number

                                // of visits is set to TotalInit (see below).





var CookieTotal = "TotalVisits";// The Name of the cookie to store the total number of visits

var CookieToday = "TodayVisits" // The Name of the cookie to store todays visits

                                // better - the visits in the current session



var TotalInit = 0;              // The Value the "Total Visit counter" starts with

                                // should be "0", i think :-)



var SessionInit = 0;            // The value the "Session Visit counter" starts with

                                // should be "0"....



//  ********************* The Counter functions        *********************

var visitsToday = 0;    

var visitsTotal = 0;

var exp = new Date(); // now

exp.setTime(exp.getTime() + (expAfterDays*24*60*60*1000));



function countVisit()

{

        var buf = "";

        

        buf = GetCookie(CookieTotal);

        if (buf == null)

                visitsTotal = TotalInit;

        else

                visitsTotal = parseInt(buf);

        visitsTotal++;

        

        buf = GetCookie(CookieToday);

        if (buf == null)

                visitsToday = TotalInit;

        else

                visitsToday = parseInt(buf);

        visitsToday++;



        SetCookie(CookieTotal,visitsTotal,exp);

        SetCookie(CookieToday,visitsToday);

}



function displayTotalVisits(Text1, Text2)

{

        var Text ="";

        var buf = GetCookie(CookieTotal);

        if (buf == null)

                countVisit(); // Did you forget to call this function?

        else

                visitsTotal = parseInt(buf);    

        Text += Text1 + visitsTotal + Text2;

        document.write(Text);

}



function displayTodaysVisits(Text1, Text2)

{

        var Text ="";

        var buf = GetCookie(CookieToday);

        if (buf == null)

                countVisit(); // Did you forget to call this finction?

        else

                visitsToday = parseInt(buf);    

        Text += Text1 + visitsToday + Text2;

        document.write(Text);

}



//  ********************* General Cookie handling      *********************



//  Cookie Functions - Second Helping  (21-Jan-96)

//  Written by:  Bill Dortch, hIdaho Design <bdortch@netw.com>

//  The following functions are released to the public domain.


function getCookieVal (offset) {

  var endstr = document.cookie.indexOf (";", offset);

  if (endstr == -1)

    endstr = document.cookie.length;

  return unescape(document.cookie.substring(offset, endstr));

}



function GetCookie (name) {

  var arg = name + "=";

  var alen = arg.length;

  var clen = document.cookie.length;

  var i = 0;

  while (i < clen) {

    var j = i + alen;

    if (document.cookie.substring(i, j) == arg)

      return getCookieVal (j);

    i = document.cookie.indexOf(" ", i) + 1;

    if (i == 0) break; 

  }

  return null;

}



function SetCookie (name, value) {

  var argv = SetCookie.arguments;

  var argc = SetCookie.arguments.length;

  var expires = (argc > 2) ? argv[2] : null;

  var path = (argc > 3) ? argv[3] : null;

  var domain = (argc > 4) ? argv[4] : null;

  var secure = (argc > 5) ? argv[5] : false;

  document.cookie = name + "=" + escape (value) +

    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

    ((path == null) ? "" : ("; path=" + path)) +

    ((domain == null) ? "" : ("; domain=" + domain)) +

    ((secure == true) ? "; secure" : "");

}



function DeleteCookie (name) {

  var exp = new Date();

  exp.setTime (exp.getTime() - 1);  // This cookie is history

  var cval = GetCookie (name);

  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

displayTotalVisits("The ascended masters channel your visitation total as ",", ");

displayTodaysVisits(" with ", " during this psychic reading, and ");

//  End Script -->
