$(document).ready(function(){
	var height;
	// adjust height recording to screen height
	if(screen.height <= 600 ) {
		height = 400;
		$("#cboxWrapper .wrapper-box-content").css("height", "346")
	} else {
		height= 550;
	}
	
	$(".show-comments").colorbox({iframe:true,width:"600px",height:"" + height + "px"});
		
	$(".show-card").click(function(){
		var url = $(this).attr('rel');
		$.fn.colorbox({width:"880px",height:"" + height + "px", open:true, href:url});
	});
	
	// Preview Link
	$(".preview").colorbox({width:"942px",height:"714px"});

	$('ul#evaluation .notes').hide();
  
  // Accordeon function 
	$('.notes-link a').toggle(function(){
		$(this).text('Bemerkungen schliessen').parents().next('.notes').show();
	},function(){
		$(this).text($(this).attr('title')).parents().next('.notes').hide();
	});
	
	// Charlimit Call
	$('#msg').keyup(function(){
 		limitChars('msg', 290, 'charlimitinfo');
 	})

	
}); 
