jQuery(function($) {
	if($.browser.msie) { $(".col3 > li").addClass("noStyle"); }
	$(".imageList img").each(function(i) {
		$(this).height("auto");
		$(this).width(220);
		$(this).click(function(){ changeImage(this); });
	});
	$(".imageLarge img").mouseover(function(){ fadeInImage(this); });
	$(".imageLarge img").mouseout(function(){ fadeOutImage(this); });
	
	$('#imgList img').each(function(i) {
		$(this).bind("click", function() {
			document.location.href = $(this).parent().parent().attr("href");
		});
		$(this).mouseover(function() {
			fadeImage(this);
		});
		$(this).mouseout(function() {
			fadeImage(this);
		});
	});
	$('#content > .imageLinks > .bottombox1 a').prepend("»&nbsp;");
});

function changeImage(id) {
	$(".imageLarge img").fadeOut("slow");
	$(id).fadeOut("slow", function() {
		$(id).attr("title",$(".imageLarge img").attr("src"));
		$(".imageLarge img").attr("src",$(id).attr("src"));
		$(".imageLarge img").width('auto');
		$(".imageLarge img").height('auto');
		$(id).attr("src",$(id).attr("title"));
		$(id).width(220);
		$(id).height('auto');
		var aux = $(".imageLarge img").attr('name');
		$(".imageLarge img").attr('name', $(id).attr('name'));
		$(id).attr('name', aux);

	});
	$(id).add(".imageLarge img").fadeIn("slow");
}

function fadeImage(id) {
	$(id).attr("title",$(id).attr("src"));
	$(id).attr("src",$(id).attr("alt"));
	$(id).attr("alt",$(id).attr("title"));
}

function fadeInImage(id) {
	var aux = $(id).attr('name');
	if (aux.indexOf('jpg') != -1 ) {
			$(id).clone(true).addClass('temp').attr({ 'src': aux, 'name': $(id).attr('src')})
			.insertAfter($(id)).hide()
			.mouseout(function(){
				$(this).fadeOut('slow', function() { $(this).remove() });
			})
			.fadeIn('slow');
		
	}
}

function fadeOutImage(id) {
	
}


