$(document).ready(function() {
	$('.search .field input').clearDefault();
	
	/* FILTERS
	if($('.filters').length){
		$('.filters .filter:first').show();
		$('.filters .tabs li:first').addClass('active');
		
		$('.filters .tabs li').click(function(){
			if(!$(this).hasClass('active')){
				var class = '.'+$(this).find('span').text().toLowerCase();
				class = class.replace(" ","-")
				$('.filters .tabs li').removeClass('active');
				$(this).addClass('active');
				$('.filters .filter').hide();
				$('.filters .filter'+class).show();
			}
		});
	}*/
	
	if($('#commentform .field input').length){
		$('#commentform .field input').clearDefault();
	}
	
	if($('#commentform textarea').length) {
		$('#commentform textarea').clearDefault();
	}
});

$.fn.clearDefault = function () {
    return this.each(function () {
        var default_value = $(this).val();
        $(this).focus(function () {
            if ($(this).val() == default_value) $(this).val("");
        });
        $(this).blur(function () {
            if ($(this).val() == "") $(this).val(default_value);
        });
    });
};

