$(document).ready(function(){

	$(".toggle").click(function(){
		$(this).toggleClass("compact").prev(".tail").toggle();
		$(this).text( ($(this).is(".compact")) ? "Less" : "More" )
		return false;
	});

	if($('.sliderA').length) {

		$('.sliderA').accordion({
			header: "dt",
			navigation: true,
			event: 'mouseover',
			active: '.selected',
			collapsible: true
		});

	}

	if($('#overlay').length) {

		$("a.overlay").click(function(){
			var fragment = $(this).attr("href");
			if(fragment.slice(0,1) == "#") {
				$(fragment).show();
				$("#overlay").show();
			} else {
				$("#overlay .window:first .body").load(fragment+" .story",function(){
					$("#overlay").show();
					$("select").css("visibility", "hidden");
					$("#overlay .window:first").show();
				});
			}
			
			return false;
		});

		$("#overlay .close").click(function(){
			$(this).closest("#overlay").hide();
			$(this).closest(".window").hide();
			$("select").css("visibility", "visible");
			return false;
		});

	}

	if($("body#home").length) {

		if(!document.referrer.match("/"+document.domain+"/")) {
		
			overlay_timeout = setTimeout(function() {
				$("a[href='disclaimer.htm']").click();
			},100);

		}

	}

});
