var now = new Date();
var g_domain=location.hostname;

var Cname="USRSI";
now.setTime(now.getTime() + 365 * 24 * 60 * 60);
function checkCookie(cuid){
   if (cuid!="") setCookie("fcuid",cuid, now,"/", g_domain);
}
function checkCookieREP(cuid){
   if (cuid==null || cuid.indexOf("uuser")==-1){
   	 setCookie("fcuid","uuser_n", now,"/", g_domain);
   	 return true;
   }
   return false;
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  }
  else  begin += 2;
  var end = dc.indexOf(";", begin);
  if (end == -1)  end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function e(x){
 if(!d.all)x =escape(x).replace(/\+/g,"%2b");
 return x;
}
