$(function() { var parallax_screen_started = "false"; var parallax_screen_target_ratio = 0.5; $("#parallax_screen").attr("data-ratio","0.5"); function parallax_screen_initialize(){ set_parallax_screen_width = $("#parallax_screen").width(); set_parallax_screen_height = set_parallax_screen_width/100*50; if( parallax_screen_started == "false" ){ parallax_screen_initialize_action(); } } function parallax_screen_initialize_action(){ parallax_screen_started = "true"; parallax_screen_window_resize(); } var stage_height = 0; var parallax_progress = 0; $("#parallax_screen #stage img#layer_bg").imagesLoaded(function(){ stage_height = $(this).height(); parallax_screen_window_resize(); }); function parallax_screen_parallax(window_height, scroll_val) { var document_height = $(document).height(); var parallax_scroll_val = scroll_val + window_height; var parallax_progress = Math.floor(scroll_val/(document_height-window_height)*10000000)/10000000; $("#parallax_screen .layer").each(function(){ var height = $(this).height(); if( window_height >= height ){ $(this).css({"height": window_height}); }else{ $(this).css({"margin-top": (window_height - height)*parallax_progress}); } }); $("#debug").text("parallax_progress:"+parallax_progress+" scroll_val:"+scroll_val+" window_height:"+window_height+" document_height:"+document_height); } function parallax_screen_window_resize(e) { var window_height = $("#stage").height(); var window_width = $(window).width(); var scroll_val = $(window).scrollTop(); parallax_screen_parallax(window_height, scroll_val); } $(window).bind("resize", parallax_screen_window_resize); $(window).scroll(function(){ parallax_screen_window_resize(); }); var hammer = Hammer(window).on("dragstart drag dragend swipe", function(event) { parallax_screen_window_resize(); }); parallax_screen_initialize(); var TOPICS_Browser_50_100_started = "false"; var TOPICS_Browser_50_100_target_ratio = 0.5; $("#TOPICS_Browser_50_100").attr("data-ratio","0.5"); function TOPICS_Browser_50_100_initialize(){ set_TOPICS_Browser_50_100_width = $("#TOPICS_Browser_50_100").width(); set_TOPICS_Browser_50_100_height = set_TOPICS_Browser_50_100_width/100*50; TOPICS_Browser_50_100_set_slide_speed = 8000; TOPICS_Browser_50_100_set_fade_speed = 2000; TOPICS_Browser_50_100_start_flag = "false"; TOPICS_Browser_50_100_repeat_flag = "true"; TOPICS_Browser_50_100_repeat_limit = 0; TOPICS_Browser_50_100_repeat_limit_max = 50; TOPICS_Browser_50_100_past_topic_i = 1; TOPICS_Browser_50_100_preload_topic_i = 0; TOPICS_Browser_50_100_create_topic_i = 0; TOPICS_Browser_50_100_past_target = ""; TOPICS_Browser_50_100_past_topicDESCRIPTION = ""; TOPICS_Browser_50_100_past_logo_copy = ""; TOPICS_Browser_50_100_media_max_num = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ].length; TOPICS_Browser_50_100_timer_id = "false"; TOPICS_Browser_50_100_timer_id_B = "false"; if( TOPICS_Browser_50_100_started == "false" ){ TOPICS_Browser_50_100_create_topic(); TOPICS_Browser_50_100_initialize_action(); } } function TOPICS_Browser_50_100_initialize_action(){ TOPICS_Browser_50_100_started = "true"; TOPICS_Browser_50_100_window_resize(); } function TOPICS_Browser_50_100_reset(){ TOPICS_Browser_50_100_past_i = "start"; TOPICS_Browser_50_100_create_img_i = 0; TOPICS_Browser_50_100_preload_i = 0; var imgURL_high = ""; var imgURL_low = ""; var imgTITLE = ""; var topicDESCRIPTION = ""; TOPICS_Browser_50_100_media_max_num = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ].length; TOPICS_Browser_50_100_create_img(); } function TOPICS_Browser_50_100_reset_max(){ TOPICS_Browser_50_100_media_max_num = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ].length; TOPICS_Browser_50_100_past_i = "start"; TOPICS_Browser_50_100_create_img_i = TOPICS_Browser_50_100_media_max_num - 1; TOPICS_Browser_50_100_preload_i = 0; var imgURL_high = ""; var imgTITLE = ""; var topicDESCRIPTION = ""; TOPICS_Browser_50_100_create_img(); } function TOPICS_Browser_50_100_control_show( set_interval ){ if( TOPICS_Browser_50_100_timer_id_B != "false" ){ clearInterval( TOPICS_Browser_50_100_timer_id_B ); } $("#TOPICS_Browser_50_100 .controller:not(:animated)").animate({ opacity: 1 }, 400, function() { TOPICS_Browser_50_100_timer_id_B = setInterval( TOPICS_Browser_50_100_control_hide, set_interval); } ); } function TOPICS_Browser_50_100_control_hide(){ $("#TOPICS_Browser_50_100 .controller:not(:animated)").animate({ opacity: 0 }, 400 ); clearInterval( TOPICS_Browser_50_100_timer_id_B ); } $("#TOPICS_Browser_50_100").mousemove(function(e){ TOPICS_Browser_50_100_control_show( 2000 ); }); function TOPICS_Browser_50_100_create_topic(){ if( TOPICS_Browser_50_100_past_topic_i != TOPICS_Browser_50_100_create_topic_i ){ TOPICS_Browser_50_100_past_topic_i = TOPICS_Browser_50_100_create_topic_i; TOPICS_Browser_50_100_reset(); } } function TOPICS_Browser_50_100_create_topic_max(){ TOPICS_Browser_50_100_past_topic_i = TOPICS_Browser_50_100_create_topic_i; TOPICS_Browser_50_100_reset_max(); } function TOPICS_Browser_50_100_create_img(){ if( TOPICS_Browser_50_100_past_i != TOPICS_Browser_50_100_create_img_i ){ if( TOPICS_Browser_50_100_past_i == "start" ){ TOPICS_Browser_50_100_past_i = 0; } var imgCAPTION = ""; $("#TOPICS_Browser_50_100 .caption span").fadeOut(200, function() { var imgCAPTION = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][2]; $(this).text( imgCAPTION ); } ); var imgURL_high = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][0]; var imgURL_low = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][1]; var imgClass = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][6]; TOPICS_Browser_50_100_past_i = TOPICS_Browser_50_100_create_img_i; var set_img_div = "img_div_" + TOPICS_Browser_50_100_create_topic_i + "_" + TOPICS_Browser_50_100_create_img_i; $("#TOPICS_Browser_50_100 #main").append("
"+ imgCAPTION +"
"); var setLINK = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][7]; $("#TOPICS_Browser_50_100 .controller a").remove(); if( setLINK != "" ){ $("#TOPICS_Browser_50_100 .controller").append(""); } var target = $("#TOPICS_Browser_50_100 div#" + set_img_div); target.find("img.high").load(function () { if( TOPICS_Browser_50_100_past_target != "" ){ TOPICS_Browser_50_100_past_target.fadeOut( 2000, function () { $(this).remove(); } ); }else{ $("#TOPICS_Browser_50_100 div.TOPICS_Browser_bg").stop().animate({ opacity : 1 },500) } TOPICS_Browser_50_100_past_target = target; var topicDESCRIPTION = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][3]; if( topicDESCRIPTION != TOPICS_Browser_50_100_past_topicDESCRIPTION ){ $("div#TOPICS_Browser_50_100 .description").fadeOut( 500, function () { $(this).empty().append(htmlDecode(topicDESCRIPTION).replace(/'/g, "\'")).fadeIn(2000); } ); TOPICS_Browser_50_100_past_topicDESCRIPTION = topicDESCRIPTION; } var logo_copy = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][8]; if( logo_copy != TOPICS_Browser_50_100_past_logo_copy ){ if( logo_copy == "" ){ $("div#logo_copy").fadeOut( 500, function () { $(this).empty().fadeIn(2000); } ); }else{ var img = $(''); img.attr('src', 'http://fes.tobiu.com/2013//elements/' + logo_copy + '.png'); img.imagesLoaded(function(){ $("div#logo_copy").fadeOut( 500, function () { $(this).empty().append(img).fadeIn(2000); } ); }); } TOPICS_Browser_50_100_past_logo_copy = logo_copy; } $("#TOPICS_Browser_50_100 .caption span").fadeIn(200); var imgWIDTH = set_TOPICS_Browser_50_100_width; var imgHEIGHT = parseInt(TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][4])*(set_TOPICS_Browser_50_100_width/parseInt(TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_create_topic_i ][ TOPICS_Browser_50_100_create_img_i ][5])); target.find("img").css("margin-top", -imgHEIGHT+set_TOPICS_Browser_50_100_height); target.find("img").animate({ "margin-top": "0px" }, 10000, "swing"); target.fadeIn( TOPICS_Browser_50_100_set_fade_speed, "swing"); TOPICS_Browser_50_100_window_resize(); TOPICS_Browser_50_100_scrCtr(); TOPICS_Browser_50_100_preload_image(); }); target.find("img.high").attr("src", imgURL_high); } } function TOPICS_Browser_50_100_preload_image(){ $("#TOPICS_Browser_50_100 #main > img").remove(); TOPICS_Browser_50_100_preload_topic_i = eval(TOPICS_Browser_50_100_create_topic_i); TOPICS_Browser_50_100_preload_i = eval(TOPICS_Browser_50_100_create_img_i)+1; if( TOPICS_Browser_50_100_preload_i >= TOPICS_Browser_50_100_media_max_num ){ TOPICS_Browser_50_100_preload_topic_i = eval(TOPICS_Browser_50_100_create_topic_i) +1; TOPICS_Browser_50_100_preload_i = 0; } if( TOPICS_Browser_50_100_preload_topic_i >= TOPICS_Browser_50_100_topics_max_num ){ TOPICS_Browser_50_100_preload_topic_i = 0; } var next_imgURL_high = TOPICS_Browser_50_100_topics_array[ TOPICS_Browser_50_100_preload_topic_i ][ TOPICS_Browser_50_100_preload_i ][0]; $("#TOPICS_Browser_50_100 #main").append(""); var next_target = $("#TOPICS_Browser_50_100 img#pre_" + TOPICS_Browser_50_100_preload_topic_i + "_" + TOPICS_Browser_50_100_preload_i ); next_target.attr("src", next_imgURL_high); } function TOPICS_Browser_50_100_window_resize(e) { $("#TOPICS_Browser_50_100").css("width", "100%"); set_TOPICS_Browser_50_100_width = $("#TOPICS_Browser_50_100").width(); set_TOPICS_Browser_50_100_height = Math.floor(set_TOPICS_Browser_50_100_width/100*50); $("#TOPICS_Browser_50_100").css("height", set_TOPICS_Browser_50_100_height); $("#TOPICS_Browser_50_100 .image_wrapper").css("width", set_TOPICS_Browser_50_100_width); $("#TOPICS_Browser_50_100 .image_wrapper").css("height", set_TOPICS_Browser_50_100_height); $("#TOPICS_Browser_50_100 .controller").css("height", set_TOPICS_Browser_50_100_height); $("#TOPICS_Browser_50_100 .controller").css("width", set_TOPICS_Browser_50_100_width); $("#TOPICS_Browser_50_100 #main").css("width", set_TOPICS_Browser_50_100_width); $("#TOPICS_Browser_50_100 #main").css("height", set_TOPICS_Browser_50_100_height); $("#TOPICS_Browser_50_100 #watermark").css("width", set_TOPICS_Browser_50_100_width); $("#TOPICS_Browser_50_100 #watermark").css("height", set_TOPICS_Browser_50_100_height); $("#TOPICS_Browser_50_100 .description").css("width", set_TOPICS_Browser_50_100_width - 60); $("#TOPICS_Browser_50_100 .description").css("height", set_TOPICS_Browser_50_100_height - 40); $("#TOPICS_Browser_50_100 .arrow_box_photo_left , #TOPICS_Browser_50_100 .arrow_box_photo_right").css("margin-top", (set_TOPICS_Browser_50_100_height-50)/2); } $(window).bind("resize", TOPICS_Browser_50_100_window_resize); $("#TOPICS_Browser_50_100 div.arrow_box_photo_right").click(function(){ TOPICS_Browser_50_100_create_img_i ++; if( TOPICS_Browser_50_100_create_img_i == TOPICS_Browser_50_100_media_max_num){ TOPICS_Browser_50_100_create_img_i = 0; TOPICS_Browser_50_100_create_topic_i ++; if( TOPICS_Browser_50_100_create_topic_i == TOPICS_Browser_50_100_topics_max_num ){ TOPICS_Browser_50_100_create_topic_i = 0; } TOPICS_Browser_50_100_create_topic(); } TOPICS_Browser_50_100_create_img(); }) $("#TOPICS_Browser_50_100 div.arrow_box_photo_left").click(function(){ if( TOPICS_Browser_50_100_create_img_i == 0){ if( TOPICS_Browser_50_100_create_topic_i == 0 ){ TOPICS_Browser_50_100_create_topic_i = TOPICS_Browser_50_100_topics_max_num - 1; }else{ TOPICS_Browser_50_100_create_topic_i --; } TOPICS_Browser_50_100_create_topic_max(); }else{ TOPICS_Browser_50_100_create_img_i --; TOPICS_Browser_50_100_create_img(); } }) $("#TOPICS_Browser_50_100 .arrow_box_photo_right, #TOPICS_Browser_50_100 .arrow_box_photo_left").mouseover(function(){ $(this).stop().animate({ opacity : 1 },200) } ) $("#TOPICS_Browser_50_100 .arrow_box_photo_right, #TOPICS_Browser_50_100 .arrow_box_photo_left").mouseout(function(){ $(this).stop().animate({ opacity : 0.6 },400) } ) $("#TOPICS_Browser_50_100 .arrow_box_photo_right, #TOPICS_Browser_50_100 .arrow_box_photo_left").animate({ opacity : 0.6 },100) function TOPICS_Browser_50_100_scrCtr(){ if( TOPICS_Browser_50_100_start_flag == "false" ){ TOPICS_Browser_50_100_start_flag = "true"; }else{ clearTimeout( TOPICS_Browser_50_100_Repeater ); } if( TOPICS_Browser_50_100_repeat_flag == "true" ){ TOPICS_Browser_50_100_Repeater = setTimeout( function(){ TOPICS_Browser_50_100_slidePlay(); } , TOPICS_Browser_50_100_set_slide_speed); } } function TOPICS_Browser_50_100_slidePlay(){ TOPICS_Browser_50_100_create_img_i ++; if( TOPICS_Browser_50_100_create_img_i == TOPICS_Browser_50_100_media_max_num){ TOPICS_Browser_50_100_create_topic_i ++; TOPICS_Browser_50_100_create_img_i = 0; if( TOPICS_Browser_50_100_create_topic_i == TOPICS_Browser_50_100_topics_max_num ){ TOPICS_Browser_50_100_create_topic_i = 0; if( TOPICS_Browser_50_100_repeat_limit > TOPICS_Browser_50_100_repeat_limit_max ){ TOPICS_Browser_50_100_repeat_flag = "false"; } } TOPICS_Browser_50_100_create_topic(); TOPICS_Browser_50_100_create_img(); }else{ TOPICS_Browser_50_100_create_img(); } } TOPICS_Browser_50_100_topics_array = [[['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_183409_6926.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_183409_6926.jpg', '', '', 500, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0918_175358_5292.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0918_175358_5292.jpg', '', '', 500, 1000, 'vertically', 'http://fes.tobiu.com/2013/schedule/8809', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175224_3627.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175224_3627.jpg', 'Photo: Tadashi Okochi', '', 666, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175232_9621.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175232_9621.jpg', 'Photo: Yoshihito tomii', '', 750, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175419_6034.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175419_6034.jpg', 'Photo: Ryoichi Kawajiri', '', 750, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175414_8625.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175414_8625.jpg', 'Photo: Ryoichi Kawajiri', '', 1000, 1000, 'vertically', '', '' ]],[['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175842_8338.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175842_8338.jpg', 'Photo: Yoshihito tomii', '', 667, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_175854_4170.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_175854_4170.jpg', '', '', 666, 1000, 'vertically', '', '' ],['http://s3.media-nisor.site.s3.amazonaws.com/image/tobiu_fes_entry_2013_0808_180220_5790.jpg', 'http://s3.media-nisor.site.s3.amazonaws.com/image_thumbs/tobiu_fes_entry_2013_0808_180220_5790.jpg', '', '', 753, 1000, 'vertically', 'Photo:+Kineta+Kunimatsu', '' ]]]; TOPICS_Browser_50_100_topics_max_num = 2; TOPICS_Browser_50_100_window_resize(); var scroll_flag = false; $(window).bind("scroll", function() { var window_height = $(window).height(); var scroll_val = $(window).scrollTop() + window_height/3*2; if( scroll_val >= window_height && scroll_flag == false ){ TOPICS_Browser_50_100_initialize(); scroll_flag = true; } }); function htmlEncode(value){ return $('
').text(value).html(); } function htmlDecode(value){ return $('
').html(value).text(); } function create_fullcalendar(){ // Google Calender feed $('#calendar').fullCalendar({ eventSources:[ { url:"http://www.google.com/calendar/feeds/info%40lifesnap.jp/public/basic", className:"event_set_1" }, { url:"http://www.google.com/calendar/feeds/ja.japanese%23holiday%40group.v.calendar.google.com/public/basic", className:"event_set_2" } ], timeFormat: "H:mm", loading: function(bool) { if (bool) { $('#cal_loading').show(); }else{ $('#cal_loading').fadeOut(200); $(".fc-event-time").parent().addClass("single_day"); $(".fc-event-time").parent().parent().addClass("single_day_wrapper"); } } }); $(document).on("click", ".fc-content a", function(){ return false; }); setTimeout(function() { }, 2000); } });