function AmILoggedIn() {
	if (getRCookie('UserID') + '' != '' && getRCookie('UserID') != null) {
		return true;
	} else {
		return false;
	}
}
function getRCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}

function getRCookie (name) {
    var arg = name + "=";
    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 getRCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0)
            break;
    }
    return null;
}

function setRCookie(NameOfCookie, value, expiremin) {
    var ExpireDate = new Date ();
    ExpireDate.setTime(ExpireDate.getTime() + (expiremin * 60 * 1000));
    document.cookie = NameOfCookie + "=" + escape(value) + ((expiremin == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
function GetNickName08() {
    if (getRCookie("UserID") != null && getRCookie("NickName") != null) {
        var sName = getRCookie("NickName");
        sName = sName.replace("+"," ");
        document.write ('<a href="rfFan.asp">' + unescape(sName.replace("+"," ")) + '</a>');
    }
}

function GetWelcomeText08() {
	var sB=parseInt(getRCookie('Subscription'));
	var sG=parseInt(getRCookie('GoldStatus'));
	if (AmILoggedIn() == false) {
		document.write('Welcome New User ');
	} else {
		document.write('Welcome ');
		GetNickName08();
	}
	if (AmILoggedIn() == false || sB == 5) {
		//non-logged in
		document.write('<a href=Subscribe.asp?strk=lmastnew><font color=#21a313><b>7-Day Free Trial!</b></font></a>');
	} else if(sB == 7) {
		//logged in, non-member
		document.write(' <a href=Subscribe.asp?strk=lmastnew><font color=#21a313><b>7-Day Free Trial!</b></font></a>');
	} else if(sB == 15 || sB == 19) {
		//annual
	} else if(sB == 13 || sB == 17) {
		//monthly
		document.write(' <a href=nsUpgrade.asp><font color=#21a313><b>Upgrade and Save!</b></font></a>');
	} else if (sB == 11) {
		//lapsed
		document.write(' <font color=#21a313><b>Update your membership information</b></font>');
	}
	if (AmILoggedIn() == false) {
		document.write(' <img src=http://vmedia.rivals.com/images/dividerdots.gif><a href=/default.asp?LIN=1><b>Sign in</a><img src=http://vmedia.rivals.com/images/dividerdots.gif><A href=http://www.rivals.com/content.asp?CID=47691>Help</a>');
	} else {
		document.write(' <img src=http://vmedia.rivals.com/images/dividerdots.gif><a href=/logout.asp><b>Sign out</a><img src=http://vmedia.rivals.com/images/dividerdots.gif><A href=http://www.rivals.com/content.asp?CID=47691>Help</a>');
	}
}