	$(function() {
	
		// Add first article title under milestones on the home page
		$('#milestones-list li a[href*=selected-by-doe]')
			.css({'color':'#D78712', 'font-weight':'bold'});
			
		$('#post-682 div:nth-child(2) img.block').css({'width':'440px', 'height': '63px'}); // resize arpae banner for news & events page only

		$('#slideshow').cycle({ // Slideshow on home page
 		   	fx:    'fade',
 		   	timeout: 5000, 
 		   	speed:  500,
 		   	pause: 1,
 		   	shuffle: 1,
 		   	random: 1,
 		   	containerResize: 0,
 		   	next: '#slideshow'
 		});
 		
		$('#slideshow-text').cycle({ // Slideshow rotating captions to right of slideshow
 		   	fx:    'blindX',
 		   	timeout: 12000, 
 		   	speed:  1200,
 		   	pause: 1,
 		   	shuffle: 1,
 		   	random: 1,
 		   	containerResize: 0,
 		   	prev: '#text-prev',
 		   	next: '#text-next',
 		   	sync: 0
 		}).css('opacity', 0.7);
 		
 		// Set up slideshow directions containet to appear when slideshow is hovered over and hide them when moused out.
 		
 		$('#slideshow-directions').css('opacity', 0.85);
 		
 		$('#slideshow').hover(function(){
 			var target = $('#slideshow-directions');
 			
 			if (target.is(':animated')) {
 				target.stop().fadeOut('fast');
 			}
 			else {
 				target.fadeIn('fast').fadeTo(4000, 0.85).fadeOut('fast');
 			}
 			
 		}, function(){
 			var target = $('#slideshow-directions');
 			
 			if (target.is(':animated')) {
 				target.stop().fadeOut('fast');
 			}
 			else {
 				target.fadeOut('fast');
 			}
 			
 		});
 		
 		$('#slideshow-directions').mouseover(function(){ // halt animation and hide the directions when moused over
 			$(this).stop().hide();
 		});
 		
 		$('#slideshow').click(function(){
 			var target = $('#slideshow-directions');
 			if (target.is(':visible')) {
 				target.hide();
 			}
 		});
 		
 		$('#consumer').click(function(){ // Slide open feedburner form, and slide closed newsletter form dropdowns
 			$('#consumer-form').show();
 			$('#investor-form').hide();
 		});
 		
 		$('input.enter-email, #cse-search-terms, #contact-form input, .algae-surveys input, textarea').hint(); // Hints for form inputs describing what info to enter
 		
 		$('#feedburner-form, #newsletter-form, #newsletter-form label, .input-field, #rss-info').hide(); // Hide form elements in header
 		
 		// Begin animation for header.php forms (feedburner, newsletter form drop downs, etc.)
 		
 		$('#communication a:not(#contact-us-link)').click(function(){
 			if ($('.sliders').filter(this.hash).is(':hidden')) {
 			$('.sliders').slideUp('fast').filter(this.hash).slideDown('slow');
 			}
 			return false;
 		});
 		$('.close').click(function(){
 			$(this).parent().slideUp('fast');
 		});
 		
 		// End form animations in header.php
 		
 		$('.flickr-item').css('opacity', 1).hover(function(){
 			$(this).stop().fadeTo('slow', 0.7);
 		}, function(){
 			$(this).stop().fadeTo('slow', 1);
 		});
 		
		$('#investor-dialog').dialog({
		     autoOpen: false,
		     resizeable: false,
		     show: 'slide',
		     hide: 'slide',
		     modal: true,
		     buttons: { "Close": function() { $(this).dialog("close"); } }
		}); 
 		
 		$('#view-investor-info').click(function(){
			$('#investor-dialog').dialog('open');
			return false;
 		});
 		
		$('#rss-dialog').dialog({
		     autoOpen: false,
		     resizeable: false,
		     show: 'slide',
		     hide: 'slide',
		     width: 800,
		     modal: true,
		     buttons: { "Close": function() { $(this).dialog("close"); } }
		}); 
 		
 		$('#more-rss-info').click(function(){
			$('#rss-dialog').dialog('open');
			return false;
 		});
 		
 		
 		/* Form input highlighting */
 		$('input:not(:radio, :submit), textarea').focus(function(){
 			$(this).css({'background-color' : '#FFFFFF', 'border' : '1px solid #999999'});
 		});
 		
 		$('input:not(:radio, :submit), textarea').blur(function(){
 			$(this).css({'background-color' : '', 'border' : '1px solid #CCCCCC'});
 		});
 		
 		/*Search form button rollover*/
 		
 		$('#cse-button').hover(function(){
 			$(this).attr('src', 'http://www.algaevs.com/wp-content/themes/avs/images/go_button_hover.png');
 		},
 			function(){
 			$(this).attr('src', 'http://www.algaevs.com/wp-content/themes/avs/images/go_button.png');
 		});

		/*Replace title tag of the "Become a Collaborator" link within the "Our Team" page sidebar */
		
		$('.page-item-575 a').attr("title", "We are seeking technology collaborators.  Please let us know your scope of interest and capacity to contribute to algae's developing technologies");
		
		/* Add shadowbox functionality to "New Jobs Coming Thanks to Algae" Wordpress link as rel attributes cannot be added to links from backend */
		
		$('a[title=An NBC 4i News Video on Algaeventure Systems]').attr('rel', 'shadowbox;width=1000;height=800');
		
 	});
