$(document).ready(
	function() {

		//
		// BEGIN homepage slideshow
		$("body.home #slideshow").before('<div id="slideshow_controls">').cycle({
			cleartype: 1, // enable cleartype corrections
			pager: "#slideshow_controls",
			timeout: 7000
		});
		// END homepage slideshow
		//
		
		//
		// BEGIN gallery lightbox
		$("a[rel*='lightbox']").lightBox({
			fixedNavigation: true,
			imageLoading: '/themes/site_themes/20091206/images/jquery.lightbox/loading.gif',
			imageBtnClose: '/themes/site_themes/20091206/images/jquery.lightbox/close.gif',
			imageBtnPrev: '/themes/site_themes/20091206/images/jquery.lightbox/prev.gif',
			imageBtnNext: '/themes/site_themes/20091206/images/jquery.lightbox/next.gif',
			imageBlank: '/themes/site_themes/20091206/images/jquery.lightbox/blank.gif'
		});
		// END gallery lightbox
		//

		// BEGIN toggling add'l listing info content
		$("#listings div.listing_info a.addl_listing_info_toggle").bind('click', addl_listing_info_toggle_info);
		$("#toggle_aired").click(function () {
			$("#listings tr.expired").toggle();
			return false;
		});
		// END toggling add'l listing info content

	}
);

var addl_listing_info_toggle_info = function(e) {
	var target_content = $('div.addl_listing_info', this.parentNode.parentNode);
	if (target_content.css('display') == 'none') {
		target_content.slideDown(350);
		$(this).toggleClass("on");
		$(this).toggleClass("off");
		$(this).text("-");
	} else {
		target_content.slideUp(350);
		$(this).toggleClass("on");
		$(this).toggleClass("off");
		$(this).text("+");
	}
	return false;
};