$(function(){
	
	var overop = 0.8; //opacity on mouse over
	var largewidth = '600px';
	var equalwidth = '485px';
	var smallwidth = '370px';
	
	$(".link a").css({opacity:0});
	
	$("#york").mouseover(function(){
		$("#linkphotos :animated").stop();
		$("#york a").animate({opacity:overop});
		$("#york").animate({width:largewidth});
		$("#technogym").animate({width:smallwidth});
	}).mouseout(function(){
		$("#linkphotos :animated").stop();
		$("#york a").css({opacity:0});
		$("#york").animate({width:equalwidth});
		$("#technogym").animate({width:equalwidth});
	});
	
	$("#technogym").mouseover(function(){
		$("#linkphotos :animated").stop();
		$("#technogym a").animate({opacity:overop});
		$("#technogym").animate({width:largewidth});
		$("#york").animate({width:smallwidth});
	}).mouseout(function(){
		$("#linkphotos :animated").stop();
		$("#technogym a").css({opacity:0});
		$("#technogym").animate({width:equalwidth});
		$("#york").animate({width:equalwidth});
	});
	
	if( $('.small').length ) {
		var height_max = 100;
		$('.small .text').each(function(){
			var wys = $(this).outerHeight();
			if( wys > height_max ) height_max = wys;
		});
		$('.small .text').css({height:height_max+'px'});
	}
	
	if( $('#error').length ) {
		var t = setTimeout("$('#error').fadeOut('slow');",2000);
	}
	if( $('#saved').length ) {
		var t = setTimeout("$('#saved').fadeOut('slow');",2000);
	}

});
