$(document).ready(function(){
	/* clear and restore search fields */
	 $('#search input#search_term').val('Search');
	 $('input#newsletter_submit').wrap('<p id="nls_wrap"></p>');
	 $('#search_term').removeClass('clearClick').addClass('clickClear');
	 $('#newsletter_text,#mcms_newsletter_first_name,#mcms_newsletter_last_name').removeClass('clearClick').addClass('clickClear');
	 $('input.clickClear').focus(function() {
	    startText = $(this).val();
	    $(this).val('').addClass('focus');
	 });
	 $('input.clickClear').blur(function() {
	    blurText = $(this).val();
	    if (blurText == '') {
	       $(this).val(startText).removeClass('focus');
	    };
	 });   

	// color box launch
	$('#login .thickbox, #comments .thickbox').colorbox({iframe:true,width:400, height:250});
	$('#footer .thickbox').colorbox();
	$('#content .slideshow').colorbox({
		slideshow:true,
		photo:true,
		preloading:true,
		slideshowSpeed:5000,
		slideshowAuto:false
		});
	$('.rsvp .thickbox').colorbox({iframe:true,width:450, height:570});
	$('#options .thickbox,.section .thickbox').colorbox({iframe:true,width:500, height:570});  
	//@end      
    

	$("#nav > li:last").addClass("last");
	$("#minguide-cols").hide(); 
	$("#minguide a.btn").click(function(){
		     
			$("#minguide-cols").removeClass("hide").slideToggle("fast");
			$(this).toggleClass("off"); 
	});
	
	if($("body").attr("id") === "sub"){
		if($("#sidebar").outerHeight() > $("#content").outerHeight()){
			var height = $("#sidebar").outerHeight() + 150; 
			var cwh = $("#content-wrap").outerHeight(); 
			//window.console.log(height + " | " + cwh);
			
			var hdiff = parseFloat(height) - parseFloat(cwh);
			var newh = cwh + hdiff;  
		 //   window.console.log(newh);
		   $("#content-wrap").css({"height":newh + "px"}); 
		}
	}

}); //@end doc ready
