// JavaScript Document
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function getbiblereadingfortoday()
{
now=new Date();
month=now.getMonth();
day=now.getDate();
year=now.getFullYear();
month=month+1;
if (month > 9)
{
month=month+'';
}
else
{
month=month+'';
month = "0"+month;
}
if (day > 9)
{
day=day+'';
}
else
{
day=day+'';
day = "0"+day;
}
year = year - 2000;
year = year+'';
string = month+day+year+".cfm";
location = "http://www.usccb.org/bible/readings/"+string;
window.open=location;
}

function CenterElements()
{
var BrowserWidth, MainScreenWidth, MainPageHeight, BrowserCenter, MainScreenCenter, PageLeft, FooterTop, FooterHeight, TopInt , NewHeight;
var TextTop, TextHeight, FooterPosition, IntegerValue, Browser;

Browser = navigator.appName;
BrowserWidth = document.documentElement.clientWidth;
BrowserCenter = BrowserWidth / 2;
MainDiv =  document.getElementById("MainPage");
//alert(MainDiv);
MainScreenWidth = 889;
MainScreenCenter = MainScreenWidth / 2;
PageLeft = BrowserCenter - MainScreenCenter;
PageLeft = PageLeft+'';
PageLeft = PageLeft+"px";
document.getElementById("MainPage").style.left = PageLeft;
document.getElementById("stjohnlogo").style.left = PageLeft;
document.getElementById("banner").style.left = PageLeft;

TopInt = document.getElementById("pagetext").style.top;
pxpointer = TopInt.indexOf("px")
IntegerValue = TopInt.substring(0, pxpointer)
TextTop = eval(IntegerValue);
TextHeight = document.getElementById("pagetext").offsetHeight;
FooterPosition = TextTop + TextHeight + 10;
FooterPosition = FooterPosition+"";
FooterPosition = FooterPosition+"px";
document.getElementById("footerp").style.top = FooterPosition;

TopInt = document.getElementById("footerp").style.top;
pxpointer = TopInt.indexOf("px")
IntegerValue = TopInt.substring(0, pxpointer)
FooterTop = eval(IntegerValue);
FooterHeight = document.getElementById("footerp").offsetHeight;


MainPageHeight = FooterTop + FooterHeight + 100; 
NewHeight = MainPageHeight+'';
NewHeight = NewHeight+"px";
document.getElementById('MainPage').style.height=NewHeight;
}

