$(document).ready(function(){
	$(".at-ticket-button").click(function(e){
        var url = $(this).attr('href');
        $.colorbox({width:"80%", height:"80%", iframe:true, href:url, fixed:true});
        return false;
	});

	//$('.event .event-inner').click(function(){
	$('.event .event-inner .summary, .event .event-inner .date, .event .event-inner .image').click(function(){
		$('.information').not( $(this).parent().children('.information') ).each(function(){
			if( $(this).is(':visible') )
			{
				$(this).slideToggle(200);
				$(this).parent().children('.summary').children('h2').children('a').removeClass('expanded');
				$(this).parent().children('.summary').parent().parent().attr('id', '');
			}
		});
		$(this).parent().children('.information').slideToggle(200, function(){
			if( $(this).is(':visible') ){
				$(this).parent().children('.summary').children('h2').children('a').addClass('expanded');
				$(this).parent().children('.summary').parent().parent().attr('id', 'openevent');
				document.getElementById('openevent').scrollIntoView();
			}else if( $(this).is(':hidden') ){
				$(this).parent().children('.summary').children('h2').children('a').removeClass('expanded');
				$(this).parent().children('.summary').parent().parent().attr('id', '');
			} 
		});
		return false;
	});
	
	$('#content-top-dates').hoverscroll({
		width: 216,
		height: 39,
		arrows: false,
		startPixel: $scrollStart+5
	});
	
	$('#oldeventstoggle, #newstoggle, #pagestoggle').click(function(){
		$(this).parent().children('.moresearchitems').slideToggle('slow', function(){
			if($(this).is(':visible')){
				$(this).parent().children('.results').text('resultaten verbergen');
			}else{
				$(this).parent().children('.results').text('alle resultaten weergeven'); 
			}
		});
		return false;
	});
	//$('.event.old .date, .event.old .image, .event.old .summary, , .event.old .information').css({opacity:0.5});
});


