$(function () {

	
	$('#detail img.alt').click(function() {
		gownSwap();
		return false;
	});
	
	// change cursor to make it more obvious to click
	$('#detail img.alt').hover(function() {
		$(this).css("cursor", "pointer");
	});
	

	
	
	$('a.swap').click(function() {
		gownSwap();
		return false;
	});
	
	
	
	function gownSwap() {		
		// items to swap
		var tbig = $('#feature img.gown');
		var tsmall = $('#detail img.alt');
		
		// get src
		var toDisplay = tsmall.attr('src');
		var toHold = tbig.attr('src');
		
		// flip
		tbig.fadeTo('fast',0,function(){
			$(this).attr('src',toDisplay).fadeTo('fast',1);
		});
	
		
		tsmall.attr('src',toHold);
		
	};
	


	$('#toggle>a').toggle(
	function () {
    	$('#togglebox').fadeIn();
    	//return false;
  	},
  	function () {
    	$('#togglebox').fadeOut();
    	//return false;
  	}
  	);

	
	
	// Send To Friend popup
	$("a.popup").fancybox({ 
		'zoomSpeedIn': 300, 
		'zoomSpeedOut': 300,
		'frameWidth': 300,
		'frameHeight':200,
		'hideOnContentClick': false
		}); 
	
	

});                   