jQuery( function ($) {
	/* Animated logo */	
	
	var $starCont = $('#logo-bg'),
		$logoStars = $('img', $starCont);
		
	
	var maxX = $logoStars.width() - $starCont.width(),
		maxY = $logoStars.height() - $starCont.height();			
				
	(function () {
		var newX = (Math.random() * maxX) * -1,
			newY = (Math.random() * maxY) * -1;
						
		var goAgain = arguments.callee;

		$logoStars.animate({
			top: newY,
			left: newX
		}, 12000, goAgain);
	})();
	
	
	/* Quicksearch */
		
	var $quickInput = $('input[type="text"]:first', '#quicksearch'),
		$spanLabel = $quickInput.prev();
	
	$spanLabel.click( function () {
		$quickInput.focus()
	});
	
	if ($quickInput.val() !== '') {
		$spanLabel.hide();
	}
	
	$quickInput.bind({
		'focus' : function () {
			$spanLabel.hide();
		},
		'blur' : function () {
			if ($quickInput.val() !== '') {
				$spanLabel.hide();
			} else {
				$spanLabel.show();
			}
		}
	});
	
	
	/* Cool submits */
	
	$('input[type="submit"]').wrap('<span class="subby" />').parent().css('width', function () {
		return $(this).children().outerWidth();
	});
});