// JavaScript Document

	jQuery.preloadImages = function()
	{
	  for(var i = 0; i<arguments.length; i++)
	  {
		jQuery("<img>").attr("src", arguments[i]);
	  }
	}

	function initMenus() {
		$('ul.menu ul').hide();
		$.each($('ul.menu'), function(){
			$('#' + this.id + '.expandfirst ul:first').show();
		});

		$('ul.menu li a').click(
			function() {
				var checkElement = $(this).next();
				var parent = this.parentNode.parentNode.id;
	
				if($('#' + parent).hasClass('noaccordion')) {
					$(this).next().slideToggle('normal');
					return false;
				}
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
					if($('#' + parent).hasClass('collapsible')) {
						$('#' + parent + ' ul:visible').slideUp('normal');
					}
					return false;
				}
				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
					$('#' + parent + ' ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
					return false;
				}
			}
		);
	}

$(function() {
		   
	initMenus();
	
	$(".topmenu").css({'opacity':'1'});
	$(".topmenu img").hover(function() {
		$(this).fadeTo(200, 0.00);
	}, function() {
		$(this).fadeTo(200, 1.00);
	});

	$(".thumbs").css({'opacity':'1'});
	$(".thumbs img").hover(function() {
		$(this).fadeTo(200, 0.00);
	}, function() {
		$(this).fadeTo(200, 1.00);
	});

	$(window).bind("load", function() { 
		$(".maps_text").css({'display':'block','background':'#FF0'});
		$(".topmenu").css({'background':'#FF0'});
		$(".thumbs").css({'background':'#FF0'});
		$(".attachment-button").css({'background-color':'#FF0'});
	});

	$(".maps_hover").css({'opacity':'1'});
	$(".maps_hover img").hover(function() {
		$(this).fadeTo(200, 0.00);
	}, function() {
		$(this).fadeTo(200, 1.00);
	});

	$(".thumbs a").click(function(){
		var largePath = $(this).attr("href");
		var largeAlt = $(this).attr("title");
		$("#largeImg").attr({ src: largePath, alt: largeAlt });
		$("h2 em").html(" (" + largeAlt + ")"); return false;
	});

	$(".thumb").hover(function() {
		$(this).css("background", $(this).css("background").replace("_off","_on"));
	}, function() {
		$(this).css("background", $(this).css("background").replace("_on","_off"));
	});

	$(".thumb").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});

	$(".thumb .external").click(function(){
    	window.open($(this).attr("href"));return false;
	});

	$(".thumb a").hover(function() {
		$(this).next("em").animate({opacity: "hide", top: "22"}, "fast");
	}, function() {
		$(this).next("em").animate({opacity: "show", top: "0"}, "slow");
	});

	$(".thumbstepper").hover(function() {
		$(this).css("background", $(this).css("background").replace("_off","_on"));
	}, function() {
		$(this).css("background", $(this).css("background").replace("_on","_off"));
	});

	$(".thumbstepper").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});

	$(".thumbstepper a").hover(function() {
		$(this).next("em").animate({opacity: "hide", top: "22"}, "fast");
	}, function() {
		$(this).next("em").animate({opacity: "show", top: "0"}, "slow");
	});
	
	$(".footer_left img").hover(function() {
		$(this).attr("src", $(this).attr("src").replace("_off","_on"));
	}, function() {
		$(this).attr("src", $(this).attr("src").replace("_on","_off"));
	});

	$(".index_yellow_box").hover(function() {
		$(this).animate({backgroundColor:"#ff0"},500);
	}, function() {
		$(this).animate({backgroundColor:"#fff"},1000);
	});

});
