$(function(){
	$('.header-slider').waitImgLoad(function(){
		this._sliderCF({
			show:0,
			pagination:'.header-slider-paginator>li',
			duration:1000,
			slideshow:6000
		})
		$('.spinner',this).remove();

var nav=$('nav')
	nav
		.find('>ul>li>a')
			.append('<span class="d-bg"></span>')
		.bind('mouseenter',function(){
			var th=$(this)
			th.stop().animate({color:'#fff'}),
			$('.d-bg',th).stop().animate({opacity:0})
		})
		.bind('mouseleave',function(){
			var th=$(this)
			if(th.parent().is('.active'))
				void(0)
			else
				th.stop().animate({color:'#012d5e'}),
				$('.d-bg',th).stop().animate({opacity:1})
		})

})

	var conteiner=$('.conteiner'),
				footer=$('footer'),
				duration=0
			footer.css({left:footer.attr('offsetLeft'),top:footer.attr('offsetTop'),margin:'0 auto'}).animate({top:document.body.offsetHeight-footer.height()},duration)
			conteiner
				.css({left:conteiner.attr('offsetLeft'),top:conteiner.attr('offsetTop'),margin:'0 auto'})
				.animate({top:0,width:'1020px',left:'+=76px'},duration,function(){
					$(this).css({left:0,marginBottom:'-38px'})
					footer.css({top:0,left:0})
					$('body').removeClass('splash').addClass('subpages')
					$('footer .header-slider-paginator').css({right:'0px',bottom:'6px'}).appendTo('header')
				})
			$('.header-slider')
				.css({width:'auto'}).animate({height:'474px'},duration)
			
			$('.header-slider img')
				.animate({width:'1173px',marginLeft:0,marginTop:'-50px'},duration)
				.parent()
					.css({overflow:'hidden'})
					.animate({height:'474px'},duration)
			$('header table').animate({left:'0px', right:'0px'},duration)
			$('.footertext').animate({marginTop:'0px',paddingTop:'12px'},duration)
			$('.logoright').animate({right:0},duration)
			$('.splash-bg').fadeOut(duration)
			$('header .models').show()
			$('#content').show()
			$.scrollTo(0)
			footerresize()
			subnavigationheight()
			galleryshow()
			return false
			
})


			
		
			
			

