// AnimatedSectionImages - this is a trio of images at the top of a page that animates and leads to sections.
var gfinishwidth='215px';
var	gfinishheight='287px';

var SectAni = {
	anispeed:1100,
	ease:'swing',
	
	currloc:{},
//positions of images both start and finish
	leftpos:{
		left: $('.leftloc').css('left'),
		top:$('.leftloc').css('top'),
		width:$('.leftloc').css('width'),
		height: $('.leftloc').css('height'),
		finishleft:'10px',
		finishtop: '20px',
		finishwidth:gfinishwidth,
		finishheight:gfinishheight
		 },
	centerpos:{
		left: $('.centerloc').css('left'),
		top:$('.centerloc').css('top'),
		width:$('.centerloc').css('width'),
		height: $('.centerloc').css('height'),
		finishleft:'140px',
		finishtop: '20px',
		finishwidth:gfinishwidth,
		finishheight:gfinishheight
		},
	rightpos:{
		left: $('.rightloc').css('left'),
		top:$('.rightloc').css('top'),
		width:$('.rightloc').css('width'),
		height: $('.rightloc').css('height'),
		finishleft:'300px',
		finishtop: '20px',
		finishwidth:gfinishwidth,
		finishheight:gfinishheight},
	HoverOver: function(evt){
		
		var trgt = evt.currentTarget;
		var _sectani = this;
		if ($(trgt).hasClass('leftloc'))
		{
			_sectani.currloc = _sectani.leftpos;
		}
		if ($(trgt).hasClass('centerloc'))
		{
			_sectani.currloc = _sectani.centerpos;
		}
		if ($(trgt).hasClass('rightloc'))
		{
			_sectani.currloc = _sectani.rightpos;
		}
				
		$(trgt).next().css('z-index','6');
		//console.log(_sectani.currloc);
		
		$(trgt).next().stop().animate({
			left:_sectani.currloc.finishleft,
			top:_sectani.currloc.finishtop,
			width:_sectani.currloc.finishwidth,
			height:_sectani.currloc.finishheight
		},_sectani.anispeed,_sectani.ease, 
			function(){
								
			});
		$(trgt).next().find('img').stop().animate({
			left:_sectani.currloc.finishleft,
			top:_sectani.currloc.finishtop,
			width:_sectani.currloc.finishwidth,
			height:_sectani.currloc.finishheight
		},
		{duration:_sectani.anispeed,queue:false}
		);
										   
		$(trgt).next().find('.cover').fadeTo('normal',0,function(){});
//				$(this).find('img').fadeTo('normal',0,function(){});
		
	},
	HoverOut: function(evt){
		var trgt = evt.currentTarget;
		var _sectani = this;

		if ($(trgt).hasClass('leftloc'))
					{
						_sectani.currloc = _sectani.leftpos;
					}
					if ($(trgt).hasClass('centerloc'))
					{
						_sectani.currloc = _sectani.centerpos;
					}
					if ($(trgt).hasClass('rightloc'))
					{
						_sectani.currloc = _sectani.rightpos;
					}
					$(trgt).next().css('z-index',5);
					//console.log(currloc);
					$(trgt).next().stop().animate({
						left:_sectani.currloc.left,
						top:_sectani.currloc.top,
						width:_sectani.currloc.width,
						height:_sectani.currloc.height
				   },_sectani.anispeed,_sectani.ease,
				   	function(){
					});
					
					$(trgt).next().find('img').stop().animate({
						left: _sectani.currloc.left,
						top:_sectani.currloc.top,
						width:_sectani.currloc.width,
						height:_sectani.currloc.height
				   },{duration:_sectani.anispeed,queue:false});
					
					$(trgt).next().find('.cover').fadeTo('normal',1,function(){$(trgt).next().css('z-index',4);});
				   
	
	}
};




