function listenOnline(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=no,width=310,height=260,left = 200,top = 200');");
}


$(document).ready(function() {
	$('.expand-content').before("<a class='open' href='javascript:void(0)'>expand</a>");
	$('.expand-content').css({
		'overflow': 'hidden',
		'display': 'none'
	});
	$('.title-open').css('margin-left', '40px');
	$('.open').hover(function() {
		if($(this).hasClass('selected')) {
		} else {
			$(this).prev('.title-open').css('color','#59b347');
		}
	}, function() {
		if($(this).hasClass('selected')) {
		} else {
			$(this).prev('.title-open').css('color','#444444');
		}
	});
	
	$('.title-open').hover(function() {
		if($(this).next('.open').hasClass('selected')) {
		} else {
			$(this).next('.open').addClass('hover');
			$(this).css('color','#59b347');
		}
	}, function() {
		if($(this).next('.open').hasClass('selected')) {
		} else {
			$(this).next('.open').removeClass('hover');
			$(this).css('color','#444444');
		}	
	});
	
	$(document).click(function() {
		if($('.open').hasClass('selected')) {
			$('.expand-content').hide();
			$('.open').removeClass('selected');
			$('.title-open').css('color','#444444');
		}
	});

	
	$('.open').click(function(e) {
		if($(this).hasClass('selected')) {
			$(this).next('.expand-content').hide();
			$(this).removeClass('selected');
			$(this).prev('.title-open').css('color','#444444');
		} else {
			$(this).next('.expand-content').show();
			$(this).addClass('selected');
			$(this).prev('.title-open').css('color','#59b347');
		}
		e.stopPropagation();
	});
	
	$('.title-open').click(function(e) {
		if($(this).next('.open').hasClass('selected')) {
			$(this).next('.open').next('.expand-content').hide();
			$(this).next('.open').removeClass('selected');
			$(this).css('color','#444444');
		} else {
			$(this).next('.open').next('.expand-content').show();
			$(this).next('.open').addClass('selected');
			$(this).css('color','#59b347');
		}
		e.stopPropagation();
	});
	
	$('.expand-content').click(function(e) {
		e.stopPropagation();
	});
	
	
/* 	Link Tracker  */
	
	$('.ministries_list').css({
		'display' : 'none'
	});
	
	$('.bttn_full_list').addClass('closed');

	
	$('hr.ministry_team').addClass('closed');
	
	$('.bttn_full_list').click(function(event) {
		event.preventDefault();
		if($('.ministries_list').hasClass('open')) {
			$('.bttn_full_list').html('Show Ministry Team List <span>&or;</span>');
			$('.ministries_list').slideUp(800);
			$('.ministries_list').removeClass('open');
			setTimeout(function () {
				$('.bttn_full_list').addClass('closed');
				$('hr.ministry_team').addClass('closed');
			}, 800);
		} else {
			$('.bttn_full_list').html('Hide Ministry Team List <span>&and;<span>');
			$('.ministries_list').slideDown(800);
			$('.ministries_list').addClass('open');
			$('hr.ministry_team').removeClass('closed');
			$('.bttn_full_list').removeClass('closed');
			
		}
	});
	
	$('.headline a.signup').fancybox({
		'width'             : '951px',
		'height'            : '404px',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'overlayOpacity'    : 0.9,
		'overlayColor'      : '#000',
		'autoScale'         : 'false',
		'scrolling'         : 'no'
	});
	
	$('.description').jTruncate({
		length:105,
		moreText: "read more",
		lessText: ""
	});
	
});
