var AnimationSteps = {
	step00 : function(){

	},
	step01 : function(el){
		IntroName.increment++;
		if(IntroName.increment>6){
			return el;
		}else{
			$('#letter'+IntroName.increment).animateIntroName();
		}
	},
	step02 : function(){
		var self = this;
		$('#mainWrapper').fadeIn(300,function(){self.step03()});
		$('#wrapContent').css({height:$('#cH').height()+'px'});
	},
	step03 : function(){
		Navigation.load();
	}
}
jQuery.fn.animateIntroName = function(){
	twidth = $(this).width();
	theight = $(this).height();
	tmarginLeft = parseInt(twidth/2);
	ttop = 50-theight;
	twidthLg = parseInt(twidth*1.6);
	theightLg = parseInt(theight*1.6);
	tmarginLeftLg = parseInt(twidth*1.6/2);
	ttopLg = 50-parseInt(theight*1.6);
	this.animate({
			width:parseInt(twidthLg*1.6)+'px',
			height:parseInt(theightLg*1.6)+'px',
			marginLeft:'-'+tmarginLeftLg+'px',
			top:ttopLg+'px',
			opacity:'1.0'
		},200,'swing',function(){AnimationSteps.step01(this)})
		.animate({
			width:twidth+'px',
			height:theight+'px',
			marginLeft:'-'+tmarginLeft+'px',
			top:ttop+'px'
		},200,'swing',function(){
				if(IntroName.increment>6){
					$('#introName').fadeOut(300,function(){AnimationSteps.step02()})
				}
			});
}
jQuery.fn.correctBGPNG = function(){
	return this.each(function(){
		var sizingMethod = ($(this).css('backgroundRepeat')=='repeat' || $(this).css('backgroundRepeat')=='repeat-x' || $(this).css('backgroundRepeat')=='repeat-y')?'scale':'crop';
		var img = $(this).css('backgroundImage');
		var simg = img.substring(5,(img.length-2));
		$(this).css({background:'url(blank.gif)'});
		$(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+simg+"',sizingMethod='"+sizingMethod+"')";
	});
}
jQuery.fn.setIntroNameWidth = function(){
	return this.each(function(){
		twidth = $(this).width();
		theight = $(this).height();
		tmarginLeft = parseInt(twidth/2);
		ttop = 50-theight;
		$(this).css({position:'relative',left:'50%',marginLeft:'-'+tmarginLeft+'px',top:ttop+'px'});
	});
}
