(function($){
			var $body = $(document.body),
				$menu = $('#menu'),
				$content = $('#tab'),
				$current = $('#current');
			

			$.Ajaxy.configure({

				'method': 'get',

				'Controllers': {

					'_generic': {

						request: function(){
							// Prepare
							var Ajaxy = $.Ajaxy;
							// Log what is happening
							if ( Ajaxy.options.debug ) window.console.debug('$.Ajaxy.Controllers._generic.request', [this,arguments]);
							// Loading
							$body.addClass('loading');
							$('#loading').show();
							// Done
							return true;
						},
						
						response: function(){
							// Prepare
							var Ajaxy = $.Ajaxy; var data = this.State.Response.data; var state = this.state||'unknown';
							// Log what is happening
							if ( Ajaxy.options.debug ) window.console.debug('$.Ajaxy.Controllers._generic.response', [this,arguments], data, state);
							// Title
							var title = data.title||false; // if we have a title in the response JSON
							if ( !title && this.state||false ) title = 'Bar London Sochi - '+this.state; // if not use the state as the title
							if ( title ) document.title = title; // if we have a new title use it
							// Loaded
							$body.removeClass('loading');
							$('#loading').fadeOut(2600);
							// Display State
							$('#current').text('Our current state is: ['+state+']');
							// Return true
							return true;
						},

						error: function(){
							// Prepare
							var Ajaxy = $.Ajaxy; var data = this.State.Error.data||this.State.Response.data; var state = this.state||'unknown';
							// Error
							var error = data.error||data.responseText||'Unknown Error.';
							var error_message = data.content||error;
							// Log what is happening
							window.console.error('$.Ajaxy.Controllers._generic.error', [this, arguments], error_message);
							// Loaded
							$body.removeClass('loading');
							$('#loading').fadeOut(2600);
							// Display State
							$('#current').text('Our current state is: ['+state+']');
							// Done
							return true;
						}
					},

					'page': {

						classname: 'ajaxy-page',
						
						matches: /^\/?/,
						
						request: function(){
							// Prepare
							var Ajaxy = $.Ajaxy;
							// Log what is happening
							if ( Ajaxy.options.debug ) window.console.debug('$.Ajaxy.Controllers.page.request', [this,arguments]);
							// Adjust Menu
							$menu.find('.active').removeClass('active');
							// Hide Content
							$content.stop(true,true).fadeOut(400);
							// Return true
							return true;
						},

						response: function(){
							// Prepare
 var Ajaxy = $.Ajaxy;
 var data = this.State.Response.data;
 var state = this.state;
 var State = this.State;
							// Log what is happening
 if ( Ajaxy.options.debug ) window.console.debug('$.Ajaxy.Controllers.page.response', [this,arguments], data, state);
							// Adjust Menu
 $menu.children(':has(a[href*="'+State.raw.state+'"])').addClass('active').siblings('.active').removeClass('active');
							// Show Content
 var Action = this;
 $content.html(data.content).fadeIn(1400,function(){
	 $('.scroll-pane').jScrollPane({verticalDragMinHeight: 30,verticalDragMaxHeight: 30,verticalGutter: 60});
         Action.documentReady($content);
         $("a[rel='example1']").colorbox({current: "",previous: "",next: ""});
         if(state=='/gallery/2.html'){
            $('.slider').advancedSlider({
             width:500, 
             height:300, 
             skin: 'light-round-extended', 
             scrollbarSkin: 'scrollbar-3-light', 
             navigationButtons: false, 
             fadeTimer: true, 
             thumbnailsType: 'navigation', 
             thumbnailSync: true, 
             visibleThumbnails: 4, 
             fadeThumbnailArrows: true, 
             thumbnailButtons: true, 
             fadeThumbnailButtons: true, 
             thumbnailScrollbar: false, 
             thumbnailMouseWheel: true, 
             effectType:'fade', 
             horizontalSlices:1, 
             verticalSlices:1, 
             sliceDuration:1, 
             slideshowDelay: 10000, 
             slidesPreloaded:4
             });
            }
         if(state=='/gallery/1.html'){
              $.getScript("js/jquery.skitter.js", function(){
		$('.box_skitter_large').skitter();
               });
            }
	 });
							// Return true
							return true;
						}
					}
				}
			});
			
							$('#loading').fadeOut(2600);
			// All done
		})(jQuery);
		// Back to global scope

