var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

function post_begin(title, day, month, date, year, style, hascomment)
{
	document.write("<div style=\"position: relative;\"> <img src=\"/~brunnels/images/caption_");
	document.write(style);
	document.write(".jpg\"/> <div id=\"ahm_title\"> <h3>");
	document.write(days[day-1]);
	document.write(", ");
	document.write(months[month-1]);
	document.write(" ");
	document.write(date);
	document.write(", ");
	document.write(year);
	document.write("</h3> <h2>");
	document.write(title);
	document.write("</h2> </div> <p width=\"100%\">");
}

function post_end(title, day, month, date, year, style, hascomment)
{
	document.write("</p> <a href=\"http://vbsman.com/blog/?blogtitle=");
	document.write(title);
	document.write("\">Submit a Comment</a>");

	var filename;

	if (hascomment == 1) 
	{
		document.write("<br/>");
		document.write("<a href=\"/~brunnels/comments/");
		document.write(year);
		document.write("/");
		if (month < 10) document.write("0");
		document.write(month);
		if (date < 10) document.write("0");
		document.write(date);
		document.write("_");

		filename = title;
		filename = filename.replace(/ /g, "")	
		filename = filename.replace(/:/g, "")	
		filename = filename.replace(/'/g, "")	
		filename = filename.replace(/"/g, "")	
		filename = filename.replace(/!/g, "")	

		document.write(filename);
		document.write(".html\">View Comments</a>");
	}

	document.write(" <hr/>&nbsp  </div>");
}


function write_template()
{
	write_header();	    
	write_politicalaction_blurb();
	write_theconservativeunderground_blurb();	   
	write_hope_blurb(); 
	write_aboutme_blurb();	    
	write_favoritelinks_blurb();	    
	write_welcome_blurb();
}

function write_header()
{
document.write("<body bgcolor=\"#000033\" text=\"#000000\" link=\"#0C5D97\" topmargin=\"10\" leftmargin=\"0\">");

document.write("<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" border=\"0\">");

document.write("        <tr  align=\"center\">");

document.write("            <td width=\"760\" height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\">");

document.write("                      <table width=\"485\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" border=\"1\">");

document.write("                      </table>");

document.write("            </td>");

document.write("        </tr>");

document.write("        <tr align=\"right\">");

document.write("        </tr>");

document.write("        <tr class=\"header\" align=\"right\">");

document.write("                   <td align=\"right\" colspan=\"5\" height=\"77\">");

document.write("                        <table  cellspacing=\"0\" cellpadding=\"0\" border=\"0\">");

document.write("                                          <tr valign=\"bottom\" align=\"right\">");

document.write("                                                <td align=\"left\" valign=\"top\">");

document.write("                                                          <a href=\"/~brunnels/\">     <img src=\"/~brunnels/images/header_rounded2.png\"   alt=\"Brandon's Blog\"  border=\"0\" /></a>");

document.write("                                        	</td>");

document.write("                                         </tr>");

document.write("                              </table>");

document.write("                   </td>");

document.write("        </tr>");

document.write("        <tr>");

document.write("        <td align=\"left\" valign=\"top\">");
}

function write_politicalaction_blurb()
{
	document.write("        <div id=\"blurb\" style=\"top: 152px; height: 200px;\"> ");
	document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
	document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 131px;\" />");
	document.write("        <div id=\"sub_blurb\">");
	document.write("	<h3>Political Action</h3>");
	document.write("	<hr/>");

	var randomnumber = Math.floor(Math.random()*3);
	
	if (randomnumber==0)
	{
	     document.write("Please support the Parental Rights movement and sign the Parental Rights Amendment petition at <a href=\"https://www.thedatabank.com/dpg/385/personal2.asp?formid=signup\">ParentalRights.org</a>")
	}
	if (randomnumber==1)
	{
	    	document.write("	<b>URGENT</b>: Action is needed to oppose the \"Freedom of Choice Act (FOCA)\"<br/>");
		document.write("	Please sign the petition <a href=\"http://www.fightfoca.com/\"> HERE </a> and spread the word around!");
	}
	if (randomnumber==2)
	{
	    	document.write("	Vote against socialized healthcare!");
		document.write("	Click <a href=\"http://news1.newsmax.com/obama-healthcare/?PROMO_CODE=8412-1&gclid=CIOgw9LlqZwCFR2dnAod4hpnlA\"> HERE </a> to express your opinion.");
	}

	document.write("	</div>");
	document.write("	</div>");
}


function write_theconservativeunderground_blurb()
{
document.write("        <div id=\"blurb\" style=\"top: 362px; height: 380px;\"> ");
document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 320px;\" />");
document.write("        <div id=\"sub_blurb\">");
document.write("	<h3>The Conservative Underground</h3>");
document.write("	<hr/>");
document.write("	<p align=\"center\">");
document.write("	<img src =\"/~brunnels/images/republican.png\" width=\"150\"></img><br/>");
document.write("	<img src =\"/~brunnels/images/right_wing.png\" width=\"150\"></img>");
document.write("	</p>");
document.write("	</div>");
document.write("	</div>");
}

