$(function(){
	$('.projects .project').find('.title').hide().end().hover(function(){
		$('.title',this).stop().fadeTo(500,0.7);
	},function(){
		$('.title',this).stop().fadeTo(500,0);
	})
	$('.children li a').hover(function(){
		var klass = $(this).attr('class').replace(/^page_/,'.project_');
		$('#gallery').find(klass).find('.title').stop().fadeTo(500,0.7);
	},function(){
		var klass = $(this).attr('class').replace(/^page_/,'.project_');
		$('#gallery').find(klass).find('.title').stop().fadeTo(500,0);
	})
	if($('.mini_nav hr').next().length == 0){
		$('.mini_nav hr').hide();
	}
	$('.teaser_link').click(function(){
		var $teaser = $(this).parent().next('.teaser')
		$teaser.css({
			marginLeft:-$teaser.width() / 2,
			marginTop:-$teaser.height() / 2
		})
		$('.teaser_screen').fadeIn(300, function(){
			$teaser.show();
		})
		return false;
	})
	$('.teaser_screen, .close_link').click(function(){
		$('.teaser_screen, .teaser').hide();
		var $i = $('.teaser iframe');
		$i.attr('src',$i.attr('src'));
		return false;
	})
})
