$(function() {
	
	// prevent all blank links from doing anything
	$('a[href=#]').click(function() {
		return false;
	});
	
	// search behavior
	$('input#query').val('Search');
	$('input#query').focus(function (){
		if ( $(this).val() == 'Search' || $(this).val() == '' ) {
			$(this).val('');
		}
	});
	$('input#query').blur(function (){
		if ( $(this).val() == '' ) {
			$(this).val('Search');
		}
	});
	$('form#search').submit(function () {
		if ( $('input#query').val() == 'Search' || $('input#query').val() == '' ) {
			return false;
		}
	});
	
	// newsletter signup input focus/blur behavior
	$('input#signup-email').val('Sign up to receive our newsletter');
	$('input#signup-email').focus(function (){
		if ( $(this).val() == 'Sign up to receive our newsletter' || $(this).val() == '' ) {
			$(this).val('');
		}
	});
	$('input#signup-email').blur(function (){
		if ( $(this).val() == '' ) {
			$(this).val('Sign up to receive our newsletter');
		}
	});
	
	// homepage carousel jquery plugin
	if ( $("div#slideshow").carousel ) {
		$("div#slideshow").carousel( { dispItems: 3 } );
	}

	// superfish
	if ( $('ul#menu-primary-navigation').superfish ) {
		$('ul#menu-primary-navigation').superfish( { autoArrows: false, speed: 'fast' } );	
	}
		
	// initialize prettyPhoto jquery plugin on links with rel="prettyPhoto" and rel="attachment"
	if ( $("a[rel^='prettyPhoto']").prettyPhoto ) {
		$("a[rel^='prettyPhoto']").prettyPhoto( { show_title: false, opacity: 0.7 } );
	}
	/* if ( $('a.prettyPhoto').prettyPhoto ) {
		$('a.prettyPhoto').prettyPhoto( { show_title: false, opacity: 0.7 } );
	} */
	
});
