	var myGallery;
	var $j = jQuery.noConflict();

	function startGallery() {
		myGallery = new gallery($('myGallery'), {
		});
	}
	window.onDomReady(startGallery);
$j(function(){
	var href = location.href
	if (href.indexOf('countermeasures')==-1 && href.indexOf('exterior') ==-1) {
		$j('h3.archives').next('ul').hide();
		$j('h3.archives').click(function(){
			// $j(this).children('a').addClass('active');
			$j(this).next('ul').slideDown();
			return false;
		});
	}
	$j('a.statement').click(function(){
		$j('#statement').css('visibility','visible');
		var divHeight;
		if ($j(this).hasClass('active')) {
			divHeight = {height: '0', opacity: '0'};
			myGallery.prepareTimer();
			$j('a.play').addClass('pause').removeClass('play');
		} else {
			divHeight = {height: '140px',opacity: '.9'};
			myGallery.clearTimer();
			$j('a.pause').addClass('play');
		}
		$j('#statement').animate(divHeight, 300, function(){closeStatement()});
		$j(this).toggleClass('active');
		myGallery.clearTimer();
		return false;
	});
	
	function closeStatement(){
		$j('#statement').one('click',function(){
			$j('#statement').animate({height: '0', opacity: '0'});
			$j('a.statement').removeClass('active');
			$j('a.play').addClass('pause').removeClass('play');
			myGallery.prepareTimer();
		});
	}
});