$(function(){
	
	$('#header').append('<div class="gnavCurrentBar"></div>');
	$('.gnavCurrentBar').hide();
	
	$('.gnavFlex').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'164px',left:'0px',backgroundColor:'#f7cb00',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavEasytone').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'70px',left:164+47+'px',backgroundColor:'#e40580',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavZigtech').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'57px',left:164+70+47*2+'px',backgroundColor:'#4da642',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavTaikan').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'48px',left:164+70+57+47*3+'px',backgroundColor:'#b91027',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavClassic').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'58px',left:164+70+57+48+47*4+'px',backgroundColor:'#885ea6',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavOnline').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'108px',left:164+70+57+48+58+47*5+'px',backgroundColor:'#093679',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavShop').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'52px',left:164+70+57+48+58+108+47*6+'px',backgroundColor:'#093679',opacity:'1'},'fast','easeInOutQuart');},
		function(){backtoDefault();}
	);
	$('.gnavCatalog').hover(
		function(){$('.gnavCurrentBar').stop().fadeIn(0).animate({width:'74px',left:164+70+57+48+58+108+52+47*7+'px',backgroundColor:'#093679',opacity:'1'},'fast','easeOutQuint');},
		function(){backtoDefault();}
	);

	function backtoDefault(){
		$('.gnavCurrentBar').stop().fadeOut('fast');
		//$('.gnavCurrentBar').stop().animate({left:'-200px'},'fast');
	}
	
	/* !検索フィールド */
	$('input.s').focus(function(){
		var $this = $(this);
		$this.addClass('focusS');
		$this.cssAnimate({width: '240px'},'fast');
		if( $this.val() == $this.prop('defaultValue') ){
			$this.val('');
		}
	}).blur(function(){
		var $this = $(this);
		$this.removeClass('focusS');
		$this.cssAnimate({width: '100px'},'fast');
		if( $this.val() == '' ){
			$this.val($this.prop('defaultValue'));
		}
	});
	
});
