(function(){$.fn.mobilyselect=function(options){var defaults={collection:"all",animation:"absolute",duration:500,listClass:"selecterContent",btnsClass:"selecterBtns",btnActiveClass:"active",elements:"li",onChange:function(){},onComplete:function(){}};var sets=$.extend({},defaults,options);return this.each(function(){var $t=$(this),list=$t.find("."+sets.listClass),btns=$t.find("."+sets.btnsClass),btn=btns.find("a"),li=list.find(sets.elements),w=li.width(),h=li.height(),l=li.length,finishTime;if(sets.animation=="absolute"){li.css({position:"relative"}).children().css({position:"absolute",top:0,left:0})}var select={init:function(){this.start();this.trigger()},start:function(){if(sets.collection!="all"){li.hide().filter("."+sets.collection).show();btn.removeClass(sets.btnActiveClass).filter(function(){return $(this).attr("rel")==sets.collection}).addClass(sets.btnActiveClass)}},trigger:function(){btn.bind("click",function(){var $t=$(this),rel=$t.attr("rel"),selected=li.filter("."+rel),s=li.filter(function(){return $(this).css("display")=="block"});if(rel=="all"){if(l!=s.length){select.animation(li,li)}}else{select.animation(li,selected)}btn.removeClass(sets.btnActiveClass);$t.addClass(sets.btnActiveClass);sets.onChange.call(this);return false})},animation:function(not,selected){switch(sets.animation){case"plain":$(not).hide();$(selected).show();break;case"fade":$(not).fadeOut(sets.duration);setTimeout(function(){$(selected).fadeIn(sets.duration)},sets.duration+400);break;case"absolute":setTimeout(function(){$(selected).show().children().animate({top:0,left:0},sets.duration)},sets.duration+400);$(not).children().animate({top:-h+"px",left:-w+"px"},sets.duration,function(){$(not).hide()});break}if(sets.animation=="absolute"||sets.animation=="fade"){finishTime=sets.duration*2+400}else{finishTime=100}setTimeout(function(){sets.onComplete.call(this)},finishTime)}};select.init()})}}(jQuery));$(function(){$('.selecter').mobilyselect({collection: 'all',animation: 'fade',duration: 500,listClass: 'selecterContent',btnsClass: 'selecterBtns',btnActiveClass: 'active',elements: 'li',onChange: function(){},onComplete: function(){}});});jQuery(window).load(function() {initMenuAnimation();initEvents();function initMenuAnimation() {var nolist = jQuery('#WorksList li a.tall');nolist.children('.hover').css({left: '0px'});nolist.hover(function () {jQuery(this).children().children('.hover-bgLeft').stop().animate({left: '-290px'} , { queue: false, duration: 1300, easing: 'easeOutBounce' });jQuery(this).children().children('.hover-bgRight').stop().animate({right: '-290px'} , { queue: false, duration: 1300, easing: 'easeOutBounce' });},function () {jQuery(this).children().children('.hover-bgLeft').stop().animate({left: '-6px'} , { queue: false, duration: 900, easing: 'easeOutBounce' });jQuery(this).children().children('.hover-bgRight').stop().animate({right: '-6px'} , { queue: false, duration: 900, easing: 'easeOutBounce' });});};function initEvents() {jQuery("div#WorksList").preloader();jQuery("div.showcase").preloader();jQuery("ul.row").preloader();};});$(document).ready(function(){var items = $('#stage li'),itemsByTags = {};items.each(function(i){var elem = $(this),tags = elem.data('tags').split(',');elem.attr('data-id',i);$.each(tags,function(key,value){value = $.trim(value);if(!(value in itemsByTags)){itemsByTags[value] = [];}itemsByTags[value].push(elem);});});createList('すべて',items);$.each(itemsByTags,function(k,v){createList(k,v);});$('#filter a').live('click',function(e){var link = $(this);link.addClass('active').siblings().removeClass('active');$('#stage').quicksand(link.data('list').find('li'));e.preventDefault();});$('#filter a:first').click();function createList(text,items){var ul = $('<ul>',{'class':'hidden'});$.each(items,function(){$(this).clone().appendTo(ul);});ul.appendTo('#container');var a = $('<a>',{html: text,href:'#',data: {list:ul}}).appendTo('#filter');};});$(function() {

			var $sidescroll	= (function() {
					
					// the row elements
				var $rows			= $('#NewsContainer > div.NewsBlock'),
					// we will cache the inviewport rows and the outside viewport rows
					$rowsViewport, $rowsOutViewport,
					// navigation menu links
					$links			= $('#newsNavi > a'),
					// the window element
					$win			= $(window),
					// we will store the window sizes here
					winSize			= {},
					// used in the scroll setTimeout function
					anim			= false,
					// page scroll speed
					scollPageSpeed	= 2000 ,
					// page scroll easing
					scollPageEasing = 'easeInOutExpo',
					// perspective?
					hasPerspective	= false,
					
					perspective		= hasPerspective && Modernizr.csstransforms3d,
					// initialize function
					init			= function() {
						
						// get window sizes
						getWinSize();
						// initialize events
						initEvents();
						// define the inviewport selector
						defineViewport();
						// gets the elements that match the previous selector
						setViewportRows();
						// if perspective add css
						if( perspective ) {
							$rows.css({
								'-webkit-perspective'			: 600,
								'-webkit-perspective-origin'	: '50% 0%'
							});
						}
						// show the pointers for the inviewport rows
						$rowsViewport.find('a.imageBox').addClass('imageBox-deco');
						$rowsViewport.find('div.imageBox').addClass('imageBox-deco');
						// set positions for each row
						placeRows();
						
					},
					// defines a selector that gathers the row elems that are initially visible.
					// the element is visible if its top is less than the window's height.
					// these elements will not be affected when scrolling the page.
					defineViewport	= function() {
					
						$.extend( $.expr[':'], {
						
							inviewport	: function ( el ) {
								if ( $(el).offset().top < winSize.height ) {
									return true;
								}
								return false;
							}
						
						});
					
					},
					// checks which rows are initially visible 
					setViewportRows	= function() {
						
						$rowsViewport 		= $rows.filter(':inviewport');
						$rowsOutViewport	= $rows.not( $rowsViewport )
						
					},
					// get window sizes
					getWinSize		= function() {
					
						winSize.width	= $win.width();
						winSize.height	= $win.height();
					
					},
					// initialize some events
					initEvents		= function() {
						
						// navigation menu links.
						// scroll to the respective section.
						$links.on( 'click.Scrolling', function( event ) {
							
							// scroll to the element that has id = menu's href
							$('html, body').stop().animate({
								scrollTop: $( $(this).attr('href') ).offset().top
							}, scollPageSpeed, scollPageEasing );
							
							return false;
						
						});
						
						$(window).on({
							// on window resize we need to redefine which rows are initially visible (this ones we will not animate).
							'resize.Scrolling' : function( event ) {
								
								// get the window sizes again
								getWinSize();
								// redefine which rows are initially visible (:inviewport)
								setViewportRows();
								// remove pointers for every row
								$rows.find('a.imageBox').removeClass('imageBox-deco');
								// show inviewport rows and respective pointers
								$rowsViewport.each( function() {
								
									$(this).find('div.LeftNews')
										   .css({ left   : '0%' })
										   .end()
										   .find('div.RightNews')
										   .css({ right  : '0%' })
										   .end()
										   .find('a.imageBox')
										   .addClass('imageBox-deco');
								
								});
							
							},
							// when scrolling the page change the position of each row	
							'scroll.Scrolling' : function( event ) {
								
								// set a timeout to avoid that the 
								// placeRows function gets called on every scroll trigger
								if( anim ) return false;
								anim = true;
								setTimeout( function() {
									
									placeRows();
									anim = false;
									
								}, 10 );
							
							}
						});
					
					},
					// sets the position of the rows (left and right row elements).
					// Both of these elements will start with -50% for the left/right (not visible)
					// and this value should be 0% (final position) when the element is on the
					// center of the window.
					placeRows		= function() {
						
							// how much we scrolled so far
						var winscroll	= $win.scrollTop(),
							// the y value for the center of the screen
							winCenter	= winSize.height / 2 + winscroll;
						
						// for every row that is not inviewport
						$rowsOutViewport.each( function(i) {
							
							var $row	= $(this),
								// the left side element
								$rowL	= $row.find('div.LeftNews'),
								// the right side element
								$rowR	= $row.find('div.RightNews'),
								// top value
								rowT	= $row.offset().top;
							
							// hide the row if it is under the viewport
							if( rowT > winSize.height + winscroll ) {
								
								if( perspective ) {
								
									$rowL.css({
										'-webkit-transform'	: 'translate3d(-75%, 0, 0) rotateY(-90deg) translate3d(-75%, 0, 0)',
										'opacity'			: 0
									});
									$rowR.css({
										'-webkit-transform'	: 'translate3d(75%, 0, 0) rotateY(90deg) translate3d(75%, 0, 0)',
										'opacity'			: 0
									});
								
								}
								else {
								
									$rowL.css({ left 		: '-50%' });
									$rowR.css({ right 		: '-50%' });
								
								}
								
							}
							// if not, the row should become visible (0% of left/right) as it gets closer to the center of the screen.
							else {
									
									// row's height
								var rowH	= $row.height(),
									// the value on each scrolling step will be proporcional to the distance from the center of the screen to its height
									factor 	= ( ( ( rowT + rowH / 2 ) - winCenter ) / ( winSize.height / 2 + rowH / 2 ) ),
									// value for the left / right of each side of the row.
									// 0% is the limit
									val		= Math.max( factor * 50, 0 );
									
								if( val <= 0 ) {
								
									// when 0% is reached show the pointer for that row
									if( !$row.data('pointer') ) {
									
										$row.data( 'pointer', true );
										$row.find('.imageBox').addClass('imageBox-deco');
									
									}
								
								}
								else {
									
									// the pointer should not be shown
									if( $row.data('pointer') ) {
										
										$row.data( 'pointer', false );
										$row.find('.imageBox').removeClass('imageBox-deco');
									
									}
									
								}
								
								// set calculated values
								if( perspective ) {
									
									var	t		= Math.max( factor * 75, 0 ),
										r		= Math.max( factor * 90, 0 ),
										o		= Math.min( Math.abs( factor - 1 ), 1 );
									
									$rowL.css({
										'-webkit-transform'	: 'translate3d(-' + t + '%, 0, 0) rotateY(-' + r + 'deg) translate3d(-' + t + '%, 0, 0)',
										'opacity'			: o
									});
									$rowR.css({
										'-webkit-transform'	: 'translate3d(' + t + '%, 0, 0) rotateY(' + r + 'deg) translate3d(' + t + '%, 0, 0)',
										'opacity'			: o
									});
								
								}
								else {
									
									$rowL.css({ left 	: - val + '%' });
									$rowR.css({ right 	: - val + '%' });
									
								}
								
							}	
						
						});
					
					};
				
				return { init : init };
			
			})();
			
			$sidescroll.init();
			
		});
