jQuery(document).ready(function(){
	jQuery('.corners').each(function(){
		//alert(jQuery(this).css('position'));
		if(jQuery(this).css('position')=="static"){
			jQuery(this).css({
				'position':'relative',
				'top':'0',
				'left':'0'
			});
		}
		jQuery(this).append('<img src="/wp-content/themes/cowen/images/corner_tr.png" class="corner tr" /><img src="/wp-content/themes/cowen/images/corner_tl.png" class="corner tl" /><img src="/wp-content/themes/cowen/images/corner_br.png" class="corner br" /><img src="/wp-content/themes/cowen/images/corner_bl.png" class="corner bl" />');
	});
	jQuery('#navigationPrimary ul li a.ourwork + ul').css({
		'width':'125px'
	});
	jQuery('#navigationPrimary ul li a.donate + ul').css({
		'background':'none'
	});
	jQuery('#navigationPrimary ul li ul li:last-child').css({
		'padding-bottom':'6px',
		'background':'transparent url(/wp-content/themes/cowen/images/bg_subnav_right.png) bottom right'
	});
	
	jQuery('#navigationSecondary ul li').mouseover(function(){
		jQuery(this).children('img').fadeIn(150);											   
	});
	jQuery('#navigationSecondary ul li').mouseout(function(){
		jQuery(this).children('img').fadeOut(150);											   
	});
	jQuery('#content img:not(.right, .left)').css({
			'margin-bottom':'15px'
	});
	jQuery('#content img.left').css({
			'margin':'0 15px 15px 0'
	});
	jQuery('#content img.right').css({
			'margin':'0 0 15px 15px'
	});
	jQuery("#content.main h1, #subcontent :header").not('h5').sifr({path: '/swf/', font: 'archerbold', textTransform: 'uppercase'});
	jQuery("#content blockquote").append('<img src="/wp-content/themes/cowen/images/icon_quote_close.gif" />');
	//Cufon.replace('#content h1, #subcontent h4');
	//alert(jQuery(".aside").height());
	
	//alert(jQuery(".aside blockquote").height());
	jQuery(".aside blockquote").each(function(){
		jQuery(this).css({
			'top':(jQuery(".aside").height()-jQuery(".aside blockquote").height())/2+'px'
		});
	});
	jQuery('#homeFlash').flash({
        src: '/CowenSlideshow.swf',
		wmode: 'transparent',
		height: '205',
		width: '613'
    });
    
    
    // jQuery slideToggle
	/* 
	this script works with the code that Wordpress automatically outputs and only requires a small amount of hand coding on the link.
	To use this script make a link with href='#' and add class='toggleButton' in the html view, now back on the WYSIWYG editor make a new 
	paragraph under the link containing the text you want to toggle and the script will take care of the rest. If you have multiple paragraphs 
	for the slide down then you need to wrap them all in a div.
	*/
	jQuery('.toggleButton').parent().next('p,div').hide();
        jQuery('.toggleButton').click(function() {
			jQuery(this).parent().next('p,div').slideToggle('fast');
			    return false;
         });
    
});