// $Revision: 1.4 $
// Unlimited and Expiring promos
var Days = Math.abs(NumDaysToExpire()+1);
var TimeString ="";
if (Days==0)
	TimeString = "<b>today</b>";
else
{
	if (Premium)
		TimeString += "in ";
	TimeString += "<b>"+Days+"</b> day";
	if (Days != 1)
		TimeString += "s";
	if (Expired)
		TimeString += " ago";
}

var Name = GetFirstName();
if (Premium && (NumDaysToExpire() >= -29)) // about to expire
{
	var str = '<img border=0 src="/mimgs/clear.gif" width=1 height=10><br><table border="0" cellpadding="0" cellspacing="0"><tr><td>' +
              '<img border=0 src="/mimgs/renewal_warning_152x25.gif" width=152 height=25 hspace=5></td><td nowrap align="center"><font face="verdana" size="2" color="#CC0000">' +
              "Hi " + Name + ", your Webshots Premium membership will<br>expire "+TimeString+"! <b><a href=\"http://www.webshots.com/r/Premium/renewal/banner\">Renew " + 
              'your membership now!</a></b></font></td><td><img border=0 src="/mimgs/renewal_warning_152x25.gif" width=152 height=25 hspace=5></td></tr></table>';
        document.write(str);
}
else if (Expired && NumDaysToExpire() <= 28) // expired
{
	var str = '<img border=0 src="/mimgs/clear.gif" width=1 height=10><br><table border="0" cellpadding="0" cellspacing="0"><tr><td>' +
              '<img border=0 src="/mimgs/renewal_warning_152x25.gif" width=152 height=25 hspace=5></td><td nowrap align="center"><font face="verdana" size="2" color="#CC0000">' +
              "Hi " + Name + ", your Webshots Premium membership <br>expired "+TimeString+"! <b><a href=\"http://www.webshots.com/r/Premium/renewal/banner\">Renew " + 
              'Now!</a></b></font></td><td><img border=0 src="/mimgs/renewal_warning_152x25.gif" width=152 height=25 hspace=5></td></tr></table>';
        document.write(str);
}

// renewal popup
if ( NumDaysToExpire() >= -21 && NumDaysToExpire() < 0 && CookieTest && document.cookie.indexOf('RenewalNoticePop') == -1 ) 
{ 
  openwin( "renewal_pop", 400, 240, "no", "yes", "http://www.webshots.com/html/renewal_popup.html" ); 
  SetCookie( 'RenewalNoticePop', '1', 48 ); 
}