$(document).ready(function() {
	//corners
	$('#masthead').corners('20px bottom');
	$('#content').corners('20px');
	$('.vcard').corners('10px');
	//adjust width for ie
	if(!jQuery.support.cssFloat){
		$('#masthead, #content').css('width', '960px');
	}
	
	//feature accordion
	opened = $('#panel_1');
	maxWidth = 507;
	minWidth = 167;
	$(opened).addClass('opened');
	$('#feature>li').hover(function(){
		if(!($(this).hasClass('opened'))){
			$(opened).animate({width: minWidth+"px"}, { queue:false, duration:600 });
			$(opened).find('p').fadeOut('fast');
			$(opened).removeClass('opened');
			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:600});
			$(this).find('p').fadeIn();
			$(this).addClass('opened');
			opened = this;
		}
	});
	
	//make any offsite link or pdf open in new window
	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	$('a[href*="http://"]').not('a[href*="'+hostname+'"]').attr('target', '_blank');
	$('a[href$=pdf]').attr('target', '_blank');
	
	//add pdf icon to all pdf links in #main_content
	$('#main_content a[href$=pdf]').not('.gallery a').after('&nbsp;<img src="/wp-content/themes/corn-farmers-coalition/images/icon-pdf-12.gif" alt="PDF" />');
});

