//client stuff

function addTextSizer()
{
	var imgPath = '/imgs/icons/';
	var theHref = 'href="#"';
	$("#PageToolsWrapper").append("<div id=\"TextSizer\" class=\"ClearFix\">" +
			"<h2>Text Size</h2>" +
			"<ul>" +
				"<li>" +
					"<a class=\"Normal\"" + theHref + ">Small Font Size</a>" +
				"</li>" +
				"<li>" +
					"<a class=\"Large\"" + theHref + ">Medium Font Size</a>" +
				"</li>" +
				"<li>" +
					"<a class=\"X-Large\"" + theHref + ">Large Font Size</a>" +
				"</li>" +
			"</ul>" +
		"</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; });
}
function addPageTools()
{
	var imgPath = '/imgs/icons/';
	$("#PageToolsWrapper #TextSizer").after("<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 = 'paloscommunityhospital.org';
	var clientSiteName = 'Palos Community Hospital';
	var titleEl = document.getElementsByTagName('title')[0];
	var currentPageTitle = "";
	if (titleEl.text)
	{
		currentPageTitle = titleEl.text;
	}
	else
	{
		currentPageTitle = title.data;
	}
	currentPageTitle = escape(currentPageTitle);
	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 addAddThis() {
	var urlToUse = (("https:" == document.location.protocol) ? "https://s7.addthis.com/js/250/addthis_widget.js?pub=pch2009" : "http://s7.addthis.com/js/250/addthis_widget.js?pub=pch2009");
	var imgPath = '/imgs/icons/';
	$("#AddThis").append("<p>" +
				"<!-- AddThis Button BEGIN -->" +
					"<a href=\"http://www.addthis.com/bookmark.php?v=250&pub=pch2009\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\">" +
					"<img src=\"/imgs/lg-share-en.gif\" width=\"125\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0\"/>" +
					"</a>" +
					"<script type=\"text/javascript\" src='" + urlToUse + "'></script>" +
				"<!-- AddThis Button END -->" +
	"</p>");
}
function addExtras() {
	//adding class of first on quick links list
	$('#QuickLinks li:first').addClass("First");
	
	//Temporary fix for Tabs to include ClearFix class on tab for floating elements within (should be fixed in core)
	$('.Tab').addClass('ClearFix');
	$('#Col3 .cmspanel').addClass('ClearFix');
	
	//adds div within each cell of .Section table
	$('table.Sections td').wrapInner('<div class="SectionDec"></div>');
	
	//removes doctor photos if they are the default silhouette.jpg files
    $(".DrListContainer .DrList img[src*='silhouette']").hide();
    $("#DrDetail img[src*='silhouette']").hide();
	
}
$(document).ready(function(){addTextSizer();});
$(document).ready(function(){addPageTools();});
$(document).ready(function(){addAddThis();});
$(document).ready(function(){addExtras();});