jQuery.noConflict(); 
;(function($) {

// center at screen resolution
function margin_left() {
	width = (!document.all)?window.innerWidth:document.documentElement.clientWidth;
	min_width = 1120; // (160*2)+800
	if (width <= min_width) return 10;
	else return (width - 800)/2 - 160;
}
$("#wrapper").css('margin-left', margin_left());
// ex_images frame
$("#ex_images").css('overflow', 'visible');
// content div fading
$("#content").css('opacity', 0);

$(document).ready(function(){

	// Menu
	$('#main_menu a + ul').each(function() {
			if ($(this).children().hasClass('current')) {
				$(this).prev().addClass('js-icon-fold');
			}
			else { 
				$(this).hide();
				$(this).prev().addClass('js-icon-unfold');
			}
	});
	
	$('#main_menu a + ul').prev().bind('click', function() {
			if ($(this).hasClass('js-icon-unfold')) {
				$(this).removeClass();
				$(this).addClass('js-icon-fold');
			}
			else {
				$(this).removeClass();
				$(this).addClass('js-icon-unfold');
			}
			$(this).next().slideToggle('normal');
	});
	
	// content div fading
	$("#content").fadeTo(1000, 1);


	// collaborations page
	$(".collaborator > ul").hide();
	$(".collaborator .name").css("cursor", "pointer");
	$(".collaborator .name").attr("title", "Exhibitions at Invaliden1");

	$(".collaborator").click(function () {
			$(this).children("ul").slideToggle("slow");
	});
});
})(jQuery);
