/* used in fields when the label is initially in the field itself (e.g., "Search...") */
jQuery.fn.peekABooField = function() {	
	$(this).each(
		function() {			
			var field = $(this);
			var field_val = field.val();
			field.focus(function() {
				if(this.value == field_val) {
					this.value = "";
				}
			}).blur(function() {
				if(this.value == "") {
					this.value = field_val;
				}
			});
		}
	);
};

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

jQuery.fn.slideDownBetter = function(speed, easing, callback) {     
    this.stop(1,1);
    if(!this.data('height')) {
        this.css("display", "inline");
        this.data('height', this.height()); 
    }
    this.height(0); 
    this.show();    
    return this.animate({height: this.data('height')}, speed, easing, callback); 
};

jQuery.fn.slideUpBetter = function(speed, easing, callback) {    
    this.stop(1,1);
    return this.animate({height: "hide"}, speed, easing, callback); 
};

function trace(m) {
    if(window.console) {
        console.log(m);
    }
}
