$(function(){	//// current location
	var contentItems = new Array('', 'about', 'artists', 'awards', 'events', 'message', 'news');		for (i in contentItems) {		var dirRegExp = new RegExp('\/'+contentItems[i]+'\/');		if (location.pathname.match(dirRegExp)) { var currentIndex = i };	}			//// title : height adjusting		function resizeTitle(){ 		$('#title').height($(document).height());	}		resizeTitle();		$(window).resize(function(){ resizeTitle(); });		//// menu_main : submenu action		// - current menu item is pink and its submenu opened by default	$('#menu_main > li:eq('+currentIndex+')')		.addClass('current')		.find('img:first').each(function(){			var imgSrc = new String(this.src);			this.src = imgSrc.replace(/_0\.gif$/, '_1.gif');		}).end()		.children('.submenu').show(0, function(){ $(this).parent().addClass('open'); });	// - function to close submenu	$.fn.closeSubmenu = function() {		this			.children('.submenu')				.stop(true, true)				.slideUp(500,'swing')				.siblings('a').children('img')					.attr('src', function(){						return this.src.replace(/_1\.gif$/, '_0.gif');					})				.end().end()			.end()			.removeClass('open');		return this;	}	// - open submenu on mouse enter	$('#menu_main li:has(.submenu)')		.mouseenter(function(){			$(this)				.siblings('li.open').closeSubmenu().end()				.children('a').children('img').attr('src', function(){ return this.src.replace(/_0\.gif$/, '_1.gif'); }).end().end()				.children('.submenu').stop(true, true).slideDown(500).end()				.addClass('open');		})		.children('a').click(function(){ if ($(this).parent('.current').length) return false; });		// - close submenu on mouse leave	$('#menu_main')		.mouseleave(function(){			$(this).find('.current:not(.open)')				.children('.submenu').stop(true, true).slideDown(500).end()				.addClass('open');			$(this).find('.open:not(.current)').closeSubmenu();		});		//// menu_main : swap img	//	$('#menu_main li:not(#totop):not(.current) img')//		.mouseenter(function(){//			var imgSrc = new String(this.src);//			this.src = imgSrc.replace(/_0\.gif$/, '_1.gif');//		})//		.mouseleave(function(){//			var imgSrc = new String(this.src);//			this.src = imgSrc.replace(/_1\.gif$/, '_0.gif');//		});		//// menu_header : submenu action		$('#menu_header li:has(.submenu)')		.mouseenter(function(){			$(this)				.children('.submenu').fadeIn(500).end()				.addClass('open');		})		.mouseleave(function(){			$(this)				.children('.submenu').fadeOut(500).end()				.removeClass('open');		});	
		//// smooth scroller		function smoothScroll(location) {		if (location.hash) {			var hash = location.hash		} else {			var hash = location.search.replace(/\?/, '#');		}				if ($(hash).offset()) {			if (!hash || hash == '#' || hash.search(/intro|grand-prize|final-screening/) > 0) {				$($.browser.safari ? 'body' : 'html').animate({ scrollTop: 0 }, 1500, 'swing');			} else {
				$($.browser.safari ? 'body' : 'html').animate({ scrollTop: $(hash).offset().top - 120 }, 1500, 'swing');			}		}
	}		smoothScroll(location);	
	$('a[href*=#]').click(function(){		var currentDirRegExp = new RegExp('\/'+contentItems[currentIndex]+'\/');		if (this.pathname.match(currentDirRegExp)) {			smoothScroll(this);
			return false;
		} else {			return true;		}	});
	//// scroll follow	
	$('#follow').scrollFollow({
		speed: 1000,
		offset: 0,
		easing: 'easeOutQuart'
	});	//// news' more link		$('.article:has(a.more)')		.addClass('has_more')		.hover(			function(){ $(this).css('background-color', '#f1f1f1'); },			function(){ $(this).css('background-color', 'transparent'); }		)		.click(function(){			location = $(this).children('a.more').attr('href');		})		.children('a.more').hide(0);		/// event list	$('.events tr:has(a)')		.css('cursor', 'pointer')		.hover(			function(){ $(this).css('background-color', '#f1f1f1'); },			function(){ $(this).css('background-color', 'transparent'); }		)		.click(function(){			location = $(this).find('a:first').attr('href');		});	//// mail address
	$('#mail_aatm2010')
		.text('こちらのアドレス')
		.css('cursor','pointer')
		.click(function(){
			$(this).fadeOut('slow',function(){
				$(this).text('info2010');
				var addr = $(this).text() + '@' + 'artawardtokyo.jp';
				$(this).attr('href','mailto:'+addr).text(addr).show();
			}).unbind();
			return(false);
		});


});

