var eventsCounter = 0;
$(document).ready(function(){
	Cufon.replace('#header .info-box a', {hover: true})('#header .info-box span');
	Cufon.replace('#content H2')('#content .main-content ul.locations li a span.name');
	
    $('div.wpcf7-response-output').replaceWith('');
	$('.wpcf7').prepend('<div class="wpcf7-response-output wpcf7-display-none"></div>');
    
	hideMoreEvents();
	
	$('.upcoming-events a.read-more').click(function(){
	if ( notVisible( $('.upcoming-events ul li:last'))){
		$('.upcoming-events ul li').each(function(i, el){
			if ( notVisible( $(el) ))
				$(el).slideDown();
			
		});
		} else { hideMoreEvents(); }
	});
	
});

function notVisible(obj) { return (obj.css('display') == 'none'); }

function hideMoreEvents(){
	$('.upcoming-events ul li').each(function(i, el){
		if ( i > 2 )
			$(el).hide();
	});
}