jQuery(function() {
  $('#slideDown').slideDownMenu({
    noticeBlock: '#newsNavi'
  });});

jQuery(function(ready){
	$('div.memberContents').css('display' , 'none');
	
  $('a#OD').click(function() {
	  $('div.memberContents').fadeOut(100);
  $('div#oyadomari').fadeIn(1500, function() {});
 	var src = "http://funcascampers.com/img/profile/yoshiaki0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
  
  });
$('a#KK').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#kako').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/lion0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
$('a#OH').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#miki').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/miki0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#OC').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#chica').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/chica0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#TK').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#kazuhiro').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/pon0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
	});
	});
	$('a#SZ').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#suzuki').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/daiki0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#HG').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#higuchi').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/toshi0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#MR').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#kaori').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/kaori0107.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#ST').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#staff').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/member.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	$('a#SA').click(function() {
	$('div.memberContents').fadeOut(100);
  $('div#saneatsuProfile').fadeIn(1500, function() {
  });
  var src = "http://funcascampers.com/img/profile/saneatsu.jpg";
		$("#AMs").fadeOut("slow",function() {
			$(this).attr("src",src);
			$(this).fadeIn();
		});
	});
	
});
$(document).ready(function(){
			$("a[rel='yoshiaki']").colorbox({height:"80%"});
			$("a[rel='lion']").colorbox({height:"80%"});
			$("a[rel='miki']").colorbox({height:"80%"});
			$("a[rel='chica']").colorbox({height:"80%"});
			$("a[rel='daiki']").colorbox({height:"80%"});
			$("a[rel='toshi']").colorbox({height:"80%"});
			$("a[rel='pon']").colorbox({height:"80%"});
			$("a[rel='kaori']").colorbox({height:"80%"});
			$("a[rel='saneatsu']").colorbox({height:"80%"});
		});
  
