var imageIdGlobal = "";
var currentactive = "0";
var animrunning = false;
var latestmouseover = '';
function homeSwapImg(imageId){
	latestmouseover = imageId;
	if (animrunning == false){
		
		imageIdGlobal = imageId;
		if (imageId != currentactive){
			var animfrom = ((parseFloat(currentactive * 950)*-1));
			var animto =  ((parseFloat(imageId * 950)*-1));
			animrunning = true;
			$("#swapimageholder").animate({
				left: animto + 'px'								
			}, 300,
				"sineEaseOut",
			function(){
				animationfinished();
			});
			//styleAnimEase('swapimageholder','left',animfrom,animto,0.35,50,'animationfinished()')
			
			
			$('#info'+currentactive).hide();
			currentactive = imageId;
		}
	}
}
			
function showInfo(){
	if(imageIdGlobal == ''){
		imageIdGlobal = 1;
	}
	 $('#info'+currentactive).hide();
	 $('#info'+imageIdGlobal).show();
}
			
function hideInfo(){
	 $('#info'+imageIdGlobal).hide();
}
			
function isEmpty(v) {
	if (v == undefined) { return true; }
	if (v == null) { return true; }
	if (v == "") { return true; }
	return false;
}
			

function animationfinished() {
	animrunning = false;
	homeSwapImg(latestmouseover);
}

//DOM Ready
$(function(){	
	homeInfoImg= new Image(); 
  homeInfoImg.src="images/common/pop-up.png"; 

	preloadswapimages();
});
