// Copyright 2003, NandoMedia InSite registration system

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(cname) {
 var arg=cname+"="; 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 SaveCookie(cname,cvalue,cdays,cpath) {
 ex = new Date; ex.setTime(ex.getTime() + (cdays*86400000));
 if (cpath == null) { cpath = "/" }
 else { cpath = "; path=" + cpath }
 document.cookie=cname + '=' + cvalue + '; expires=' + ex.toGMTString() + cpath + "; domain=chron.com";
}

// Enables showing/hiding member links via styles and sets "uid" with username if cookie present
if (GetCookie("chron_user_auth")) { 
	var uid = GetCookie("chron_user_auth").replace(/\|.*/,"");
	document.write("<style>.nonmember{display:none;}</style>");
	// alert ("found member\n");
} else { 
	document.write("<style>.member{display:none;}</style>");
	// alert ("found nonmember\n");
}
