// ColorBox v1.3.20 - jQuery lightbox plugin
// (c) 2012 Jack Moore - jacklmoore.com
// License: http://www.opensource.org/licenses/mit-license.php
(function(e,t,n){function G(n,r,i){var o=t.createElement(n);return r&&(o.id=s+r),i&&(o.style.cssText=i),e(o)}function Y(e){var t=T.length,n=(U+e)%t;return n<0?t+n:n}function Z(e,t){return Math.round((/%/.test(e)?(t==="x"?N.width():N.height())/100:1)*parseInt(e,10))}function et(e){return B.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(e)}function tt(){var t,n=e.data(R,i);n==null?(B=e.extend({},r),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},n);for(t in B)e.isFunction(B[t])&&t.slice(0,2)!=="on"&&(B[t]=B[t].call(R));B.rel=B.rel||R.rel||"nofollow",B.href=B.href||e(R).attr("href"),B.title=B.title||R.title,typeof B.href=="string"&&(B.href=e.trim(B.href))}function nt(t,n){e.event.trigger(t),n&&n.call(R)}function rt(){var e,t=s+"Slideshow_",n="click."+s,r,i,o;B.slideshow&&T[1]?(r=function(){M.text(B.slideshowStop).unbind(n).bind(f,function(){if(B.loop||T[U+1])e=setTimeout(J.next,B.slideshowSpeed)}).bind(a,function(){clearTimeout(e)}).one(n+" "+l,i),g.removeClass(t+"off").addClass(t+"on"),e=setTimeout(J.next,B.slideshowSpeed)},i=function(){clearTimeout(e),M.text(B.slideshowStart).unbind([f,a,l,n].join(" ")).one(n,function(){J.next(),r()}),g.removeClass(t+"on").addClass(t+"off")},B.slideshowAuto?r():i()):g.removeClass(t+"off "+t+"on")}function it(t){V||(R=t,tt(),T=e(R),U=0,B.rel!=="nofollow"&&(T=e("."+o).filter(function(){var t=e.data(this,i),n;return t&&(n=t.rel||this.rel),n===B.rel}),U=T.index(R),U===-1&&(T=T.add(R),U=T.length-1)),W||(W=X=!0,g.show(),B.returnFocus&&e(R).blur().one(c,function(){e(this).focus()}),m.css({opacity:+B.opacity,cursor:B.overlayClose?"pointer":"auto"}).show(),B.w=Z(B.initialWidth,"x"),B.h=Z(B.initialHeight,"y"),J.position(),d&&N.bind("resize."+v+" scroll."+v,function(){m.css({width:N.width(),height:N.height(),top:N.scrollTop(),left:N.scrollLeft()})}).trigger("resize."+v),nt(u,B.onOpen),H.add(A).hide(),P.html(B.close).show()),J.load(!0))}function st(){!g&&t.body&&(Q=!1,N=e(n),g=G(K).attr({id:i,"class":p?s+(d?"IE6":"IE"):""}).hide(),m=G(K,"Overlay",d?"position:absolute":"").hide(),y=G(K,"Wrapper"),b=G(K,"Content").append(C=G(K,"LoadedContent","width:0; height:0; overflow:hidden"),L=G(K,"LoadingOverlay").add(G(K,"LoadingGraphic")),A=G(K,"Title"),O=G(K,"Current"),_=G(K,"Next"),D=G(K,"Previous"),M=G(K,"Slideshow").bind(u,rt),P=G(K,"Close")),y.append(G(K).append(G(K,"TopLeft"),w=G(K,"TopCenter"),G(K,"TopRight")),G(K,!1,"clear:left").append(E=G(K,"MiddleLeft"),b,S=G(K,"MiddleRight")),G(K,!1,"clear:left").append(G(K,"BottomLeft"),x=G(K,"BottomCenter"),G(K,"BottomRight"))).find("div div").css({"float":"left"}),k=G(K,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),H=_.add(D).add(O).add(M),e(t.body).append(m,g.append(y,k)))}function ot(){return g?(Q||(Q=!0,j=w.height()+x.height()+b.outerHeight(!0)-b.height(),F=E.width()+S.width()+b.outerWidth(!0)-b.width(),I=C.outerHeight(!0),q=C.outerWidth(!0),g.css({"padding-bottom":j,"padding-right":F}),_.click(function(){J.next()}),D.click(function(){J.prev()}),P.click(function(){J.close()}),m.click(function(){B.overlayClose&&J.close()}),e(t).bind("keydown."+s,function(e){var t=e.keyCode;W&&B.escKey&&t===27&&(e.preventDefault(),J.close()),W&&B.arrowKey&&T[1]&&(t===37?(e.preventDefault(),D.click()):t===39&&(e.preventDefault(),_.click()))}),e("."+o,t).live("click",function(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),it(this))})),!0):!1}var r={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},i="colorbox",s="cbox",o=s+"Element",u=s+"_open",a=s+"_load",f=s+"_complete",l=s+"_cleanup",c=s+"_closed",h=s+"_purge",p=!e.support.opacity&&!e.support.style,d=p&&!n.XMLHttpRequest,v=s+"_IE6",m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K="div",Q;if(e.colorbox)return;e(st),J=e.fn[i]=e[i]=function(t,n){var s=this;t=t||{},st();if(ot()){if(!s[0]){if(s.selector)return s;s=e(""),t.open=!0}n&&(t.onComplete=n),s.each(function(){e.data(this,i,e.extend({},e.data(this,i)||r,t))}).addClass(o),(e.isFunction(t.open)&&t.open.call(s)||t.open)&&it(s[0])}return s},J.position=function(e,t){function f(e){w[0].style.width=x[0].style.width=b[0].style.width=e.style.width,b[0].style.height=E[0].style.height=S[0].style.height=e.style.height}var n,r=0,i=0,o=g.offset(),u,a;N.unbind("resize."+s),g.css({top:-9e4,left:-9e4}),u=N.scrollTop(),a=N.scrollLeft(),B.fixed&&!d?(o.top-=u,o.left-=a,g.css({position:"fixed"})):(r=u,i=a,g.css({position:"absolute"})),B.right!==!1?i+=Math.max(N.width()-B.w-q-F-Z(B.right,"x"),0):B.left!==!1?i+=Z(B.left,"x"):i+=Math.round(Math.max(N.width()-B.w-q-F,0)/2),B.bottom!==!1?r+=Math.max(N.height()-B.h-I-j-Z(B.bottom,"y"),0):B.top!==!1?r+=Z(B.top,"y"):r+=Math.round(Math.max(N.height()-B.h-I-j,0)/2),g.css({top:o.top,left:o.left}),e=g.width()===B.w+q&&g.height()===B.h+I?0:e||0,y[0].style.width=y[0].style.height="9999px",n={width:B.w+q,height:B.h+I,top:r,left:i},e===0&&g.css(n),g.dequeue().animate(n,{duration:e,complete:function(){f(this),X=!1,y[0].style.width=B.w+q+F+"px",y[0].style.height=B.h+I+j+"px",B.reposition&&setTimeout(function(){N.bind("resize."+s,J.position)},1),t&&t()},step:function(){f(this)}})},J.resize=function(e){W&&(e=e||{},e.width&&(B.w=Z(e.width,"x")-q-F),e.innerWidth&&(B.w=Z(e.innerWidth,"x")),C.css({width:B.w}),e.height&&(B.h=Z(e.height,"y")-I-j),e.innerHeight&&(B.h=Z(e.innerHeight,"y")),!e.innerHeight&&!e.height&&(C.css({height:"auto"}),B.h=C.height()),C.css({height:B.h}),J.position(B.transition==="none"?0:B.speed))},J.prep=function(t){function o(){return B.w=B.w||C.width(),B.w=B.mw&&B.mw1){typeof B.current=="string"&&O.html(B.current.replace("{current}",U+1).replace("{total}",o)).show(),_[B.loop||UB.mw&&(e=(z.width-B.mw)/z.width,r()),B.mh&&z.height>B.mh&&(e=(z.height-B.mh)/z.height,r())),B.h&&(z.style.marginTop=Math.max(B.h-z.height,0)/2+"px"),T[1]&&(B.loop||T[U+1])&&(z.style.cursor="pointer",z.onclick=function(){J.next()}),p&&(z.style.msInterpolationMode="bicubic"),setTimeout(function(){i(z)},1)}),setTimeout(function(){z.src=n},1)):n&&k.load(n,B.data,function(t,n,r){i(n==="error"?G(K,"Error").html(B.xhrError):e(this).contents())})},J.next=function(){!X&&T[1]&&(B.loop||T[U+1])&&(U=Y(1),J.load())},J.prev=function(){!X&&T[1]&&(B.loop||U)&&(U=Y(-1),J.load())},J.close=function(){W&&!V&&(V=!0,W=!1,nt(l,B.onCleanup),N.unbind("."+s+" ."+v),m.fadeTo(200,0),g.stop().fadeTo(300,0,function(){g.add(m).css({opacity:1,cursor:"auto"}).hide(),nt(h),C.remove(),setTimeout(function(){V=!1,nt(c,B.onClosed)},1)}))},J.remove=function(){e([]).add(g).add(m).remove(),g=null,e("."+o).removeData(i).removeClass(o).die()},J.element=function(){return e(R)},J.settings=r})(jQuery,document,this);
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright (c) 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(j,i,b,c,d){return jQuery.easing[jQuery.easing.def](j,i,b,c,d);},easeInQuad:function(j,i,b,c,d){return c*(i/=d)*i+b;},easeOutQuad:function(j,i,b,c,d){return -c*(i/=d)*(i-2)+b;},easeInOutQuad:function(j,i,b,c,d){if((i/=d/2)<1){return c/2*i*i+b;}return -c/2*((--i)*(i-2)-1)+b;},easeInCubic:function(j,i,b,c,d){return c*(i/=d)*i*i+b;},easeOutCubic:function(j,i,b,c,d){return c*((i=i/d-1)*i*i+1)+b;},easeInOutCubic:function(j,i,b,c,d){if((i/=d/2)<1){return c/2*i*i*i+b;}return c/2*((i-=2)*i*i+2)+b;},easeInQuart:function(j,i,b,c,d){return c*(i/=d)*i*i*i+b;},easeOutQuart:function(j,i,b,c,d){return -c*((i=i/d-1)*i*i*i-1)+b;},easeInOutQuart:function(j,i,b,c,d){if((i/=d/2)<1){return c/2*i*i*i*i+b;}return -c/2*((i-=2)*i*i*i-2)+b;},easeInQuint:function(j,i,b,c,d){return c*(i/=d)*i*i*i*i+b;},easeOutQuint:function(j,i,b,c,d){return c*((i=i/d-1)*i*i*i*i+1)+b;},easeInOutQuint:function(j,i,b,c,d){if((i/=d/2)<1){return c/2*i*i*i*i*i+b;}return c/2*((i-=2)*i*i*i*i+2)+b;},easeInSine:function(j,i,b,c,d){return -c*Math.cos(i/d*(Math.PI/2))+c+b;},easeOutSine:function(j,i,b,c,d){return c*Math.sin(i/d*(Math.PI/2))+b;},easeInOutSine:function(j,i,b,c,d){return -c/2*(Math.cos(Math.PI*i/d)-1)+b;},easeInExpo:function(j,i,b,c,d){return(i==0)?b:c*Math.pow(2,10*(i/d-1))+b;},easeOutExpo:function(j,i,b,c,d){return(i==d)?b+c:c*(-Math.pow(2,-10*i/d)+1)+b;},easeInOutExpo:function(j,i,b,c,d){if(i==0){return b;}if(i==d){return b+c;}if((i/=d/2)<1){return c/2*Math.pow(2,10*(i-1))+b;}return c/2*(-Math.pow(2,-10*--i)+2)+b;},easeInCirc:function(j,i,b,c,d){return -c*(Math.sqrt(1-(i/=d)*i)-1)+b;},easeOutCirc:function(j,i,b,c,d){return c*Math.sqrt(1-(i=i/d-1)*i)+b;},easeInOutCirc:function(j,i,b,c,d){if((i/=d/2)<1){return -c/2*(Math.sqrt(1-i*i)-1)+b;}return c/2*(Math.sqrt(1-(i-=2)*i)+1)+b;},easeInElastic:function(o,m,p,a,b){var d=1.70158;var c=0;var n=a;if(m==0){return p;}if((m/=b)==1){return p+a;}if(!c){c=b*0.3;}if(n開く');
//hashOpen
if("#"+target_elem.attr("id") === path){
target_elem.removeClass("closed");
imgReg(target_elem.find(".trigr"));
}
}
//画像置換
function imgReg(elem){
var trigrSrc = $("img",elem).attr("src");
$(elem).find("span").remove();
if(!trigrSrc.match("_open")){
$("img",elem).attr("src",trigrSrc.replace(".","_open.")).after('開く');
}else{
$("img",elem).attr("src",trigrSrc.replace("_open." , ".")).after('閉じる');
}
};
toggleBase.delegate(".trigr" , "click" , function(e){
e.preventDefault();
e.stopPropagation();
var wrap = $(this).parent(toggleBase),
target = wrap.find(".target");
imgReg(this);
if(wrap.hasClass("closed")){
wrap.removeClass("closed");
}else{
wrap.addClass("closed");
}
});
})();
// ----------------------------------------------------------------------------
// 02. addIcon
// ----------------------------------------------------------------------------
$('a[href$=pdf]').not(':has(img,span),.noIcon').append(' ');
$('a[href$=xlsx]').not(':has(img,span),.noIcon').append(' ');
$('a[href$=xls]').not(':has(img,span),.noIcon').append(' ');
$('a[href$=pptx]').not(':has(img,span),.noIcon').append(' ');
$('a[href$=ppt]').not(':has(img,span),.noIcon').append(' ');
$('a[target=_blank],a[target=_blank] span').not(':has(img,span),.noIcon').append(' ');
// ----------------------------------------------------------------------------
// 03. rollOver
// ----------------------------------------------------------------------------
(function(){
//画像ファイル名の末尾に下記を指定
var defaultSet = "_o", //通常時
hoverSet = "_h", //ロールオーバー時
anti = "unroll"; //ロールオーバさせたくない場合にa要素にantiクラスを振る
$("body").on( {
"mouseenter mouseleave focus blur": function(){hoverImg(this);},
"click": function(){$(this).blur();}
},"a");
function hoverImg(elem) {
var img = $(elem).children("img");
if(!(img.size() === 1)|| $(elem).hasClass(anti))return;
var ImgSrc = img.attr('src');
if(ImgSrc.match(defaultSet+ '.')){
var rollImg = ImgSrc.replace(new RegExp(defaultSet + "(\.[a-z]+)$"), hoverSet + "$1");
}else if(ImgSrc.match(hoverSet+ '.')){
var rollImg = ImgSrc.replace(new RegExp(hoverSet + "(\.[a-z]+)$"), defaultSet + "$1");
}else{return}
img.attr('src', rollImg);
};
})();
// ----------------------------------------------------------------------------
// 04. Global Navi Current
// ----------------------------------------------------------------------------
(function(){
var bodyId = $("body").attr("id"),
re_bodyId = new RegExp(bodyId),
globalList = $("#nav-global li"),
globalLength = globalList.length;
while(globalLength--){
var gnavClass = globalList.eq(globalLength).attr("class");
if (gnavClass.match(re_bodyId)!="" && gnavClass.match(re_bodyId)) {
globalList.eq(globalLength).children().addClass("current");
}
}
})();
// ----------------------------------------------------------------------------
// 05. getCookie
// ----------------------------------------------------------------------------
//クエリ設定ルール
//クエリ名=value
//引数"name"に取得したいクエリ名
function getCookie(name){
var cookie,
cookie_arr,
cookie_lng,
cookie_data,
cookie_value,
cookie_query;
cookie = document.cookie;
cookie_arr = cookie.split(";");
cookie_lng = cookie_arr.length;
while(cookie_lng--){
cookie_data = cookie_arr[cookie_lng];
cookie_value = cookie_data.indexOf("=");
cookie_query = cookie_data.substring(0, cookie_value);
if(cookie_query == name){
//return type = number
return parseInt(cookie_data.slice(cookie_value + 1));
}
}
return "";
};
// ----------------------------------------------------------------------------
// 06. tooltip
// ----------------------------------------------------------------------------
$(function(){
var wrap = $(".glossary-01");
wrap.on({
'click' : function(e){
$(".tooltip").remove();
e.preventDefault();
tooltip(this);
$(this).blur();
}
}," li > a");
wrap.on({
'mouseleave blur' : function(){$(this).remove();}
},".tooltip");
function tooltip(elem){
var tooltip_obj = $(elem.hash),
category = tooltip_obj.find("h4 img").attr("alt"),
title = tooltip_obj.find("dt").html(),
description = tooltip_obj.find("dd").html(),
html = $('');
//append element
html.appendTo($(elem).parent("li")).hide().stop(false , true).fadeIn();
adjustPos(elem);
};
function adjustPos(elem){
var target_obj = $(".tooltip"),
wrapPos = $(elem).position(),
wrap_x = wrapPos.left,
wrap_y = wrapPos.top,
wrapWidth = $(elem).width(),
wrapHeight = $(elem).height(),
targetWidth = target_obj.width(),
targetHeight = target_obj.height();
//set Position
target_obj.css({
left : wrap_x - targetWidth+wrapWidth + "px",
top : wrap_y - targetHeight - wrapHeight +"px"
});
};
});
// ----------------------------------------------------------------------------
// 07. setHeight
// ----------------------------------------------------------------------------
// (function(a){a.fn.set_height=function(q){var g={items_per_row:false,delay:1000,group_by_parent:false};if(q){jQuery.extend(g,q)}if(a("#js_etalon").length){var o=a("#js_etalon").get(0)}else{var o=a("body").append(' ').find("#js_etalon").get(0)}var e=function(t,s){for(var r=0;r0&&r!=u&&!A){f[++z]=[];x=0}u=r}if(g.items_per_row){b[v].className+=" nb"+parseInt(x%g.items_per_row+1);if(!(x%g.items_per_row)&&x>0){f[++z]=[];x=0;A=true}}f[z][x++]=b[v];A=false}for(var v=0;v ').find("#js_etalon").get(0)}var f=function(s,r){for(var i=0;i0&&z!=s&&!y){h[++x]=[];v=0}s=z}if(j.items_per_row){b[t].className+=" nb"+parseInt(v%j.items_per_row+1);if(!(v%j.items_per_row)&&v>0){h[++x]=[];v=0;y=true}}h[x][v++]=b[t];y=false}for(var t=0;t 768){
$('div.lay-col2-01.equalize > div.col').set_height({ items_per_row:2, group_by_parent: 'div.lay-col2-01' });
$('div.lay-col2-01 > div.col').children(':first-child').filter('[class^="box-"]').not('div[class^="box-toggle"],div[class^="box-understand"]').set_height({ items_per_row:2, group_by_parent: 'div.lay-col2-01' });
$('div.box-check-01 div.col').set_height({ items_per_row:2, group_by_parent: 'div.box-check-01' });
}
//3カラム
$('div.lay-col3-01.equalize > div.col').set_height({ items_per_row:3, group_by_parent: 'div.lay-col3-01' });
$('div.lay-col3-01 > div.col').children(':first-child').filter('[class^="box-"]').set_height({ items_per_row:3, group_by_parent: 'div.lay-col3-01' });
$('ul.img-col3-01.equalize > li').set_height({ items_per_row:3, group_by_parent: 'ul.img-col3-01' });
//4カラム
$('div.lay-col4-01.equalize > div.col').set_height({ items_per_row:4, group_by_parent: 'div.lay-col4-01' });
$('ul.list-box4-01 > li').set_height({ items_per_row:4, group_by_parent: 'ul' });
$('div.lay-col4-01 > div.col').children(':first-child').filter('[class^="box-"]').not('div[class^="box-toggle"],div[class^="box-understand"]').set_height({ items_per_row:4, group_by_parent: 'div.lay-col4-01' });
//保険をお考えのお客さま
$('div.box-lineup-01 > div').set_height({ items_per_row:2, group_by_parent: 'div.box-lineup-01' });
// ----------------------------------------------------------------------------
// 08. font-size Changer
// ----------------------------------------------------------------------------
(function(){
var fontSize = $("#fontsize"),
fontSizeBtn = $("dd a",fontSize),
fontSwicth = "fontSwicth";
//Cookie判定
if(getCookie(fontSwicth)){
$("body").addClass('fontL');
fontSizeBtn.removeClass();
fontSize.find("dd.large").children().addClass("active");
}
function setCookie(){
document.cookie = "fontSwicth=1;";
};
function resetCookie(){
document.cookie = "fontSwicth=0;";
};
fontSizeBtn.click(function(e){
if(!$(this).hasClass('active')){
$(this).addClass('active');
$(this).parent().siblings("dd").children("a").removeClass('active');
}
if($(this).parent().attr("class") === "large"){
$("body").addClass('fontL');
setCookie();
}else{
$("body").removeClass('fontL');
resetCookie();
}
e.preventDefault();
});
})();
// ----------------------------------------------------------------------------
// 09. tab
// ----------------------------------------------------------------------------
$(function() {
var wrap_obj = $("#tab-wrap");
if (wrap_obj.length === 0){
// 09-1. tab(URL)
// ----------------------------------------------------------------------------
$(function() {
if ($(".nav-tab-01").length === 0) return;
$(".nav-tab-01 a").each(function(){
var obj = $(this);
if(urlMatcher(obj.attr("href"))){
var objImg = obj.find("img"),
objImgSrc= objImg.attr("src");
objImg.attr("src", objImgSrc.replace(/^(.+)_o(\.[a-z]+)$/,"$1_h$2")).unwrap("a");
}
});
});
$(function() {
if ($(".nav-tab-02").length === 0) return;
$(".nav-tab-02 li").each(function(){
var obj = $(this),
html = $(this).html(),
anchor = obj.find("a");
if (anchor.length === 0) return;
if(urlMatcher(anchor.attr("href"))){
obj.addClass("current");
anchor.replaceWith('' + anchor.text() + '');
}
});
});
function urlMatcher(hrefStr) {
var path = location.pathname;
if(hrefStr.indexOf('.html') < 0 || hrefStr.indexOf('index.html') > -1) {
return hrefStr.replace('index.html', '') === path.replace('index.html', '') ? true : false;
} else {
return path.indexOf(hrefStr) > -1 ? true : false;
}
};
}else{
// 09-2. tab(anchor)
// ----------------------------------------------------------------------------
var nav_obj = $("ul.nav-tab-01" , wrap_obj),
nav02_obj = $("ul.nav-tab-02" , wrap_obj),
contents_obj = $(".tab-contents" , wrap_obj),
navList_obj = nav_obj.find("li"),
default_obj = navList_obj.eq(0),
defaultImg = default_obj.find("img"),
defaultImgSrc = defaultImg.attr("src"),
navList02_obj = nav_obj.find("li"),
default02_obj = navList02_obj.eq(0),
getUrl = location.hash;
//hashがついているかどうか
if(getUrl === ""){
//default set
contents_obj.nextAll().css("display" , "none");
default_obj.find("a").addClass("unroll");
defaultImg.attr("src", defaultImgSrc.replace(/^(.+)_o(\.[a-z]+)$/,"$1_h$2"));
}else{
var navListLng = navList_obj.length;
while(navListLng--){
var target_obj = navList_obj.eq(navListLng).find("a");
if(getUrl === target_obj.attr("href")){
$(getUrl).siblings(".tab-contents").css("display" , "none");
target_obj.addClass("unroll");
var targetImg = target_obj.find("img"),
targetImgSrc = targetImg.attr("src");
target_obj.find("img").attr("src", targetImgSrc.replace(/^(.+)_o(\.[a-z]+)$/,"$1_h$2"));
}
}
}
nav_obj.on( {
"click": function(e){tabFunc(this); e.preventDefault();}
},"a");
function tabFunc(elem){
var elemID = $(elem.hash),
elemImg = $(elem).find("img"),
elemImgSrc= elemImg.attr("src"),
other_obj = $(elem).parent("li").siblings().find("a"),
other_objLng = other_obj.length,
setImage = [];
contents_obj.css("display" , "none");
other_obj.removeClass("unroll");
while(other_objLng--){
var otherImg = other_obj.eq(other_objLng).find("img");
setImage[other_objLng] = otherImg.attr("src");
if(!setImage[other_objLng]) return;
otherImg.attr("src",setImage[other_objLng].replace("_h.","_o."));
};
//対象だけ表示
elemID.css("display" , "block");
$(elem).addClass("unroll");
elemImg.attr("src", elemImgSrc.replace(/^(.+)_o(\.[a-z]+)$/,"$1_h$2"));
};
}
});
// ----------------------------------------------------------------------------
// 10. Local Navigation Current
// ----------------------------------------------------------------------------
(function(){
var base =$("#nav-local").children("ul"),
obj = base.find("a"),
objLng = obj.length,
condIndex = /\/index\.html?/,
path = location.pathname.replace(condIndex, '/'),
pathArr = [path];
base.find("ul").hide(); //いったん第二階層以下を閉じておく
while (path && '/' !== path) {
path = path.replace(/[^/]*\/?$/, '');
pathArr.push(path);
}
var pathLng = pathArr.length;
var obj_hrefs = obj.map(function(){
return $(this).attr('href').replace(condIndex, '/');
});
//ローカルナビのa要素のhref値と、現在のURLを比較。
//マッチするまで回す。マッチしたらli要素に”current”を付与してブレイク
var j = 0;
checking : while (j <= objLng) {
if (path === obj_hrefs[j]) {
obj.eq(j).parent().addClass('current'); break checking;
}
else if(j === objLng){
var i = 0;
while(i 0){
//アンカータグを取得し、そこに飛ぶ
location.href = location.hash;
}
};
// ----------------------------------------------------------------------------
// 14. modal window(colorbox)
// ----------------------------------------------------------------------------
$(function(){
var _btn = '';
$("a.modal-01").colorbox({
close : _btn,
onComplete:function(){
$("#cboxClose").appendTo("#colorbox").css({
"z-index" : "100000",
"display" : "block"
});
}
});
$("a.modal-slide").colorbox({
inline:true ,
width : "820",
close : _btn,
onComplete:function(){
slideShow01();
$("#cboxClose").appendTo("#colorbox").css({
"z-index" : "100000",
"display" : "block"
});
}
});
$("a.modal-inline").colorbox({
inline:true ,
width : "760",
height : "80%",
close : _btn,
onComplete:function(){
$("#cboxClose").appendTo("#colorbox").css({
"z-index" : "100000",
"display" : "block"
});
}
});
});
// ----------------------------------------------------------------------------
// 14. inhibit-context
// ----------------------------------------------------------------------------
//コンテキスト
$(function () {
$("body.inhibit-context").on('contextmenu',function () {return false;});
});
// ----------------------------------------------------------------------------
// 15. art Only
// ----------------------------------------------------------------------------
// modal window
// ----------------------------------------------------------------------------
$(function(){
$("a.modal-art").colorbox({
iframe : true,
width : "920",
height:"100%",
innerWidth : "100%",
innerHeight : "100%",
close : ""
});
$("a.modal-contact").colorbox({
iframe : true,
width : "690",
height:"520",
close : ""
});
$("#modal-art01 .btn").click(function(e){
e.preventDefault(); e.stopPropagation();
parent.$.fn.colorbox.close();
});
$("#modal-art02 .btn").click(function(e){
e.preventDefault(); e.stopPropagation();
parent.$.fn.colorbox.close();
});
});
// mainVisual
// ----------------------------------------------------------------------------
$(function(){
var mainvisual = $("#info #main-visual"),
btn = mainvisual.find("p.btn"),
hoverElem = mainvisual.find("#louvre");
//default
hoverElem.css("display" , "none");
btn.on('mouseenter',function(){
$(this).next("#louvre").fadeIn();
});
hoverElem.on('mouseleave',function(){
$(this).css("display" , "none");
});
});
// slideshow
// ----------------------------------------------------------------------------
function slideShow01(){
var wrapper = $("div.carouselBnr-01"),
thumb = $("div.carouselBnr-01 ul"),
thumbList = thumb.find("li"),
thumbList_lng = thumbList.length,
//elements
prev_obj = '
',
next_obj = '
',
_diff = 5;
//width
var thumbList_w = thumbList.width() + _diff,
thumb_w = thumbList_w*thumbList_lng,
//list position counter
_num = 0,
//item view
_itemView = 1,
//flag
flag={
anime:false
};
//ulに全リスト分の幅を付与
thumb.width(thumb_w);
set_thumbList(thumbList);
function set_thumbList(list){
var count = thumbList_lng;
while(count--){
list.eq(count).css('left', (thumbList_w * count) +"px");
}
};
if(thumbList_lng > 0){
thumb.after(prev_obj,next_obj);
thumbList.find("a").click(function(e){
e.preventDefault();
var defaultPos = $(this).parent("li").position();
var get_clickPos = defaultPos.left;
});
$("#ctrl-prev").click(function(e){
// controller-prev
if(!flag.anime){
flag.anime = true;
e.preventDefault();
//ThumbNail
var getPos_base = parseInt(thumb.css("left"), 10),
getPos_lastList = parseInt(thumbList.eq(thumbList_lng-1).css("left"), 10),
_breakPoint = 0;
if(getPos_base === 0){
thumbList.eq(thumbList_lng-1).css('left', -(getPos_base+thumbList_w) +"px");
//thumbList.eq(thumbList_lng-1).css('left', -(thumb_w) +"px");
thumb.stop(true , false).animate({left: (getPos_base+thumbList_w) +"px"},{
duration : 500,
complete : function(){
var getPos_lastList = parseInt(thumbList.eq(0).css("left"), 10);
if(getPos_base === -getPos_lastList){
//reset
thumb.css('left', -thumb_w + thumbList_w + "px");
set_thumbList(thumbList);
flag.anime = false;
}
}
});
}else{
thumb.stop(true , false).animate({left: (getPos_base+thumbList_w) +"px"},{
duration : 500,
complete : function(){
flag.anime = false;
}
});
}
}
});
$("#ctrl-next").click(function(e){
if(!flag.anime){
flag.anime = true;
e.preventDefault();
//ThumbNail
var getPos_base = parseInt(thumb.css("left"), 10);
getPos_lastList = parseInt(thumbList.eq(thumbList_lng-1).css("left"), 10),
_amari = -(thumbList_lng - _itemView)*thumbList_w;
if(getPos_base <= _amari){
thumbList.eq(_num).css('left', (getPos_lastList + thumbList_w + thumbList_w*_num) +"px");
thumb.stop(true , false).animate({left: (getPos_base-thumbList_w) +"px"},{
duration : 500,
complete : function(){
if(-getPos_base === getPos_lastList && getPos_lastList!=0){
//reset
thumb.css('left', "0");
_num = 0;
set_thumbList(thumbList);
flag.anime = false;
}
}
});
_num++;
}else{
thumb.stop(true , false).animate({left: (getPos_base-thumbList_w) +"px"},{
complete : function(){
flag.anime = false;
}
});
}
}
});
}
};