function sp_setCookie(name, value, time)
 {
 var CookieExpires=new Date();
 if (! time)
  time=90*24*60*60*1000;
 CookieExpires.setTime(CookieExpires.getTime()+time);
 document.cookie=name+"="+value+"; expires="+CookieExpires.toGMTString()+"; path=/; domain="+window.location.host;
 }

function sp_getCookie(name)
 {
 var result=null;
 var tmp=" "+name+"=";
 var cookies=" "+document.cookie+";";
 var start=cookies.indexOf(tmp);
 var e=";";
 var ef=location.search.indexOf("size")==-1;
 if (!ef)
  {
  tmp="&"+name+"=";
  cookies="&"+location.search.substring(1);
  start=cookies.indexOf(tmp);
  e="&";
  }
 if (start!=-1)
  {
  start+=tmp.length;
  end=cookies.indexOf(e, start);
  result=unescape(cookies.substring(start, end));
  }
 return result;
 }

function tcp_count(status, rooturi)
 {
 var c=sp_getCookie("count");
 if (status=="read")
  {
  if (c == null)
   document.write('<iframe width=1 height=1 scrolling="no" frameborder=0 src="'+rooturi+'count.html"></iframe>');
  }
 else
  sp_setCookie("count", 1, 24*60*60*1000);
 }

function tcp_docread(rooturi)
 {
 tcp_count("read", rooturi);
 }

function tcp_docloaded()
 {
 tcp_count("loaded");
 }

