
$(document).ready(function(){
	ConfigureImageSwap();
	ConfigureImageCycle();
});

function ConfigureImageSwap()
{
	$(".ImageSwap-main").css("cursor","pointer");
	$(".ImageSwap-alternate").css("cursor","pointer");
	$(".ImageSwap-alternate").hide();
	
	$(".ImageSwap-main").mouseover(function(){
		$(this).hide();		
		$(this).next(".ImageSwap-alternate").show();	
	});
	
	
	$(".ImageSwap-alternate").mouseout(function(){
		$(this).hide();
		$(this).prev(".ImageSwap-main").show();	
	});
	
}

function ConfigureImageCycle()
{
	$(".ImageCycle").hide();
	
	$(".ImageCycle:first").show();
	
	var strControls = "";
	var i = 1;
	
	jQuery.each($(".ImageCycle"),function(){
		strControls += "<span class=\"ImageControl\" id=\"Control-" + i + "\">" + i + "</span>";
		i++;
	});
	
	$(".ImageCycle:first").before("<div class=\"clearfix\">" + strControls + "</div>");
	
	$(".ImageControl").css("cursor","pointer");
	$(".ImageControl").hover(function(){
		var index = parseInt( this.id.substr(this.id.indexOf("-")+1) );
		$(".ImageCycle").hide();
		$(".ImageCycle:eq(" + (index-1) + ")").show();
	});
}