// Hello jQuery!
$(document).ready(function(){

$('#content .column:eq(1)').addClass("right_col");
$('#secondary li:eq(0)').addClass("first");

 var featEvLast = $('#feats_events_content a').length -2
 $('#feats_events_content a:eq(' + featEvLast + ' ) ').addClass("last")

// Accordion functions
	jQuery.fn.accordion = function(options) {
	    // options
	    var SLIDE_DOWN_SPEED = 'fast';
	    var SLIDE_UP_SPEED = 'fast';
	    var startClosed = options && options.start && options.start == 'closed';
	    var on = options && options.on && (typeof options.on == 'number' && options.on > 0) ? options.on - 1 : 0;
	    return this.each(function() {
	        jQuery(this).find('dd').hide();
	        jQuery(this).find('dt').click(function() {
	            var current = jQuery(this.parentNode).find('dd:visible');
	            var next = jQuery(this).find('+dd');
	            if (current[0] != next[0]) {
	                current.slideUp(SLIDE_UP_SPEED);
					next.slideDown(SLIDE_DOWN_SPEED);
	            }
	        });
// Make the arrows switch positions. Only works if there are two items.
	        jQuery(this).find('dt').click(function() {
	            var current = jQuery(this.parentNode).find('dd:visible');
	            var next = jQuery(this).find('+dd');
	            if (current[1] != next[1]) {
	                jQuery("a").toggleClass("on");
	            }	            
	        });
	        if (!startClosed) {
	            jQuery(this).find('dd:eq(' + on + ')').slideDown(SLIDE_DOWN_SPEED);
	        }
	    });
	};

// Sets the Accordion on the home page
    $('#feats_events_profiles').accordion({on: 2});

// zebra tables
$(function() {
	$("table").each(function(){
		$("tr:nth-child(odd)").addClass("odd");
	});
});

}); // Bye-bye jQuery!

// For IE hover flicker bug
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
