

// This function removes parts of the Candle Lighting times
// added from Chabad.org that we don't want in our display
$(function() {
	$('table.CLTable br, span.CLHeadingBold, a.CLheading, table.CLTable tbody tr:nth-child(2)').remove();

});


// This function prepends the print tool for the page tools
$(document).ready(function() {
	$('ul#page_tools').prepend('<li class="print"><a href="#print">Click me to print</a></li>');
	$('ul#page_tools li.print a').click(function() {
		window.print();
		return false;
	});
});

// Adds a binding event to cue a CSS alternative for scaling text
$(document).ready(function() {
	if($.cookie('TEXT_SIZE')) {
		$('body').addClass($.cookie('TEXT_SIZE'));
	}
	$('ul#page_tools a').not('li.bookmark a, li.print a').click(function() {
		var textSize = $(this).parent().attr('class');
		$('body').removeClass('decreaseText increaseText').addClass(textSize);
		$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
		return false;
	});
});

// Initializes the Pop-up Boxes
$(document).ready(function() {
$("a.lightbox").fancybox();
$("a.contact").fancybox({'hideOnContentClick': false});
});

//Adds Span to Sub Navigation "Here" item to show tail of banner

$(function() {
	$('#content_side #sub_nav li.here a').append('<span>');
});

// Makes the Label Disappear on focus within the search box
$(document).ready(function(){
    $("#search_form").magicLabels();
    $("#mail_form").magicLabels();

});