( function( $ ) {
	fashionation.myStoreComponent = ( function() {
		return new function() {
			var self = this;
			var $termInput;

			this.init = function() {
				self.attachInputBehaviour();
				self.tweakResultList();
				fashionation.event.bind( 'wicket.ajax.finished', self.tweakResultList );
			};

			this.attachInputBehaviour = function() {
				fashionation.layout.createInputFocusAndBlurBehaviour( $( '.ExtraMenuItem.MyStore .Input input.Input' ) );
				fashionation.event.bind( 'wicket.ajax.finished', function() {
					fashionation.layout.resetInputFocusAndBlurState( $( '.ExtraMenuItem.MyStore .Input input.Input' ) );
				} );
			};

			this.tweakResultList = function() {
				$( '.ExtraMenuItem.MyStore .Result li:last' ).addClass( 'Last' );
			};

		};
	} )();

	// init this component
	fashionation.event.bind( 'init.components', function() {
		fashionation.myStoreComponent.init();
	} );

} )( jQuery );

( function( $ ) {
	fashionation.headerSearch = ( function() {
		return new function() {
			var self = this;
			var $termInput;

			this.init = function() {
				fashionation.layout.createInputFocusAndBlurBehaviour( $( '.PageContainer .Header .Search .Term' ) );
			}

		}
	} )();

	// init this component
	fashionation.event.bind( 'init.components', function() {
		fashionation.headerSearch.init();
	} );

} )( jQuery );
