function audioPlayerWindow(winURL) {
	window.open(winURL, 'audio_player','scroll=no,menubar=no,resizable=yes,width=430,height=420');
}

function pullQuotes() {
	parentDiv = $E('#content'); // Node for inserting pullquote
	pqs = $ES('.pq'); // Get all elements with class 'pq'

	pqs.each(function(el, index){
		var parent = el.parentNode;
		var pullquote = document.createElement("blockquote");
		pullquote.addClass('pq');
		var paragraph = document.createElement("p");
		var zspan = el;
		zspan.className = ""; // Insert class name here if desired
	
		var cloned = zspan.cloneNode(true)
		var cuts = cloned.childNodes;
		// alert(cuts);
		for (var i=0; i < cuts.length; i++) {
			if (cuts[i].className = 'cut') {
				cuts[i].innerHTML = '...';
			}
		};
	
		// Sticks the span into the generated paragraph
		paragraph.appendChild(cloned);

		// Sticks the generated paragraph into the generated blockquote
		pullquote.appendChild(paragraph);

		// Inserts the pullquote before the <p> that contains the <span class="pullquote">
		parentDiv.insertBefore(pullquote,parent);
	});
}

window.addEvent('domready', function() {

	var slideSections = ["about", "booking", "current_season", "take_part"];

	var current_page = window.location.href.split("/")[3];
	
	var inactiveSections = slideSections.remove(current_page);
  if (current_page == 'donations') {
  	var inactiveSections = inactiveSections.remove('take_part');
  }

	inactiveSections.each(function(item, index){
		var varName = 'n_' + item + 'Slide';
		var sectionName = 'n_' + item;
		var subSectionName = 'n_' + item + '_sub';

		window[varName] = new Fx.Slide(subSectionName, {duration: 750, transition: Fx.Transitions.Quint.easeOut});
		window[varName].hide();

		$(sectionName).addEvent('mouseenter', function(e) {
			window[varName].slideIn();
			$(sectionName).className = "active"
		});

		$(sectionName).addEvent('mouseleave', function(e) {
			$(sectionName).className = ""
		});
	});

	$('nav').addEvents({
		'mouseleave': function(e) {
			$('nav').fireEvent('poof', e, 1000)
		},
		'poof': function(e) {
			inactiveSections.each(function(item, index){
				var varName = 'n_' + item + 'Slide';
				window[varName].slideOut();
			});
		}
	});

	// pullQuotes();

});
