$(document).ready(function() {

	$( '#home .sideBar dt:even' ).addClass( 'alt' );
	$( '#home .sideBar dd:even' ).addClass( 'alt' );

	$( '#footer div.searchInput input:first' ).addClass( 'first' );



	$(function(){  
		$('#search .searchResults .entry-title').addClass('dontend'); // dont' put it at the end of a column
		$('#search .searchResults dl').addClass("dontsplit"); // don't split across columns
//		$('.columnize').columnize();
		$('#search .columnize').columnize({
			width: 440
		});
		$('#news-articles .columnize').columnize();
	});  
/*
$('.entry-title').addClass('dontend');
			$('.wide').columnize({
				width : 300,
				height : 400
			});
*/


	$( 'div.contactAperson input' ).focus(function() {
		$( this ).addClass( 'hasFocus' );
	});

	$( 'div.contactAperson textarea' ).focus(function() {
		$( this ).addClass( 'hasFocus' );
	});

	$( 'div.contactAperson input' ).blur(function() {
		$( this ).removeClass( 'hasFocus' );
	});

	$( 'div.contactAperson textarea' ).blur(function() {
		$( this ).removeClass( 'hasFocus' );
	});

	$( 'div.contactAperson textarea' ).autogrow();

	$( 'div.contactAperson label.zemTextarea' ).append( '<br />' );


	$( '#search input:last' ).addClass( 'last' );


	$( 'ul.articleNav li:first' ).addClass( 'first' );

	$( 'ul.articleNav li:last' ).addClass( 'last' );

	$( '#home .sideBar #events dd:last' ).addClass( 'last' );

	$( '#home .sideBar #news dd:last' ).addClass( 'last' );

	$( 'div#announcement h2:first' ).addClass( 'first' );

	$( 'div#newsletter h2:first' ).addClass( 'first' );


	$(function() {
		$( 'div.tel abbr' ).each(function (i) {
			$( this ).prepend( '(' );
			$( this ).append( ')' );
		});
	});

	$(function() {
		$( 'div.tel abbr' ).each(function (i) {
			var p = $( this ).attr('title');
			if ( p != "" ) {
				$( this ).prepend( '<span class="telAlpha">' + p + '</span>' );
				$( this ).append( '<span class="tollFree"> &#8212; toll free in N.America.</span>' );
			}
		});
	});


	$( 'div.collapser' ).append( '<p class="clickToView"><span class="linkify">View transcript &uarr;</span></p>' );

	$( 'div.collapser div.inner' ).append( '<p class="clickToHide"><span class="linkify">Hide transcript &uarr;</span></p>' );

	$( 'div.collapser p.clickToView' ).click(function() {
		$( this ).slideUp();
		$( this ).prev().slideDown();
	});

	$( 'div.collapser p.clickToHide' ).click(function() {
		$( this ).parent().slideUp();
		$( 'p.clickToView' ).slideDown();
	});



	$( '#newsletter strong.open' ).wrapInner( '<span />' );

	$( '#newsletter strong.open span' ).hover(
		function () {
			$( this ).addClass( 'hover' );
		}, 
		function () {
			$( this ).removeClass( 'hover' );
		}
	);

	$( '#newsletter strong.open' ).click(function() {
			$( this ).slideUp( 'fast' );
		$( 'div#newsletter div.collapsed' ).slideDown( 'fast' );
	});

	$( '#newsletter form' ).submit(function() {
		$( ':submit', this ).attr( 'disabled', 'disabled' );
		$( '#newsletter span.button' ).addClass( 'processing' );
	})


	$( 'div.ie li:empty' ).hide(); // nasty IE6 burps up some duplicate, *empty*, li's in the sitemap page.


/* PayPal */
	$('p#payPalInfoIntro').append('&nbsp;<span class="more">Learn more&#8230;</span>');

	$('p#payPalInfoIntro span.more').addClass('linkify');

	$('p#payPalInfoIntro span.more').click(function() {
		$('p#payPalInfoIntro span.more').removeClass('linkify');
		$('dl.payPalInfo').show('slow');
	});



/* 	Mark all # links as .incomplete while we're building */
	$(function() {
		$( 'a' ).each(function (i) {
			var n = $( this ).attr('href');
			if (n == "#") {
				$( this ).addClass( 'incomplete' );
//				$( this ).wrap( '<span class="temp1"> </span>' );
			}
		}
	)});



//Nav

//#ul-Overall
//.li-Org
//.ul-Org
//.li-Indi
//.ul-Indi


	$( '.ul-Org li:first' ).addClass( 'first-Org' );
	$( '.ul-Org li:last' ).addClass( 'last-Org' );

	$( '.ul-Indi li:first' ).addClass( 'first-Indi' );
	$( '.ul-Indi li:last' ).addClass( 'last-Indi' );




	var kkeys = [], konami = "87,69,78,68,89";
	$(document).keydown(function(e) {
	  kkeys.push( e.keyCode );
	  if ( kkeys.toString().indexOf( konami ) >= 0 ){
	    $(document).unbind('keydown',arguments.callee);
		    $( 'p.fluffDesign span.fD' ).wrap( '<a title="Login..." href="&#47;&#116;&#101;&#120;&#116;&#112;&#97;&#116;&#116;&#101;&#114;&#110;&#47;"> </a>' );
		    $( 'p.fluffDesign span.fD' ).addClass( 'active' );
			$( 'p.fluffDesign' ).after( '<p id="debug"><a href="/admin-featured">List featured events</a></p>' );
	  }
	});

});













































