$(document).ready(function() {	
	jQuery.easing.easeOutQuad = function (B, C, A, E, D) {
		return -E * (C /= D) * (C - 2) + A; };
		
	var msie_hack = $.browser.msie & $.browser.version < 9;
	
	if ( !msie_hack ) {
		$("#fr_image").css('backgroundImage', 'url(' + $("#fr_image img.fri1").attr('src') + ')');
		$("#fr_image img.fri1").hide();
	}

	$("#fr_list li").bind("mouseenter", function(){
			var el = $(this),
				t = el.position().top,
				o = ( el.outerHeight(1) - el.outerHeight(0) ) / 2,
				imgClass = el.attr('rel');

			if ( el.hasClass('active') )
				return;
			$("#fr_arrow").stop();
			$("#fr_items #fr_arrow").animate({ top: t+o	}, 400, "easeOutQuad", 
					function() {
						$("#fr_list li.active").removeClass('active');
						el.addClass('active');
						if ( !msie_hack ) {
							$("#fr_image").fadeTo(150, .5, function(){ 
											$(this).css('backgroundImage', 'url(' + $("#fr_image img." + imgClass).attr('src') + ')')
												.fadeTo(300, 1);
							});
						} else {
							$("#fr_image img.active").fadeOut(200).removeClass('active');
							$("#fr_image img." + imgClass).fadeIn(400).addClass('active');
						}
					}
			);
	})
		.bind('click', function() {
			location.href = $(this).find('a').attr('href');
	})	
		.hover(
			function() { $(this).find('a').css('textDecoration', 'underline') },
			function() { $(this).find('a').css('textDecoration', 'none') }
	);
});