function write_hope_blurb()
{
document.write("        <div id=\"blurb\" style=\"top: 761px; height: 130px;\"> ");
document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 80px;\" />");
document.write("        <div id=\"sub_blurb\">");
document.write("	<h3>Countdown</h3>");
document.write("	<hr/><p align=\"center\">");
document.write("	Barack Hussein Obama only has <br><b>");
today  = new Date();     
todayEpoch  = today.getTime();     
target = new Date("25 January, 2013");      
targetEpoch = target.getTime();     
daysLeft = Math.floor(((targetEpoch - todayEpoch) / (60*60*24)) / 1000);     
document.write(daysLeft);     
document.write("        </b><br/>days left in office");
document.write("	</div>");
document.write("	</div>");
}

function write_aboutme_blurb()
{
document.write("        <div id=\"blurb\" style=\"top: 919px; height: 205px;\"> ");
document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 155px;\" />");
document.write("        <div id=\"sub_blurb\">");
document.write("	<h3>About Me:</h3>");
document.write("	<hr/>");
document.write("	<p>");
document.write("	I am a third-year college student. I work as a programmer, am a part of a homechurch, and enjoy anything that has to do with religion, math, science, computers, philosophy or politics."); 
document.write("	</p>");
document.write("	</div>");
document.write("	</div>");
}

function write_favoritelinks_blurb()
{
document.write("        <div id=\"blurb\" style=\"top: 1153px; height: 205px;\"> ");
document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 155px;\" />");
document.write("        <div id=\"sub_blurb\">");
document.write("	<h3>Favorite Links:</h3>");
document.write("	<hr/>");
document.write("	<li><a href=\"http://rightperspective.wordpress.com\">The Right Perspective</a>");
document.write("	<li><a href=\"http://www.johnmccain.com\">johnmccain.com</a>");
document.write("	<li><a href=\"http://www.vbsman.com\">vbsman.com</a>");
document.write("	<li><a href=\"/~ptkunmla\">unm.edu/~ptkunmla</a>");
document.write("	<li><a href=\"http://www.rushlimbaugh.com\">rushlimbaugh.com</a>");
document.write("	<li><a href=\"http://www.hannity.com\">hannity.com</a>");
document.write("	<li><a href=\"http://www.michaelmedved.com\">michaelmedved.com</a>");
document.write("	<li><a href=\"http://www.nrlc.org\">nrlc.org</a>");
document.write("	<li><a href=\"http://www.rtlnm.org\">rtlnm.org</a>");
document.write("	</div>");
document.write("	</div>");
}

function write_welcome_blurb()
{
document.write("        <div id=\"blurb\" style=\"top: 1387px; height: 105px;\"> ");
document.write("        <img src=\"/~brunnels/images/blurb_top.bmp\" width=\"100%\"/>");
document.write("        <img src=\"/~brunnels/images/blurb_bottom.bmp\" width=\"100%\" style=\"position: relative; top: 55px;\" />");
document.write("        <div id=\"sub_blurb\">");
document.write("	<h3>Welcome</h3>");
document.write("	<hr/>");
document.write("	You are visitor number:<br/>");
document.write("	<img border=\"0\" src=\"http://xyz.freelogs.com/counter/index.php?u=6406bbl&s=ainv\" ALIGN=\"middle\" HSPACE=\"4\" VSPACE=\"2\"><script src=http://xyz.freelogs.com/counter/script.php?u=6406bbl></script>");
document.write("	<br>to this blog.");
document.write("	</div>");
document.write("	</div>");
}

function bm_start(name)
{
    document.write("<table align=\"center\" cellspacing=\"0\"><tr bgcolor=\"000033\"><td colspan=\"2\"><font color=\"White\"><b>");
    document.write(name);
    document.write("</b></font></td></tr>");
}

function bm_param(name, number, rank)
{
    if (number%2)
	document.write("<tr bgcolor=\"EEEEEEAA\"><td>");
    else
	document.write("<tr><td>");
    document.write(name);
    document.write("</td><td>");
    var count=0;
    while (count < rank)
	{
	    document.write("<img src=\"/~brunnels/images/star.png\">");
	    count++;
	}
    document.write("</td></tr>");
}

function bm_end()
{
    document.write("</table>");
}
