function addPageTools() {
	var clientDomainName = 'overlakehospital.org',
		clientSiteName = 'Overlake Hospital Medical Center',
		currentPageUrl = document.location,
		currentPageTitle = $.trim($('title').text()),
		emailSubject = clientDomainName + ': ' + currentPageTitle,
		emailHref = 'mailto:?subject=' + escape(emailSubject) + '&body=I thought you would be interested in a page on the ' + escape(clientSiteName) + ' Web site: ' + escape(currentPageTitle) + ' - ' + escape(currentPageUrl);
    var urlToUse = (('https:' == document.location.protocol) ? 'https://secure.addthis.com/js/250/addthis_widget.js#username=overlakehospital' : 'http://s7.addthis.com/js/250/addthis_widget.js#username=overlakehospital');
    $('#PageToolsWrapper').append('<div id="PageTools" class="ClearFix">' +
		'<ul>' +
			'<li class="Email"><a href="' + emailHref + '">Email</a></li>' +
			'<li class="Print"><a href="javascript:;" onclick="print();">Print</a></li>' +
			'<li class="AddThis">' +
				'<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>' +
					'<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=overlakehospital" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()"onclick="return addthis_sendto()">Share</a>' +
					'<script type="text/javascript" src="' + urlToUse + '"></script>' +
			'</li>' +
		'</ul>' +
	'</div>');
}
function addTextSizer() {
    $('#PageToolsWrapper').before('<div id="TextSizer" class="ClearFix"><h2>Text Size</h2><ul>' +
				'<li><a class="NormalFont" href="javascript:;" title="Small Font Size"></a></li>' +
				'<li><a class="LargeFont" href="javascript:;" title="Medium Font Size"></a></li>' +
				'<li><a class="X-LargeFont" href="javascript:;" title="Large Font Size"></a></li>' +
			'</ul></div>');
    $('a.NormalFont').click(function () { $('#Content').removeClass('textLarge').removeClass('textXLarge'); $.cookie('text_sizer', null, { path: '/' }); });
    $('a.LargeFont').click(function () { $('#Content').addClass('textLarge').removeClass('textXLarge'); $.cookie('text_sizer', 'large', { path: '/' }); });
    $('a.X-LargeFont').click(function () { $('#Content').removeClass('textLarge').addClass('textXLarge'); $.cookie('text_sizer', 'xlarge', { path: '/' }); });
    $('#TextSizer a').click(function () { $('#TextSizer a').removeClass('active'); $(this).addClass('active'); });
}


$(document).ready(function(){
	addTextSizer();
	addPageTools();
	
// ----------- TEMPLATE EXTRAS ------------------//

// ----------- HACK LIST START ------------------//
	//remove #Banner if container is empty
	$('#Banner:empty').remove();

	//remove empty cmspage for Homepage
	$('.cmspage:empty').remove();

	//temporary fix for tabs to contain floated elements without them breaking out of tab container
	$('div.Tab').addClass('ClearFix');

	//removing empty table cells in calendar
	$('.CalendarEventDetailHeader td:empty').addClass('Empty');

// ----------- HACK LIST END ------------------//



}); // End Document Ready


