$(document).ready(function() {
	var unactiveColor = '#8a8b8a';
	$("#search_main_field").css('color', unactiveColor);
	$("#search_main_field").search(unactiveColor); 
});

jQuery.fn.fadeToggle = function(speed, easing, callback)
{
	return this.animate({opacity: 'toggle'}, speed, easing, callback);
}

function divDisplay(id, save)
{
	$("#" + id).fadeToggle('slow');
	return false;
}

jQuery.fn.search = function(unactiveColor) 
{
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			$(this).css('color', '#3f3f3f');
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			
			if (unactiveColor != 'undefined')
			{
				$(this).css('color', unactiveColor);
			}
			
			this.value = this.defaultValue;
		}
	});
};

function highlightTableRow(id, noHighlightClass)
{   
	if (noHighlightClass == "undefined") {
		noHighlightClass = '';
	}
	
	$("#"+id+" tr").hover(
		 function() {  // mouseover
			 if (noHighlightClass == '' || !$(this).is('.' + noHighlightClass)) {
				 $(this).addClass('highlight');
			 }
		 },
		 function() {  // mouseout
			  if (noHighlightClass == '' || !$(this).is('.' + noHighlightClass)) {
				  $(this).addClass('highlight');
			 }
			 $(this).removeClass('highlight');
		 }
	 );
}

