// JavaScript Document
var activeDiv = null;

function init() {
	if(document.f && document.f.process) document.f.process.value = 1;
}

function dateMe()	{
	var now = new Date();
	var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear());
}

function todaysScripture()	{
	window.open("http://www.usccb.org/nab/today.shtml");
}

function takeMeHome()	{
	document.location("http://host.visioncreative.com/~stmary/index.html");
}

function takeMeBack()	{
	history.go(-1);
}

function popWindow(url)	{
	win = window.open(url,"staff","width=500,height=300,scrollbars=yes");
}

function closeMe()	{
	this.window.close();
}

function change(e)	{
	if (activeDiv != null) {
	document.getElementById(activeDiv).style.visibility="hidden";
}
	document.getElementById(e).style.visibility = "visible";
	activeDiv = e;	
}

function staffClose(e)	{
	document.getElementById(e).style.visibility="hidden";
	activeDiv=null;
}

function hideEmail(name, domain, display) {
	displayed=(typeof(display)=="undefined") ? name+"@"+domain : display 
	document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}

function flashInfront(m) {
	document.getElementById('flashObj').className = "flashUp";
}

function flashBehind(m) {
	document.getElementById('flashObj').className = "flashBack";
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }

function popImage(gallery,image)
{
	win = window.open("/gallery/imageViewer.php?g=" + gallery + "&i=" + image,"ImageViewer","width=750,height=500,scrollbars=yes");
}

//window.attachEvent("onload", correctPNG);
