 // Revision: $Id: client_visit_cntr.js 145 2009-09-18 14:31:47Z robert0609 $
// (C) BRAEWORKS 2005, site visit counter script
// client_visit_cntr.js
//
// requires cookie_ops.js

	function showClientVisitsCntrCookie(sCookieID,sLeader,sTrailer) {
		var expires = new Date();
		expires.setTime(expires.getTime() + 31536000000); //(1000 * 3600 * 24 * 365)); //plus 1 year

		// check for defaults
		if (( sCookieID == null) || ( ! sCookieID.length )) sCookieID = "visits";
		if (( sLeader == null) || ( ! sLeader.length )) sLeader = "Visited";
		if (( sTrailer == null) || ( ! sTrailer.length )) sTrailer = "times.";

		var visitsCntr = getCookie(sCookieID);
		if ( visitsCntr == null) {
			// document.write("New cookie");	// test
			visitsCntr = 1;
			setCookie(sCookieID,visitsCntr,expires);
			//say nothing may be disabled	document.write("This the first time you have visited this site.");
			} // if
		else {
			// document.write("Old cookie");	// test
			visitsCntr++;
			setCookie(sCookieID,visitsCntr,expires);
			// document.write(visitsCntr + sCookieID);	// test
			document.write(sLeader + " " + visitsCntr + " " + sTrailer);
			} // else
		} // showClientVisitsCntrCookie()


// EOF


