(function($) {
	$( 'ul#nav li' ).hover( function() {    	
        $( 'ul:first', this ).css( 'display', 'block' );    
    }, function() {    
        $( 'ul:first', this ).css( 'display', 'none' );    
    } );
	
	$( '#s' ).focus( function() {
		var $this = $(this);
	
		if( $this.val() == 'Search...' )
			$this.val( '' );
	} );

	$( '#s' ).blur( function() {
		var $this = $(this);
	
		if( $this.val() == '' )
			$this.val( 'Search...' );
	} );

	$( '#submit' ).click( function( event ) { 
		var $this = $(this);
		$this.parent().parent() // the form to submit
		     .submit();
	
		event.preventDefault();
	} );
	
	function setBorderRadius( selector, amount )
	{
		$( selector ).css( {
			"border-radius" : amount + "px",
			"-moz-border-radius" : amount + "px",
			"-webkit-border-radius" : amount + "px",
			"-khtml-border-radius" : amount + "px"
		} );
	}
	
	setBorderRadius( '#searchform #s, ol.commentlist li, #commentform #submit', 5 );
	setBorderRadius( '.entry img, .navigation a, .comment-navigation a, .navigation a:hover, .comment-navigation a:hover, .wp-caption', 3 );
	setBorderRadius( 'ol.commentlist li div.reply a', 2 );
	setBorderRadius( '.navigation a img', 0 );
})(jQuery);
