// JavaScript Document

//jquery.spritely-0.6.js

        (function($) {
            $(document).ready(function() {
                $('#logo').click(function() {
                    document.location.href = '#';
                });
            
                $('#douzou')
                    .sprite({
                        fps: 1, 
                        no_of_frames: 3,
                        // the following are optional: new in version 0.6...
                        start_at_frame: 2,
                        on_first_frame: function(obj) {
                            if (window.console) {
                                console.log('first frame');
                            }
                        },
                        on_last_frame: function(obj) {
                            // you could stop the sprite here with, e.g.
                            // obj.spStop();
                            if (window.console) {
                                console.log('last frame');
                            }
                        },
                        on_frame: {
                            2: function(obj) {
                                // you could change the 'state' of the
                                // sprite here with, e.g. obj.spState(2);
                                if (window.console) {
                                    console.log('frame 2');
                                }
                            }
                        }
                    })
                    //.spRandom({top: 38, bottom: 0, left: 520, right: 0})
					//銅像の動きを制止
                    .isDraggable()
                    .activeOnClick()
                    .active();
                $('#clouds').pan({fps: 30, speed: 0.2, dir: 'left', depth: 10});
                $('#hill1').pan({fps: 30, speed: 0.3, dir: 'left', depth: 10});
                $('#hill2').pan({fps: 30, speed: 0.1, dir: 'left', depth: 5});
                                $('#balloons').pan({fps: 30, speed: 0.6, dir: 'up', depth: 70});
                $('#hill1, #hill2, #clouds').spRelSpeed(8);
                
                window.actions = {
                    fly_slowly_forwards: function() {
                        $('#bird')
                            .fps(10)
                            .spState(1);
                        $('#hill1, #hill2, #clouds')
                            .spRelSpeed(10)
                            .spChangeDir('left');
                    },
                    fly_slowly_backwards: function() {
                        $('#bird')
                            .fps(10)
                            .spState(2);
                        $('#hill1, #hill2, #clouds')
                            .spRelSpeed(10)
                            .spChangeDir('right');
                    },
                    fly_quickly_forwards: function() {
                        $('#bird')
                            .fps(20)
                            .spState(1);
                        $('#hill1, #hill2, #clouds')
                            .spRelSpeed(30)
                            .spChangeDir('left');
                    },
                    fly_quickly_backwards: function() {
                        $('#bird')
                            .fps(20)
                            .spState(2);
                        $('#hill1, #shill2, #clouds')
                            .spRelSpeed(30)
                            .spChangeDir('right');
                    },
                    fly_like_lightning_forwards: function() {
                        $('#bird')
                            .fps(25)
                            .spState(1);
                        $('#hill1, #hill2, #clouds')
                            .spSpeed(40)
                            .spChangeDir('left');
                    },
                    fly_like_lightning_backwards: function() {
                        $('#bird')
                            .fps(25)
                            .spState(2);
                        $('#hill1, #hill2, #clouds')
                            .spSpeed(40)
                            .spChangeDir('right');
                    }
                };
                
                window.page = {
                    hide_panels: function() {
                        $('.panel').hide(300);
                    },
                    show_panel: function(el_id) {
                        this.hide_panels();
                        $(el_id).show(300);
                    }
                }
                
            });
        })(jQuery);
		
		
        //jquery.flexslider-min.js
		
			$(window).load(function() {
			$('.flexslider').flexslider({
			animation: "fade",
			slideshow: false, 
		 });
		});
		
		//jquery.flexslider-min.js
		
			$(window).load(function() {
			$('.flexslider_dajyare').flexslider({
			animation: "slide",
			slideshow: true, 
			slideshowSpeed: 4000, //スライドショーの時間
            animationDuration: 500, //アニメーション時間
            directionNav: false, //ナビボタン
		 });
		});
		
		//jquery-contained-sticky-scroll.js
		
			jQuery(document).ready(function(){
		jQuery('#sidebar').containedStickyScroll();
	});
	
	
	   //jquery.jscrollpane.min.js
	
	$(function(){
     $("#sb_logo a,#to_area2 a,#to_area3 a,#to_area4 a,#to_area5 a,#to_area6 a,#daruma a,.clear_hr a").click(function(){
     $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing');
     return false;
     })
});
