function updateUserAgent() {
  document.getElementById('user-agent').innerHTML = navigator.userAgent;
}
if (navigator.userAgent.indexOf('iPhone') != -1) {
  location.href = 'ip/index.html';
}
if (navigator.userAgent.indexOf('iPod Touch') != -1) {
  location.href = 'ip/index.html';
}
if (navigator.userAgent.indexOf('KDDI') != -1) {
  location.href = 'i/index.html';
}
if (navigator.userAgent.indexOf('DoCoMo') != -1) {
  location.href = 'i/index.html';
}
if (navigator.userAgent.indexOf('SoftBank') != -1) {
  location.href = 'i/index.html';
}



$(document).ready(function(){

// dd 要素を隠す
  $("dt.slide-button + dd").css("display","none");
// dt 要素をクリックして dd 要素を表示する
  $("dt.slide-button").click(function(){
    $(this).next("dd:not(:animated)").slideToggle("fast");
    $(this).toggleClass("active");
    return false;
  });

  $("div#guest").hide();
  $("#guest-openButton").click(function() {
		$("div#guest").addClass("show")
		.fadeIn("fast")
		.css("z-index","100");
		return false;
	});

  $("div#about-event").hide();
  $("#openButton").click(function() {
		$("div#about-event").addClass("show")
		.fadeIn("fast")
		.css("z-index","100");
		return false;
	});
	
  $("div#usergroups").hide();
  $("#usergroups-openButton").click(function() {
		$("div#usergroups").addClass("show")
		.fadeIn("fast")
		.css("z-index","100");
		return false;
	});

  $("div#support").hide();
  $("#support-openButton").click(function() {
		$("div#support").addClass("show")
		.fadeIn("fast")
		.css("z-index","100");
		return false;
	});

	$("#guest-closeButton").click(function() {
		$("div#guest").removeClass("show")
		.fadeOut("fast",function(){
		$("div#guest").css("z-index","0");});
		return false;
	});

	$("#closeButton").click(function() {
		$("div#about-event").removeClass("show")
		.fadeOut("fast",function(){
		$("div#about-event").css("z-index","0");});
		return false;
	});

	$("#usergroups-closeButton").click(function() {
		$("div#usergroups").removeClass("show")
		.fadeOut("fast", function(){
		$("div#usergroups").css("z-index","0");});
		return false;
	});

	$("#support-closeButton").click(function() {
		$("div#support").removeClass("show")
		.fadeOut("fast", function(){
		$("div#support").css("z-index","0");});
		return false;
	});

	$("ul#guestlist a").hover(function() {
	  $(this).next("em").animate({opacity: "show", left: "-250"}, "slow");
	}, function() {
	  $(this).next("em").animate({opacity: "hide", left: "-280"}, "fast");
	});

	
});
