//xpngFix();
(function ($){
$.noConflict();
$(document).ready(function(){
	var searchVal = $('#search-input').val();
	$('#search-input').click(function(){
		this.value= '';
	}).blur(function(){
		if (!this.value)
			this.value = searchVal;
	});
	
	// Lightbox
	$('.absatz, .article-detail, .release-detail, .news-detail, .teaser-box, .right').tinyLightbox({item:'a[rel="lightbox"]'});
	
	$('.architect h3').click(function(){
		$(this).next('.details').slideToggle(300);
	});
	
	// E-Mail Spamschutz
	$('.email').each(function(){
		e = this.rel.replace('/','@');
		this.href = 'mailto:' + e;
		$(this).text(e);
	});

	//teaser group	
	var groupsCount = $('.teaser-group').length,
		groupNr = 1;
	$('.teaser-group .arrow-right').click(function(){
		if (groupNr<groupsCount)
		{
			$(this).parent().parent().hide().next('.teaser-group').show();
			groupNr++;
		};
	});
	$('.teaser-group .arrow-left').click(function(){
		if (groupNr>1)
		{
			$(this).parent().parent().hide().prev('.teaser-group').show();
			groupNr--;
		};
	});
	
	/*
	$('.header_image').slideshow(images, 
		{
			fadeSpeed: 1000,
			changeSpeed: 5000,
			delayBeforeStart: 1000
		}
	);
	*/
	
	jQuery('.maxi').bind('mouseleave', function(){
		jQuery('.maxi').fadeOut(100);
	});
	
	jQuery('.popupclose').click(function(){
		jQuery('#popup_notfound').hide();
	});

});



})(jQuery);


	function closeNotfound()
	{
		jQuery('#popup_notfound').hide();
	}
	
	if((document.getElementById("popup_notfound")) && (document.getElementById("popup_notfound").style.display=="block" || document.getElementById("popup_notfound").style.display==""))
	{
		window.setTimeout("closeNotfound()", 5000);
	}