// JavaScript Document

		var profileHeight;
		var profileNow = false;
		var h_pos;

$(document).ready(function(){
		$("div#container").fadeTo(0,0);
		menuAnimete();
		$("div#container").fadeTo(500,1,h1Start);
		
		function h1Start(){
		$("div.hGroup h1").fadeTo(500,1,h2Start);
		};

		function h2Start(){
		$("div.hGroup h2").fadeTo(500,1);
		};
		
		function menuAnimete() {
			$("div#menu").animate({bottom:25,opacity: 1.0},500);
		}
		
		// プロフィール

/*		$("img.over").fadeTo(0,1);
		$("img.over").hover(function(){
						$(this).fadeTo(300,0);
				},
				function(){
						$(this).fadeTo(300,1);
				});
		
		$("img.over2").hover(function(){
						$(this).fadeTo(100,0.7);
				},
				function(){
						$(this).fadeTo(100,1);
				});
*/
					$(function(){
							$("a","p.btn").each(function(i){
								$(this).replaceWith("<span id='cfG"+i+"' class='cfGroup'></span>");
								$("span#cfG"+i)
									.append("<span class='cfGM'><span class='cfGLeft'><span class='cfGRight'>"+$(this).text()+"</span></span></span>")
									.append($(this).clone());
												
								$("a","span#cfG"+i).hover(function(){
									$(this).queue([]).fadeTo("fast",0);
								},function(){
									$(this).queue([]).fadeTo("fast",1);
								});
								
							});
						});
					
					$("a.profileBtn").click(function(){
						fadeProfile();		
					});
			
					$("span#closeBtn").click(function(){
						fadeProfile();		
					});
			
			function fadeProfile(){
						if(!profileNow){
						//表示
						$("div#profile").show();
						/*$("div.hGroup h1").fadeTo(500,0.5);
						$("div.hGroup h2").fadeTo(500,0.5);*/
						$("div#container").fadeTo(200,0.1,function (){$("div#profile").animate({opacity: 0.95, top: h_pos},400)});
						getHeight ();
						//$("div#profile").animate({opacity: 0.95, top: h_pos},500);
						profileNow=true;
						}else{
						//非表示
						$("div#profile").animate({opacity: 0, top: -h_pos},500,function () {$("div#container").fadeTo(200,1)});
						//$("div#container").fadeTo(200,1,function (){$("div#profile").animate({opacity: 0, top: -h_pos},500)});
						$("div.hGroup h1").fadeTo(500,1);
						$("div.hGroup h2").fadeTo(500,1);
						profileNow=false;
						}
			}
			
			function containerFade () {
						$("div#container").fadeTo(500,0.4);
			}
					
					});
			
			function getHeight () {
				var obg = document.getElementById("profile");
				profileHeight=obg.clientHeight;
				h_pos = window.innerHeight/2-(profileHeight/2);
				obg.style.top=-h_pos+"px";
				//console.log(h_pos);
			}
