if (GetCookie(snProjID) == null){
  SetCookieV(snProjID)
}

document.writeln('<iframe width=100% height=30 scrolling=no frameborder=0 src="http://bizbase.ru/cgi-bin/sncnt/sncnt.pl?ID=' + snProjID + '&R=' + delq(parent.document.referrer) + '&T=' + snPageName + '&RND=' + GetCookie(snProjID) + '&FGC=' + snFGColor + '&BGC=' + snBGColor + '"></iframe>');

function GetCookie (nm){
  var arg = nm + "=";
  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) {
      var endstr = document.cookie.indexOf(";",j);
      if(endstr == -1) endstr = document.cookie.length;
      return document.cookie.substring(j,endstr);
    }
    i = document.cookie.indexOf(" ", i) + 1;
    if (i==0) break;
  }
  return null;
}

function SetCookieV(nm){
  var today = new Date();
  document.cookie = nm + "=" + today.getTime();
}

function delq(a){
  var b;
  b = "";
  for(i=0; i<a.length; i++){
    if(a.substring(i,i+1) == '"') b = b + "'";
    else b = b + a.substring(i,i+1)
  }
  return b;
}
