/* -------------------------------------------



------------------------------------------- */
function Animation(){};
Animation.prototype = {
	init : function()
	{

		this.wrapAll = $('#wrapAll');
		this.logo08 = $('#logo08');
		this._delayTime = 0;
		
		// url
		this.param = 'top';
		this.url = document.location.search;
		this.url = this.url.substring( this.url.indexOf( this.param ), this.url.length );
		this.topValue = this.url.replace( this.param + '=', '' );
		
		// 最初のアニメーションの有り、無し。
		if( this.topValue != '' )
		{
			this.showBody();
		}
		else
		{
			this.effectStart();
		}
	},
	effectStart : function()
	{
		var _this = this;
		var target = $('#onLoadImgTxt');
		/*
		target.children('img').load(function()
		{
			target.fadeIn(1500, function()
			{
				$('#onLoadImgTxt').fadeOut(1500, function()
				{
					lastAnimation();
				});
			});
		});
		*/
		target.delay(600).fadeIn(1500, function()
		{
			$('#onLoadImgTxt').delay(800).fadeOut(1500, function()
			{
				lastAnimation();
			});
		});


		// -----------------------------------------------------
		function lastAnimation()
		{	
			_this.logo08.fadeIn( 600 );
			
			// 全体
			_this.wrapAll.delay( _this._delayTime ).fadeIn(800, function()
			{
				setTimeout(function()
				{
					_this.blinkAnimationStart();
				}, 1000);
			});
		}
	},
	showBody : function()
	{
		var _this = this;
		
		this.logo08.delay( this._delayTime ).fadeIn( 200 );
		
		this.wrapAll.delay(100).fadeIn(000, function()
		{
			setTimeout(function()
			{
				_this.blinkAnimationStart();
			}, 600);
		});
	},
	// -----------------------------------------------------
	
	// blink animate
	
	// -----------------------------------------------------
	blinkAnimationStart : function()
	{
		$('#blinkLogo01').delay(50).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo02').delay(100).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo03').delay(150).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo04').delay(200).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo05').delay(250).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo06').delay(300).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo07').delay(350).fadeIn(150).delay(20).fadeOut(100);
		$('#blinkLogo08').delay(400).fadeIn(150);
	}
};
