var $j = jQuery.noConflict();

/* Common function variables */
var focusDefault = function(srcc)
    {
        if ($j(this).val() == $j(this).attr("title"))
        {
            $j(this).removeClass("defaultTextActive");
            $j(this).val("");
        }
    }
    
var blurDefault = function()
  {
      if ($j(this).val() == "" || $j(this).val() == $j(this).attr("title"))
      {
          $j(this).val($j(this).attr("title"));
          $j(this).addClass("defaultTextActive");
      }
  }


// set up jQuery handlers
$j(document).ready(function() {

	// show default text in text fields with class defaultText using "title" attribute
	$j(".defaultText").focus( focusDefault );    
  $j(".defaultText").blur( blurDefault );
  
  // set up default style on page load, because jQuery live() doesn't support blur & focus
  $j(".defaultText").blur();        

	// clear default values when submitting any form
	$j('form').submit(function() {
		//clearDefaultValues();
		return true;
	}); 
	
		// expand and collapse reduced content
	$j('.more').each(function() {
		if ($j(this).prev().height() < 50) {
			$j(this).hide();
			return;
		} else {
			$j(this).prev().addClass('reduced');
		}
		$j(this).click(function() {
			var x = $j(this);
			var prev = x.prev();
			if (!(prev.hasClass('reduced'))) {
				prev.addClass('reduced');
				prev.animate({height:'4.5em', overflow:'hidden'}, 400);
				x.html('...more');		
			} else {
				prev.removeClass('reduced');
				var height = 20;
				prev.children().each(function() {
					height = height + $j(this).outerHeight(false);
				});
				prev.animate({height:height + 'px'}, 400);
				x.html('...close');
			}
		});
	});

        
	// end document ready function
});

