// Add TextSizer
function addTextSizer()
{
	var imgPath = '/imgs/icons/';
	var theHref = 'href="#"';
	$("#TopNav").after("<div id=\"Tools\">");
		$("#Tools").append("<div id=\"TextSizer\">" +
			"<h2 class=\"Hide\">Text Size</h2>" +
			"<ul>" +
				"<li>" +
					"<a class=\"Normal\"" + theHref + "><img src=\"" + imgPath + "small_font.gif\" alt=\"Normal Font Size\" /></a>" +
				"</li>" +
				"<li>" +
					"<a class=\"Large\"" + theHref + "><img src=\"" + imgPath + "medium_font.gif\" alt=\"Medium Font Size\" /></a>" +
				"</li>" +
				"<li>" +
					"<a class=\"X-Large\"" + theHref + "><img src=\"" + imgPath + "large_font.gif\" alt=\"Large Font Size\" /></a>" +
				"</li>" +
			"</ul>" +
		"</div>" +
	"</div>");
	$("a.Normal").click(function() { setFontSize('normal'); return false; });
	$("a.Large").click(function() { setFontSize('large'); return false; });
	$("a.X-Large").click(function() { setFontSize('x-large'); return false; });
}
$(document).ready(function(){addTextSizer();});

// Add PageTools
function addPageTools()
{
	$("#Tools").append("<div id=\"PageTools\">" +
		"<h2 class=\"Hide\">Page Tools</h2>" +
		"<ul>" +
			"<li class=\"Print\">" +
				"<a href=\"#\">Print</a>" +
			"</li>" +
			"<li class=\"Email\">" +
				"<a href=\"#\">Email</a>" +
			"</li>" +
		"</ul>" +
	"</div>");
	var clientDomainName = 'MyStlukesOnline.org';
	var clientSiteName = 'St. Luke\'s';
	var titleEl = document.getElementsByTagName('title')[0];
	var currentPageTitle = "";
	if (titleEl.text)
	{
		currentPageTitle = titleEl.text;
	}
	else
	{
		currentPageTitle = title.data;
	}
	var currentPageUrl = document.location;
	var emailSubject = clientDomainName + ": " + currentPageTitle;
	var emailHref = "mailto:?subject=" + emailSubject + "&body=I thought you would be interested in a page on the " + clientSiteName + " Web site: " + currentPageTitle + " - " + currentPageUrl;
	$("li.Email a").attr({ href: emailHref});
	$("li.Print a").click(function() { print(); return false; });
}

function addPageToolsHeart()
{
	$("#Heart #PageToolsWrapper").append("<div id=\"PageTools\">" +
		"<h2 class=\"Hide\">Page Tools</h2>" +
		"<ul>" +
			"<li class=\"Print\">" +
				"<a href=\"#\">Print</a>" +
			"</li>" +
			"<li class=\"Email\">" +
				"<a href=\"#\">Email</a>" +
			"</li>" +
		"</ul>" +
	"</div>");
	var clientDomainName = 'MyStlukesOnline.org';
	var clientSiteName = 'St. Luke\'s';
	var titleEl = document.getElementsByTagName('title')[0];
	var currentPageTitle = "";
	if (titleEl.text)
	{
		currentPageTitle = titleEl.text;
	}
	else
	{
		currentPageTitle = title.data;
	}
	var currentPageUrl = document.location;
	var emailSubject = clientDomainName + ": " + currentPageTitle;
	var emailHref = "mailto:?subject=" + emailSubject + "&body=I thought you would be interested in a page on the " + clientSiteName + " Web site: " + currentPageTitle + " - " + currentPageUrl;
	$("li.Email a").attr({ href: emailHref});
	$("li.Print a").click(function() { print(); return false; });
}

// Remove dropdown if empty
function removeDropdown() {
	$('.Flyout .FlyoutInner:empty').parent().parent().parent().remove();
	$('.Flyout .FlyoutInner .cmspanel:empty').parent().parent().parent().parent().remove();
}

function yellowBkgd() {
	$('#Col3 .Yellow').parent().addClass('YellowBackground');
}
$(document).ready(function(){addPageTools();});
$(document).ready(function(){addPageToolsHeart();});
$(document).ready(function(){removeDropdown();});
$(document).ready(function(){yellowBkgd();});

/*
$(document).ready(function() {
  $('#Col1 .SubNav ul li a').hover(
   function() {
   $(this).parent().addClass('Hover');
   }
   );
   
   $('#Col1 .SubNav ul li a').mouseout(
   function() {
   $(this).parent().removeClass('Hover');
   }
   );
   });*/