var rday;  
var rhour; 
var pday; 
var phour;
var string;
var curiss; 
var curmon; 
var topnotch; 
var change; 

rhour=5; //This is the hour the comic is released, it should be 5 during standard time, and it should be 4 duing daylight savings time.
rday=7;//This is where you input the date of the update. 
curfea=157;//This is the number of the featured issue.
cursid=156;// This is the number of the side issue.
feamon="31"; //This is the current month for the featured comic. 
sidmon="31";//This is the current month for the side comic.

function update() //Use for Rick Index, and for Hub
{
var pdate = new Date();
if (rday==pdate.getUTCDate())
{
corhour();
}
else
{
++string;
ricknews();
}
}

function corhour()
{
var pdate = new Date(); 
if (rhour<=pdate.getUTCHours())
{
document.getElementById("feature").src="comics/"+feamon+"/r"+curfea+".png";
document.getElementById("side").src="comics/"+sidmon+"/r"+cursid+".png";
}
else
{
string++; 
ricknews();
}
}

function mupdate() //Use for the main site index. 
{
var pdate = new Date();
if (rday==pdate.getUTCDate())
{
mcorhour();
}
else
{
++string; 
ricknews();
}
}

function mcorhour()
{
var pdate = new Date(); 
if (rhour<=pdate.getUTCHours())
{
document.getElementById("feature").src="rick/comics/"+feamon+"/r"+curfea+".png";
document.getElementById("side").src="rick/comics/"+sidmon+"/r"+cursid+".png";
}
else
{
++string; 
ricknews();
}
}

function crosswalk() //Use this for the site which choses between archive pages. 
{
var pdate = new Date();
if (rday==pdate.getUTCDate())
{
walkk();
}
else
{
++string; 
}
}

function walkk()
{
var pdate = new Date(); 
if (rhour<=pdate.getUTCHours())
{
document.getElementById("five").href="5/arch_au.htm";
document.getElementById("door").href="arch_au.htm";
}
else
{
string++; 
}
}

function sitenews()
{
if (location.hash=="#165")	//Put current RSS item number here.
{
notice();	
}
else
{
++string;
}
}

function ricknews()
{
if (location.hash=="#131")	//Put current RSS item number here.
{
notice();	
}
else
{
++string;
}	
}

function notice()
{
document.getElementById("rssn").innerHTML="Attention RSS Subscribers: The Comic will update at 11 GMT-5. Redphantom will be unable to update the site in person, and has set it to auto update. However, he has not set up the RSS feeds to do so. Hence, the reason for this message. The comic will be released as always, at 11 GMT-5.";
document.getElementById("rssn").className="ce";	
}