jQuery.fn.extend({everyTime: function(interval, label, fn, times, belay) {return this.each(function() {jQuery.timer.add(this, interval, label, fn, times, belay);});},oneTime: function(interval, label, fn) {return this.each(function() {jQuery.timer.add(this, interval, label, fn, 1);});},stopTime: function(label, fn) {return this.each(function() {jQuery.timer.remove(this, label, fn);});}});jQuery.extend({timer: {guid: 1,global: {},regex: /^([0-9]+)\s*(.*s)?$/,powers: {'ms': 1,'cs': 10,'ds': 100,'s': 1000,'das': 10000,'hs': 100000,'ks': 1000000},timeParse: function(value) {if (value == undefined || value == null)return null;var result = this.regex.exec(jQuery.trim(value.toString()));if (result[2]) {var num = parseInt(result[1], 10);var mult = this.powers[result[2]] || 1;return num * mult;} else {return value;}},add: function(element, interval, label, fn, times, belay) {var counter = 0;if (jQuery.isFunction(label)) {if (!times) times = fn;fn = label;label = interval;}interval = jQuery.timer.timeParse(interval);if (typeof interval != 'number' || isNaN(interval) || interval <= 0)return;if (times && times.constructor != Number) {belay = !!times;times = 0;}times = times || 0;belay = belay || false;if (!element.$timers) element.$timers = {};if (!element.$timers[label])element.$timers[label] = {};fn.$timerID = fn.$timerID || this.guid++;var handler = function() {if (belay && this.inProgress) return;this.inProgress = true;if ((++counter > times && times !== 0) || fn.call(element, counter) === false)jQuery.timer.remove(element, label, fn);this.inProgress = false;};handler.$timerID = fn.$timerID;if (!element.$timers[label][fn.$timerID]) element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);if ( !this.global[label] )this.global[label] = [];this.global[label].push( element );},remove: function(element, label, fn) {var timers = element.$timers, ret;if ( timers ) {if (!label) {for ( label in timers )this.remove(element, label, fn);} else if ( timers[label] ) {if ( fn ) {if ( fn.$timerID ) {window.clearInterval(timers[label][fn.$timerID]);delete timers[label][fn.$timerID];}} else {for ( var fn in timers[label] ) {window.clearInterval(timers[label][fn]);delete timers[label][fn];}}for ( ret in timers[label] ) break;if ( !ret ) {ret = null;delete timers[label];}}for ( ret in timers ) break;if ( !ret ) element.$timers = null;}}}});if (jQuery.browser.msie)jQuery(window).one("unload", function() {var global = jQuery.timer.global;for ( var label in global ) {var els = global[label], i = els.length;while ( --i )jQuery.timer.remove(els[i], label);}});

