/**
 * Simple Plugin for toggling input fields
 *
 * Usage:
 *		$('input.searchTerm').toggleValue();
 *
 * Example Usage with custom class:
 *		$('input.searchTerm').toggleValue({toggleClass: 'selected'});
 *	
 * @author Marcel Eichner // Ephigenia <love@ephigenia.de>
 * @since 2009-06-22
 */
(function($){
	
	$.fn.extend({
		toggleValue: function (options) {
			defaults = {
				value: $(this).val(),
				toggleClass: 'active'
			};
			var options = $.extend({}, defaults, options);
			return $(this).live('focus.toggleValue', function() {
				if ($(this).val() == options.value) $(this).val('').toggleClass(options.toggleClass);
			}).blur(function () {
				if ($.trim($(this).val()) == '') $(this).val(options.value).toggleClass(options.toggleClass);
			});
		}
	});

})(jQuery);

/**
 * @project Horrorblog.org
 * @author Marcel Eichner // Ephigenia <love@ephigenia.de>
 * @since 2010-04-11
 */
$(document).ready(function() {
	$('input.q').toggleValue();
	// set all external links to open in new window
	$('a[rel=external]').attr('target', '_blank');
});

