$(document).ready(function(){
 
	// adjust margin(s)
	$(""
		+ "div:last-child,"
		+ "fieldset:last-child,"
		+ "form:last-child,"
		+ "img:last-child,"
		+ "li:last-child,"
		+ "ol:last-child,"
		+ "p:last-child,"
		+ "table:last-child,"
		+ "ul:last-child,"
		+ "").css("margin-bottom","0");

	// open external links in new browser window
	$("a[href^='http'], a[href^='https'], a[href*='.pdf']").attr("target","_blank");

	// adjust navigation appearance
	$("#header ul li:first-child, #footer ul li:first-child").css("border-left","0");
	$("#header ul li:last-child").css("border-left","0").find("a").css("margin-right","0");
	
	// back to top link(s)
	$("a.back-to-top").click(function(){
		window.scrollTo(0,0);
		return false;
		});

	// set up and invoke horizontal image scroller
	if($("#scroller").children("div").length < 7) {
		$("#scrollbar").hide();
		}
	else {
		$("#scroller").css("width",($("#scroller").children("div").length * 160) + "px");
		$('#scroller_outer').horizontalScroll();
		}
	
	// initialize faqs
	$("dl.faqs dd").hide();
	$("dl.faqs dt a").addClass("closed");
	// expand and collapse faqs
	$("dl.faqs dt a").click(function(){
		$this = $(this);
		if ($(this).hasClass("closed")) {
			$this.removeClass("closed");
			$this.addClass("open");
			$this.parent().next().fadeIn(750);
			}
		else {
			$this.parent().next().fadeOut(250,function(){
				$this.removeClass("open");
				$this.addClass("closed");
				});
			}
		return false;
		});

	});
