$(function(){
	$('#content.front #visual img').unwrap().unwrap().unwrap().unwrap();
	$('#content.front #visual').cycle();
	$('h1').pir({
		'size':'70px',
		'color':'#666'
	});
	$('h2').pir({
		'size':'30px',
		'color':'#002e60'
	});
	var h2 = $('#text h2');
	$('#content h1').after(h2);
	$('#menu>li:last-child>ul').css({
		left:'auto',
		right:0
	});
	$('#menu li.page-item-5 ul').prepend('<li><a href="http://www.aiomyth.ch/catalog/" target="_blank"><strong>aiomyth shop</strong></a></li>');
	$('#menu>li>ul').each(function() {
		$(this).find('a').each(function() {
			if (widest == null) {
				widest = $(this);
			} else {
				if ($(this).width() > widest.width()) {
					widest = $(this);
				}
			}
		});
		$(this).find('li').each(function(){
			$(this).width(widest.width());
		});
		var widest = null;
	});
	$('#menu li ul:not(:last)').each(function(){
		var parentWidth = $(this).parent().width();
		var elementWidth = $(this).width();
		$(this).css('marginLeft',(parentWidth-elementWidth)/2);
	});
	$('#text').jScrollPane();
	function pdf_links(){
		$('a[href*=.pdf]').attr('target','_blank');
	}
	pdf_links();
	$('#text>br:first').remove();
	$('#text>h3+br').remove();
});
