function addTextSizer() {
	$('#PageToolsWrapper').append('<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');});
}
function text_size_checker() {
	var text_sizer_cookie = $.cookie('text_sizer');
	if (text_sizer_cookie==null){$('a.NormalFont').addClass('active')};
	if (text_sizer_cookie=='large'){ $('#Content').addClass('textLarge');$('a.LargeFont').addClass('active') };
	if (text_sizer_cookie=='xlarge'){ $('#Content').addClass('textXLarge');$('a.X-LargeFont').addClass('active') };
}
function addPageTools() {
	var clientDomainName = 'paloscommunityhospital.org',
		clientSiteName = 'Palos Community Hospital',
		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);
	$('#PageToolsWrapper #TextSizer').after('<div id="PageTools">' +
		'<ul>' +
			'<li class="Print"><a href="javascript:;" onclick="print();">Print</a></li>' +
			'<li class="Email"><a href="' + emailHref + '">Email</a></li>' +
		'</ul>' +
	'</div>');
}
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 -->' +
				    '<script type="text/javascript">var addthis_pub = "pch2009";</script>' +
					'<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>');
}


$(document).ready(function () {
    addTextSizer();
    text_size_checker();
    addPageTools();
    addAddThis();

    // ----------- TEMPLATE EXTRAS ------------------//
    //adding class of first on quick links list
    $('#QuickLinks li:first').addClass('First');

    //Remove #Col3 Background style for panels with tab containers
    $('#Col3 .TabStyle').parent().parent().parent().parent().parent().addClass('NoBack');

    //adds div within each cell of .Section table
    $('table.Sections td').wrapInner('<div class="SectionDec"></div>');

    //Remove #Col3 Background style for panels with tab containers
    $('#Col2 .Flush').parent().parent().parent().parent().parent().addClass('Flush');

    $("#QuickLinks:empty").remove();


 
    // ----------- HACK LIST START ------------------//
    //adds disclaimer to Dr Profile print out
    $('div#DrDetail').after('<div class="PrintOnly"><p>The physician listed here, while having admitting privileges, is not an employee or agent of Palos Community Hospital unless otherwise noted.</p></div>');

    //removes doctor photos if they are the default silhouette.jpg files
    $('.DrListContainer .DrList img[src*="silhouette"]').hide();
    $('#DrDetail img[src*="silhouette"]').hide();

    // ----------- HACK LIST END ------------------//

});


