$(document).ready(function() {
	
	// hide company name input field
	$('#company-name').hide();
	
	// toggle company input field view on mitgliedschafts form
	$('#radio-firma').change(function() {
		$('#company-name').show();
	});
	$('.radio').change(function() {
		$('#company-name').hide();
	})
	
	
	// print news with excerpt
	// news is defined within news.php
	if (typeof news != 'undefined') {
		$.each(news, function(i, el) {
			$('#news-' + i + ' > p:first-child').html(el.substring(0, 60)).append('&hellip;').siblings('p').html(el).parent().siblings('.int-link').children('a').click(function() {
				$(this).parent().children('a').toggle().parent().siblings('.news-entry').children('p').toggle();
			});
		});
	}
	
	
	// make boxes clickable
	$('.box').not('.no-hover').click(function() {
		var href = $(this).find('a').attr('href');
		window.location = href;
	});
	
	
	// init shadowbox
	Shadowbox.init();	
});
