$(function() {
	//Submission form
	var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	if(IE6) {
		$("body.programs #content-sub li.featured-main form").show();
	} else {
		$("body.programs #content-sub li.featured-main form").hide();
		$("body.programs #content-sub li.featured-main h2").after('<p>USC has hundreds of community programs. If we have missed one, or if you know of a new one that should be listed on this site, please <a href="#" class="expandform">let us know about it now</a>. </p>');
	}

	$("a.expandform").click(function(){
		$("body.programs #content-sub li.featured-main form").slideToggle();	
		return false;
	});
	
	$("ul#sortby li a").click(function(){
	return false
	})
	
	$(".feedback").hide();
	$(".success, .error").fadeIn(3000);
	
	// validate signup form on keyup and submit
	$("#suggest").validate();

        // page photo caption
        $(".imagetopcaption").hide().each(function() { 
		$(this).before('<a class="captionexpander" href="#">About this photo</a>');
		$('.captionexpander').click(function() { $('.imagetopcaption').slideToggle(); 
			var exp = this.className.indexOf('open');
			if(exp == -1) {
				$(this).addClass('open');
			} else {
				$(this).removeClass('open');
			}
			return false;
		});
	});


	/* Clears out the search box on click if the value is "Search" I
	did this for people who might misspell words so when they click back
	in the box they don't lose their search term */
	$("#search input").focus( function() {
		if ($(this).val()=="Search") {$(this).val("");}
	});

    $("#search input").blur( function() {
    	if ($(this).val()=="") {$(this).val("Search");}
    });

	//dropshadows
	//$("#content-main, #thumbnav a, li.featured-sub, li.featured-main").dropShadow({left: 0, top: 1, opacity: 0.2, blur: 2});
	
});

