﻿//ほかのライブラリとのコンフリクトを避ける
//$ = jQuery.noConflict();

//	====================================================
//	Useful Javascript Library
//	Haste Ver 2.20
//	by Taichi Kume
//  
//  2.20変更箇所
//  - 文字サイズ変更ボタンスクリプト追加
//  - イコールヘイト追加
//  - バグフィクス
//  - No more IE6追加　それに伴い透過PNGの部分を抹消
//  - jquery 1.4に対応
//  
//  2.10変更箇所
//  - ロールオーバーをフェード表示に変更(IE7 透過PNGバグ対応)
//  
//  2.00変更箇所
//  - テキストフィールド初期値スクリプト
//  -- 初期値文字色と入力文字色の指定に対応(CSS側で指定)
//  -- 入力されていない場合に空クエリを送信するように修正
//      (今までは初期値が送信されてしまっていた）
//  
//  - ロールオーバースクリプト
//  -- プルダウンメニューなどのグループ扱いに対応
//  -- input type="image"にも対応
//  
//  - iframeスクリプト
//  -- head内にスクリプトを書かずに済むように変更
//  
//  - 透過PNGスクリプト
//  -- VML仕様
//  -- head内にスクリプトを書かずに済むように変更
//  
//  - 角丸スクリプト（CSS3+VML）
//  -- 2px,4px,6px,8px,10pxはクラス名のみで対応
//  
//  各種使用法はスクリプト先頭に記載
//	
//	1.別ウィンドウで開かせる
//	2.クリックで消えるテキストフィールド初期値
//	3.ロールオーバー、カレント表示スクリプト
//	4.scrollsmoothly
//	5.アコーディオン
//	6.iframe代用スクリプト
//  7.透過PNG対応
//  8.角丸スクリプト
//	
//	====================================================





//	====================================================
//	ロールオーバー、カレント表示スクリプト
//
//	ファイル名に"_out"が付いている要素はロールオーバー効果が適用される。
//	中身のimgは_over付きのものに変わる。
//	
//	設定例：
//	別途dummy_over.jpgを同じフォルダに用意する
//	<img src="dummy_out.jpg" /> 
//	
//	カレント表示方法
//  _current付きの画像を同じフォルダに用意する
//	ページヘッダーにリンクと対応したIDを指定
//	<script type="text/javascript">
//		SITE.current='#u001';
//	</script>
//	
//	<li class="nav001" id="u001"><img src="/common/images/nav001_out.png" /></li>
//
//  クロスフェード動作 参考
//  Description: fadein/out button image when mouse overed.
//  Update:  2010/07/1-
//  Author:  Japan Electronic Industrial Arts Co.Ltd.
//           http://www.jeia.co.jp/
//  License: licensed under the MIT (MIT-LICENSE.txt) license.
//  Using:   using jQuery
//           http://jquery.com/
//	
//	====================================================

SITE = {
	basepath : '/',
	preloader : {
		loadedImages: [],
		load: function (url){
			var img = this.loadedImages;
			var l = img.length;
			img[l] = new Image();
			img[l].src = url;
		}
	}
};


$(function(){
  if (SITE.current){
    $(SITE.current).addClass('current');
    $(SITE.current).find('img').each(function(){  // SITE.currentのimg を全て取得
      var img = $(this);
      // src が **_out のもののみを処理を実施
      if (img.attr('src').match("_out.") == "_out."){
        var crsrc = img.attr('src').replace(/_out(\.gif|\.jpg|\.png)/, "_current$1");
        img.attr('src', crsrc);
      }
    });
  }
});


new function() {
	
	var fadeInTime = 150;	// msec
	var fadeOutTime = 150;	// msec
	var offClass = 'out';
	var onClass = 'over';
	
	if ( typeof $ == 'undefined' ) {
		return;
	}
	
	$(document).ready( function() {
		init();
	});
	
	/**
	 * initialize
	 */
	function init() {
		
		$( 'a img' ).each( function() {
			
			var src = $(this).attr( 'src' );
			var fadePatern = new RegExp( /.*_out\.[^.]+/ );
			var onImage;
      
      
			if ( src.match( fadePatern ) ) {
        
				onImage = $(this).clone();
				onImage.
					attr( 'src', src.replace( '_out.', '_over.' ) ).
					addClass( onClass ).
					fadeTo( 0, 0 ).
					css({
						'position': 'absolute',
						'left': '0px',
						'top': '0px'
					});
				
				$(this).
					addClass( offClass ).
					css({
						'position': 'absolute',
						'left': '0px',
						'top': '0px'
					}).
					parent().
						append( onImage ).
						mouseover( onMouseOver ).
						mouseout( onMouseOut ).
						css({
							'display': 'inline-block',
							'position': 'relative'
						}).
						width($(this).width()).
						height($(this).height());
				
        
			}
		});
	}
	
	
	/**
	 * mouseover event( fadein )
	 */
	function onMouseOver( e ) {
		
		var src = $(this).children( 'img.' + offClass ).attr( 'src' );
		
		$(this).unbind( 'mouseover', onMouseOver );
		
    $(this).children( 'img.' + onClass ).fadeTo( fadeInTime, 1, function(){
      $(this).parent().mouseover( onMouseOver );
    });
	}
	
	/**
	 * mouseout event( fadeout )
	 */
	function onMouseOut( e ) {
		
		var src = $(this).children( 'img.' + offClass ).attr( 'src' );
		
    $(this).children( 'img.' + onClass ).fadeTo( fadeOutTime, 0 );
		
	}
}






//	====================================================
//	別ウィンドウで開かせる
//	classにpopupを指定
//  対Strict用
//	====================================================
$(document).ready(function(){
　$(".popup").click(function(){
　  window.open(this.href,'_blank');
　　return false;
　});
});





//	====================================================
//	クリックで消えるテキストフィールド初期値
//  
//  inputタグにtitleを追記する
//  例：<input type="text" title="初期値" />
//  文字設定などはCSS側で指定
//  .formTips => 初期値
//  .formFocus => 入力値
//	====================================================
$(document).ready(function() {

	var type = $(this).attr('type');
	if(type == 'file' || type == 'checkbox' || type == 'radio') { return false; }
  
	$('input[title],textarea[title]').each(function() {
		if($(this).val() === '') {
			$(this).val($(this).attr('title'));
		  $(this).addClass('formTips');
		}
		
		$(this).focus(function() {
			if($(this).val() == $(this).attr('title')) {
		    $(this).val('').removeClass('formTips');
				$(this).val('').addClass('formFocus');
			}
		});
    
		$(this).blur(function() {
			if($(this).val() === '') {
				$(this).val($(this).attr('title')).removeClass('formFocus');
				$(this).val($(this).attr('title')).addClass('formTips');
			}
		});
	});
  
	$(this).submit(function() {
    $('input[title],textarea[title]').each(function() {
    	if(jQuery.trim($(this).val()) == "" || jQuery.trim($(this).val()) == $(this).attr('title')) {
    			$(this).val("").removeClass('formFocus');
    	}
    });
  });
});






//	====================================================
//	iframe代用スクリプト
//  対Strict用
//
//	<a href="myIframe.html" class="iframe w:300 h:300">
//
//  Options:
//  -------
//  width:      	width of iframe (default: 640)			w:640
//  height:      	height of iframe (default: 480)			h:480
//  scrolling:   	auto									sc:auto
//  frameborder:	height of iframe (default: 0)			fb:0
//  marginwidth:	margin of iframe (default: 0)			wm:0
//  marginheight:	margin of iframe (default: 0)			hm:0
//	====================================================
 jQuery.fn.iframe = function(options) {
    return this.each(function() {
        var $this = jQuery(this);
        var cls = this.className;
        
        var opts = jQuery.extend({
            frameborder:  ((cls.match(/fb:(\d+)/)||[])[1]) || 0,
            marginwidth:  ((cls.match(/wm:(\d+)/)||[])[1]) || 0,
            marginheight: ((cls.match(/hm:(\d+)/)||[])[1]) || 0,
            width:        ((cls.match(/w:(\d+)/)||[])[1]) || 640,
            height:       ((cls.match(/h:(\d+)/)||[])[1]) || 480,
            scrolling:    ((cls.match(/sc:(\w+)/)||[])[1]) || "auto",
            version:     '1,0,0,0',
            cls:          cls,
            src:          $this.attr('href') || $this.attr('src'),
			id:			  $this.attr('id'),
            caption:      $this.text(),
            attrs:        {},
            elementType:  'div',
            xhtml:        true
        }, options || {});
        
        var endTag = opts.xhtml ? ' />' : '>';

        var a = ['<iframe src="' + opts.src + '"'];
		if(opts.id){
			a.push(' id="' + opts.id + '"');
		}else{
			a.push(' id="content_iframe"');
		}
		a.push(' frameborder="' + opts.frameborder + '"');
		a.push(' marginwidth="' + opts.marginwidth + '"');
		a.push(' marginheight="' + opts.marginheight + '"');
		a.push(' width="' + opts.width + '"');
		a.push(' height="' + opts.height + '"');
		a.push(' scrolling="' + opts.scrolling + '"');
		a.push(endTag);
        
        // convert anchor to span/div/whatever...
        var $el = jQuery('<' + opts.elementType + ' class="' + opts.cls + '"></' + opts.elementType + '>');
        $el.html(a.join(''));
        $this.after($el).remove();
    });
};

$(document).ready(function(){
	$('a.iframe').iframe();
});





//	====================================================
//  CSS3を使用した角丸
//  IEにも対応
//  VML仕様のため、ボーダーがにじまない。
//  各辺が違うスタイルや、背景やボーダーカラーなどにも対応
//  
//  使用法
//  2px,6px,8px,10pxまではクラス名だけで対応
//  
//  2pxの角丸の場合
//  <div class="rb02">
//  
//  その他の対応
//  HTMLドキュメントに下記書式でスクリプトを記載する
//  <script type="text/javascript">
//  DD_roundies.addRule('任意のクラス名やID', '角丸サイズ', true);
//  </script>
//  
//  例：クラス名"hoge"と"doraemon"、ID名"nobita"というボックスと、<span>タグ全てに
//      左上が10px 右上が8px 左下が5px 右下が2pxという角丸を適用するには。
//  DD_roundies.addRule('.hoge .doraemon #nobita span', '10px 8px 2px 5px', true);
//  
//  角丸サイズ指定の並びは、'左上 右上 右下 左下'　の順番です。
//  
//  DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers.
//  Author: Drew Diller
//  Email: drew.diller@gmail.com
//  URL: http://www.dillerdesign.com/experiment/DD_roundies/
//  Version: 0.0.2a
//  Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license
//	====================================================

var DD_roundies={ns:'DD_roundies',IE6:false,IE7:false,IE8:false,IEversion:function(){if(document.documentMode !=8 && document.namespaces && !document.namespaces[this.ns]){this.IE6=true;this.IE7=true;}else if(document.documentMode==8){this.IE8=true;}},querySelector:document.querySelectorAll,selectorsToProcess:[],imgSize:{},createVmlNameSpace:function(){if(this.IE6||this.IE7){document.namespaces.add(this.ns,'urn:schemas-microsoft-com:vml');}if(this.IE8){document.writeln('<?import namespace="'+this.ns+'" implementation="#default#VML"?>');}},createVmlStyleSheet:function(){var style=document.createElement('style');document.documentElement.firstChild.insertBefore(style,document.documentElement.firstChild.firstChild);if(style.styleSheet){try{var styleSheet=style.styleSheet;styleSheet.addRule(this.ns+'\\:*','{behavior:url(#default#VML)}');this.styleSheet=styleSheet;}catch(err){}}else{this.styleSheet=style;}},addRule:function(selector,rad,standards){if(typeof rad=='undefined'||rad===null){rad=0;}if(rad.constructor.toString().search('Array')==-1){rad=rad.toString().replace(/[^0-9 ]/g,'').split(' ');}for(var i=0;i<4;i++){rad[i]=(!rad[i] && rad[i] !==0)?rad[Math.max((i-2),0)]:rad[i];}if(this.styleSheet){if(this.styleSheet.addRule){var selectors=selector.split(',');for(var i=0;i<selectors.length;i++){this.styleSheet.addRule(selectors[i],'behavior:expression(DD_roundies.roundify.call(this,['+rad.join(',')+']))');}}else if(standards){var moz_implementation=rad.join('px ')+'px';this.styleSheet.appendChild(document.createTextNode(selector+'{border-radius:'+moz_implementation+';-moz-border-radius:'+moz_implementation+';}'));this.styleSheet.appendChild(document.createTextNode(selector+'{-webkit-border-top-left-radius:'+rad[0]+'px '+rad[0]+'px;-webkit-border-top-right-radius:'+rad[1]+'px '+rad[1]+'px;-webkit-border-bottom-right-radius:'+rad[2]+'px '+rad[2]+'px;-webkit-border-bottom-left-radius:'+rad[3]+'px '+rad[3]+'px;}'));}}else if(this.IE8){this.selectorsToProcess.push({'selector':selector,'radii':rad});}},readPropertyChanges:function(el){switch(event.propertyName){case 'style.border':case 'style.borderWidth':case 'style.padding':this.applyVML(el);break;case 'style.borderColor':this.vmlStrokeColor(el);break;case 'style.backgroundColor':case 'style.backgroundPosition':case 'style.backgroundRepeat':this.applyVML(el);break;case 'style.display':el.vmlBox.style.display=(el.style.display=='none')?'none':'block';break;case 'style.filter':this.vmlOpacity(el);break;case 'style.zIndex':el.vmlBox.style.zIndex=el.style.zIndex;break;}},applyVML:function(el){el.runtimeStyle.cssText='';this.vmlFill(el);this.vmlStrokeColor(el);this.vmlStrokeWeight(el);this.vmlOffsets(el);this.vmlPath(el);this.nixBorder(el);this.vmlOpacity(el);},vmlOpacity:function(el){if(el.currentStyle.filter.search('lpha') !=-1){var trans=el.currentStyle.filter;trans=parseInt(trans.substring(trans.lastIndexOf('=')+1,trans.lastIndexOf(')')),10)/100;for(var v in el.vml){el.vml[v].filler.opacity=trans;}}},vmlFill:function(el){if(!el.currentStyle){return;}else{var elStyle=el.currentStyle;}el.runtimeStyle.backgroundColor='';el.runtimeStyle.backgroundImage='';var noColor=(elStyle.backgroundColor=='transparent');var noImg=true;if(elStyle.backgroundImage !='none'||el.isImg){if(!el.isImg){el.vmlBg=elStyle.backgroundImage;el.vmlBg=el.vmlBg.substr(5,el.vmlBg.lastIndexOf('")')-5);}else{el.vmlBg=el.src;}var lib=this;if(!lib.imgSize[el.vmlBg]){var img=document.createElement('img');img.attachEvent('onload',function(){this.width=this.offsetWidth;this.height=this.offsetHeight;lib.vmlOffsets(el);});img.className=lib.ns+'_sizeFinder';img.runtimeStyle.cssText='behavior:none;position:absolute;top:-10000px;left:-10000px;border:none;';img.src=el.vmlBg;img.removeAttribute('width');img.removeAttribute('height');document.body.insertBefore(img,document.body.firstChild);lib.imgSize[el.vmlBg]=img;}el.vml.image.filler.src=el.vmlBg;noImg=false;}el.vml.image.filled=!noImg;el.vml.image.fillcolor='none';el.vml.color.filled=!noColor;el.vml.color.fillcolor=elStyle.backgroundColor;el.runtimeStyle.backgroundImage='none';el.runtimeStyle.backgroundColor='transparent';},vmlStrokeColor:function(el){el.vml.stroke.fillcolor=el.currentStyle.borderColor;},vmlStrokeWeight:function(el){var borders=['Top','Right','Bottom','Left'];el.bW={};for(var b=0;b<4;b++){el.bW[borders[b]]=parseInt(el.currentStyle['border'+borders[b]+'Width'],10)||0;}},vmlOffsets:function(el){var dims=['Left','Top','Width','Height'];for(var d=0;d<4;d++){el.dim[dims[d]]=el['offset'+dims[d]];}var assign=function(obj,topLeft){obj.style.left=(topLeft?0:el.dim.Left)+'px';obj.style.top=(topLeft?0:el.dim.Top)+'px';obj.style.width=el.dim.Width+'px';obj.style.height=el.dim.Height+'px';};for(var v in el.vml){var mult=(v=='image')?1:2;el.vml[v].coordsize=(el.dim.Width*mult)+','+(el.dim.Height*mult);assign(el.vml[v],true);}assign(el.vmlBox,false);if(DD_roundies.IE8){el.vml.stroke.style.margin='-1px';if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}el.vml.color.style.margin=(el.bW.Top-1)+'px '+(el.bW.Left-1)+'px';}},vmlPath:function(el){var coords=function(direction,w,h,r,aL,aT,mult){var cmd=direction?['m','qy','l','qx','l','qy','l','qx','l']:['qx','l','qy','l','qx','l','qy','l','m'];aL *=mult;aT *=mult;w *=mult;h *=mult;var R=r.slice();for(var i=0;i<4;i++){R[i] *=mult;R[i]=Math.min(w/2,h/2,R[i]);}var coords=[cmd[0]+Math.floor(0+aL)+','+Math.floor(R[0]+aT),cmd[1]+Math.floor(R[0]+aL)+','+Math.floor(0+aT),cmd[2]+Math.ceil(w-R[1]+aL)+','+Math.floor(0+aT),cmd[3]+Math.ceil(w+aL)+','+Math.floor(R[1]+aT),cmd[4]+Math.ceil(w+aL)+','+Math.ceil(h-R[2]+aT),cmd[5]+Math.ceil(w-R[2]+aL)+','+Math.ceil(h+aT),cmd[6]+Math.floor(R[3]+aL)+','+Math.ceil(h+aT),cmd[7]+Math.floor(0+aL)+','+Math.ceil(h-R[3]+aT),cmd[8]+Math.floor(0+aL)+','+Math.floor(R[0]+aT)];if(!direction){coords.reverse();}var path=coords.join('');return path;};if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}var bW=el.bW;var rad=el.DD_radii.slice();var outer=coords(true,el.dim.Width,el.dim.Height,rad,0,0,2);rad[0] -=Math.max(bW.Left,bW.Top);rad[1] -=Math.max(bW.Top,bW.Right);rad[2] -=Math.max(bW.Right,bW.Bottom);rad[3] -=Math.max(bW.Bottom,bW.Left);for(var i=0;i<4;i++){rad[i]=Math.max(rad[i],0);}var inner=coords(false,el.dim.Width-bW.Left-bW.Right,el.dim.Height-bW.Top-bW.Bottom,rad,bW.Left,bW.Top,2);var image=coords(true,el.dim.Width-bW.Left-bW.Right+1,el.dim.Height-bW.Top-bW.Bottom+1,rad,bW.Left,bW.Top,1);el.vml.color.path=inner;el.vml.image.path=image;el.vml.stroke.path=outer+inner;this.clipImage(el);},nixBorder:function(el){var s=el.currentStyle;var sides=['Top','Left','Right','Bottom'];for(var i=0;i<4;i++){el.runtimeStyle['padding'+sides[i]]=(parseInt(s['padding'+sides[i]],10)||0)+(parseInt(s['border'+sides[i]+'Width'],10)||0)+'px';}el.runtimeStyle.border='none';},clipImage:function(el){var lib=DD_roundies;if(!el.vmlBg||!lib.imgSize[el.vmlBg]){return;}var thisStyle=el.currentStyle;var bg={'X':0,'Y':0};var figurePercentage=function(axis,position){var fraction=true;switch(position){case 'left':case 'top':bg[axis]=0;break;case 'center':bg[axis]=0.5;break;case 'right':case 'bottom':bg[axis]=1;break;default:if(position.search('%') !=-1){bg[axis]=parseInt(position,10) * 0.01;}else{fraction=false;}}var horz=(axis=='X');bg[axis]=Math.ceil(fraction?((el.dim[horz?'Width':'Height'] -(el.bW[horz?'Left':'Top']+el.bW[horz?'Right':'Bottom']) ) * bg[axis]) -(lib.imgSize[el.vmlBg][horz?'width':'height'] * bg[axis]):parseInt(position,10));bg[axis]+=1;};for(var b in bg){figurePercentage(b,thisStyle['backgroundPosition'+b]);}el.vml.image.filler.position=(bg.X/(el.dim.Width-el.bW.Left-el.bW.Right+1))+','+(bg.Y/(el.dim.Height-el.bW.Top-el.bW.Bottom+1));var bgR=thisStyle.backgroundRepeat;var c={'T':1,'R':el.dim.Width+1,'B':el.dim.Height+1,'L':1};var altC={'X':{'b1':'L','b2':'R','d':'Width'},'Y':{'b1':'T','b2':'B','d':'Height'}};if(bgR !='repeat'){c={'T':(bg.Y),'R':(bg.X+lib.imgSize[el.vmlBg].width),'B':(bg.Y+lib.imgSize[el.vmlBg].height),'L':(bg.X)};if(bgR.search('repeat-') !=-1){var v=bgR.split('repeat-')[1].toUpperCase();c[altC[v].b1]=1;c[altC[v].b2]=el.dim[altC[v].d]+1;}if(c.B>el.dim.Height){c.B=el.dim.Height+1;}}el.vml.image.style.clip='rect('+c.T+'px '+c.R+'px '+c.B+'px '+c.L+'px)';},pseudoClass:function(el){var self=this;setTimeout(function(){self.applyVML(el);},1);},reposition:function(el){this.vmlOffsets(el);this.vmlPath(el);},roundify:function(rad){this.style.behavior='none';if(!this.currentStyle){return;}else{var thisStyle=this.currentStyle;}var allowed={BODY:false,TABLE:false,TR:false,TD:false,SELECT:false,OPTION:false,TEXTAREA:false};if(allowed[this.nodeName]===false){return;}var self=this;var lib=DD_roundies;this.DD_radii=rad;this.dim={};var handlers={resize:'reposition',move:'reposition'};if(this.nodeName=='A'){var moreForAs={mouseleave:'pseudoClass',mouseenter:'pseudoClass',focus:'pseudoClass',blur:'pseudoClass'};for(var a in moreForAs){handlers[a]=moreForAs[a];}}for(var h in handlers){this.attachEvent('on'+h,function(){lib[handlers[h]](self);});}this.attachEvent('onpropertychange',function(){lib.readPropertyChanges(self);});var giveLayout=function(el){el.style.zoom=1;if(el.currentStyle.position=='static'){el.style.position='relative';}};giveLayout(this.offsetParent);giveLayout(this);this.vmlBox=document.createElement('ignore');this.vmlBox.runtimeStyle.cssText='behavior:none;position:absolute;margin:0;padding:0;border:0;background:none;';this.vmlBox.style.zIndex=thisStyle.zIndex;this.vml={'color':true,'image':true,'stroke':true};for(var v in this.vml){this.vml[v]=document.createElement(lib.ns+':shape');this.vml[v].filler=document.createElement(lib.ns+':fill');this.vml[v].appendChild(this.vml[v].filler);this.vml[v].stroked=false;this.vml[v].style.position='absolute';this.vml[v].style.zIndex=thisStyle.zIndex;this.vml[v].coordorigin='1,1';this.vmlBox.appendChild(this.vml[v]);}this.vml.image.fillcolor='none';this.vml.image.filler.type='tile';this.parentNode.insertBefore(this.vmlBox,this);this.isImg=false;if(this.nodeName=='IMG'){this.isImg=true;this.style.visibility='hidden';}setTimeout(function(){lib.applyVML(self);},1);}};try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}DD_roundies.IEversion();DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();if(DD_roundies.IE8 && document.attachEvent && DD_roundies.querySelector){document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete'){var selectors=DD_roundies.selectorsToProcess;var length=selectors.length;var delayedCall=function(node,radii,index){setTimeout(function(){DD_roundies.roundify.call(node,radii);},index*100);};for(var i=0;i<length;i++){var results=document.querySelectorAll(selectors[i].selector);var rLength=results.length;for(var r=0;r<rLength;r++){if(results[r].nodeName !='INPUT'){delayedCall(results[r],selectors[i].radii,r);}}}}});}

$(document).ready(function(){
	$("head").append("<script>DD_roundies.addRule('.rb02', '2px', true);DD_roundies.addRule('.rb04', '4px', true);DD_roundies.addRule('.rb06', '6px 6px', true);DD_roundies.addRule('.rb08', '8px', true);DD_roundies.addRule('.rb10', '10px', true);</script>");
});





//	====================================================
//  
//  イコールヘイト
//  
//  揃えたいカラムにclass="eq01"などとつける。
//  ページ内に違う高さの行で、それぞれ揃えたい場合はeq01 eq02と数字を増やしてグループ分けする。
//  eq10まで対応。それ以上の数がある場合は、最後の行（.append)を編集すること
//  
//	Version: 2010-09-15
//  Copyright (c) 2007, KITAMURA Akatsuki
//  
//  http://www.akatsukinishisu.net/itazuragaki/js/i20070801.html
//  
//  Permission is hereby granted, free of charge, to any person obtaining a
//  copy of this software and associated documentation files (the "Software"),
//  to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense,
//  and/or sell copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following conditions:
//  
//  The above copyright notice and this permission notice shall be included
//  in all copies or substantial portions of the Software.
//  
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
//  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
//  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//  OTHER DEALINGS IN THE SOFTWARE.
//  
//	====================================================/*

/*
	$.changeLetterSize.addHandler(func)
	文字の大きさが変化した時に実行する処理を追加
*/

jQuery.changeLetterSize = {
	handlers : [],
	interval : 1000,
	currentSize: 0
};

(function($) {

	var self = $.changeLetterSize;

	/* 文字の大きさを確認するためのins要素 */
	var ins = $('<ins>M</ins>').css({
		display: 'block',
		visibility: 'hidden',
		position: 'absolute',
		padding: '0',
		top: '0'
	});

	/* 文字の大きさが変わったか */
	var isChanged = function() {
		ins.appendTo('body');
		var size = ins[0].offsetHeight;
		ins.remove();
		if (self.currentSize == size) return false;
		self.currentSize = size;
		return true;
	};

	/* 文書を読み込んだ時点で
	   文字の大きさを確認しておく */
	$(isChanged);

	/* 文字の大きさが変わっていたら、
	   handlers中の関数を順に実行 */
	var observer = function() {
		if (!isChanged()) return;
		$.each(self.handlers, function(i, handler) {
			handler();
		});
	};

	/* ハンドラを登録し、
	   最初の登録であれば、定期処理を開始 */
	self.addHandler = function(func) {
		self.handlers.push(func);
		if (self.handlers.length == 1) {
			setInterval(observer, self.interval);
		}
	};

})(jQuery);

/*
	$(expr).flatHeights()
	$(expr)で選択した複数の要素について、それぞれ高さを
	一番高いものに揃える
*/

(function($) {

	/* 対象となる要素群の集合 */
	var sets = [];

	/* 高さ揃えの処理本体 */
	var flatHeights = function(set) {
		var maxHeight = 0;
		set.each(function(){
			var height = this.offsetHeight;
			if (height > maxHeight) maxHeight = height;
		});
		set.css('height', maxHeight + 'px');
	};

	/* 要素群の高さを揃え、setsに追加 */
	jQuery.fn.flatHeights = function() {
		if (this.length > 1) {
			flatHeights(this);
			sets.push(this);
		}
		return this;
	};

	/* 高さ揃えを再実行する処理 */
	var reflatting = function() {
		$.each(sets, function() {
			this.height('auto');
			flatHeights(this);
		});
	};

	/* 文字の大きさが変わった時に高さ揃えを再実行 */
	$.changeLetterSize.addHandler(reflatting);

	/* ウィンドウの大きさが変わった時に高さ揃えを再実行 */
	$(window).resize(reflatting);

})(jQuery);

$(document).ready(function(){$("head").append("<script type='text/javascript'>$(function(){$('.eq01').flatHeights();});$(function(){$('.eq02').flatHeights();});$(function(){$('.eq03').flatHeights();});$(function(){$('.eq04').flatHeights();});$(function(){$('.eq05').flatHeights();});$(function(){$('.eq06').flatHeights();});$(function(){$('.eq07').flatHeights();});$(function(){$('.eq08').flatHeights();});$(function(){$('.eq09').flatHeights();});$(function(){$('.eq10').flatHeights();});</script>");});





//	====================================================
//  サムネイル画像切り替え
//  WTN*jQuery sample:: Image change02 script.(use jQuery1.2.6)
//  Copyright (c) 2008 Tenderfeel. http://tenderfeel.xsrv.jp
//  MIT & GPL (GPL-LICENSE.txt) licenses.

 $(document).ready(function (){
									 
	var list = $('.photo > ul.thumbs img');
    var large = $('.photo >img.main_img');

		var regrep = "_thumb"; // 	Replace name of thumbnail images

		//$('ul#cImageThumb img').each(function(i){
		list.each(function(i){
			var myhref = $(this).attr('src').replace(regrep,"");
			var myalt = $(this).attr('alt');
			var imgs = $("<img></img>").attr({ 
				  src: myhref,
				  title: myalt,
				  'class': 'change',
				  alt: myalt,
				  id: 'cImageView-'+i
			});
			imgs.hide();
      
			//$('#cImageView').append(imgs);
      var main_img = $(this).parent().parent().parent().find('.main_img');
      main_img.append(imgs);

			large.append(imgs);
			$(this).hover(function(){
				//$('#cImageView img').hide();
        var main_img = $(this).parent().parent().parent().find('.main_img');
        // fade ものについては、stop いれてあげないと、アニメーション継続します
        // fadeIn だと、stop で止まったらそこまでしか opacity が上がらんので、
        // fadeTo にして、 opacity が 1 までいくようにします。
				$('#cImageView-'+i).fadeTo('normal', 1).siblings().stop().hide();
			});
		});

	//}
});






//	====================================================
//  カルーセル
//  
//  jQuery bxSlider v3.0
//  http://bxslider.com
//  
//  Copyright 2010, Steven Wanderski
//  http://stevenwanderski.com
//  
//  Free to use and abuse under the MIT license.
//  http://www.opensource.org/licenses/mit-license.php
//  
//	====================================================
(function($){$.fn.bxSlider=function(options){var defaults={mode:'horizontal',infiniteLoop:true,hideControlOnEnd:false,controls:true,speed:500,pager:false,pagerSelector:null,pagerType:'full',pagerLocation:'bottom',pagerShortSeparator:'/',pagerActiveClass:'pager-active',nextText:'next',nextImage:'',nextSelector:null,prevText:'prev',prevImage:'',prevSelector:null,captions:false,captionsSelector:null,auto:false,autoDirection:'next',autoControls:false,autoControlsSelector:null,autoStart:true,autoHover:false,pause:3000,startText:'start',startImage:'',stopText:'stop',stopImage:'',ticker:false,tickerSpeed:5000,tickerDirection:'next',tickerHover:false,wrapperClass:'bx-wrapper',startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:false,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},onNextSlide:function(){},onPrevSlide:function(){},buildPager:null}
var options=$.extend(defaults,options);var base=this;var $parent=$(this);var $children=$parent.children();var $outerWrapper='';var $firstChild=$parent.children(':first');var childrenWidth=$firstChild.width();var childrenMaxWidth=0;var childrenOuterWidth=$firstChild.outerWidth();var childrenMaxHeight=0;var wrapperWidth=getWrapperWidth();var wrapperHeight=getWrapperHeight();var isWorking=false;var $pager='';var currentSlide=0;var origLeft=0;var origTop=0;var interval='';var $autoControls='';var $stopHtml='';var $startContent='';var $stopContent='';var autoPlaying=true;var loaded=false;var origShowWidth=0;var origShowHeight=0;var tickerLeft=0;var tickerTop=0;$children.each(function(index){if($(this).outerHeight()>childrenMaxHeight){childrenMaxHeight=$(this).outerHeight();}
if($(this).outerWidth()>childrenMaxWidth){childrenMaxWidth=$(this).outerWidth();}});if(options.randomStart){var randomNumber=Math.floor(Math.random()*$children.length);currentSlide=randomNumber;origLeft=childrenOuterWidth*(options.moveSlideQty+randomNumber);origTop=childrenMaxHeight*(options.moveSlideQty+randomNumber);}else{currentSlide=options.startingSlide;origLeft=childrenOuterWidth*(options.moveSlideQty+options.startingSlide);origTop=childrenMaxHeight*(options.moveSlideQty+options.startingSlide);}
var firstSlide=0;var lastSlide=$children.length-1;this.goToSlide=function(number,stopAuto){if(!isWorking){isWorking=true;currentSlide=number;options.onBeforeSlide(currentSlide,$children.length,$children.eq(currentSlide));if(typeof(stopAuto)=='undefined'){var stopAuto=true;}
if(stopAuto){if(options.auto){base.stopShow(true);}}
if(!options.infiniteLoop){if(currentSlide>lastSlide-options.displaySlideQty){slide=(lastSlide-options.displaySlideQty)+1;}else{slide=number;}}else{slide=number;}
if(slide==firstSlide){options.onFirstSlide(currentSlide,$children.length,$children.eq(currentSlide));}
if(slide==lastSlide){options.onLastSlide(currentSlide,$children.length,$children.eq(currentSlide));}
if(options.mode=='horizontal'){$parent.animate({'left':'-'+getSlidePosition(slide,'left')+'px'},options.speed,function(){isWorking=false;options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='vertical'){$parent.animate({'top':'-'+getSlidePosition(slide,'top')+'px'},options.speed,function(){isWorking=false;options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='fade'){setChildrenFade();}
checkEndControls();makeSlideActive(number);showCaptions();}}
this.goToNextSlide=function(stopAuto){if(typeof(stopAuto)=='undefined'){var stopAuto=true;}
if(stopAuto){if(options.auto){base.stopShow(true);}}
if(!options.infiniteLoop){if(!isWorking){var slideLoop=false;currentSlide=(currentSlide+(options.moveSlideQty));if(currentSlide>=lastSlide){currentSlide=lastSlide;}
checkEndControls();options.onNextSlide(currentSlide,$children.length,$children.eq(currentSlide));base.goToSlide(currentSlide);}}else{if(!isWorking){isWorking=true;var slideLoop=false;currentSlide=(currentSlide+options.moveSlideQty);if(currentSlide>lastSlide){currentSlide=currentSlide%$children.length;slideLoop=true;}
options.onNextSlide(currentSlide,$children.length,$children.eq(currentSlide));options.onBeforeSlide(currentSlide,$children.length,$children.eq(currentSlide));if(options.mode=='horizontal'){var parentLeft=(options.moveSlideQty*childrenOuterWidth);$parent.animate({'left':'-='+parentLeft+'px'},options.speed,function(){isWorking=false;if(slideLoop){$parent.css('left','-'+getSlidePosition(currentSlide,'left')+'px');}
options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='vertical'){var parentTop=(options.moveSlideQty*childrenMaxHeight);$parent.animate({'top':'-='+parentTop+'px'},options.speed,function(){isWorking=false;if(slideLoop){$parent.css('top','-'+getSlidePosition(currentSlide,'top')+'px');}
options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='fade'){setChildrenFade();}
makeSlideActive(currentSlide);showCaptions();}}}
this.goToPreviousSlide=function(stopAuto){if(typeof(stopAuto)=='undefined'){var stopAuto=true;}
if(stopAuto){if(options.auto){base.stopShow(true);}}
if(!options.infiniteLoop){if(!isWorking){var slideLoop=false;currentSlide=currentSlide-options.moveSlideQty;if(currentSlide<0){currentSlide=0;if(options.hideControlOnEnd){$('.bx-prev',$outerWrapper).hide();}}
checkEndControls();options.onPrevSlide(currentSlide,$children.length,$children.eq(currentSlide));base.goToSlide(currentSlide);}}else{if(!isWorking){isWorking=true;var slideLoop=false;currentSlide=(currentSlide-(options.moveSlideQty));if(currentSlide<0){negativeOffset=(currentSlide%$children.length);if(negativeOffset==0){currentSlide=0;}else{currentSlide=($children.length)+negativeOffset;}
slideLoop=true;}
options.onPrevSlide(currentSlide,$children.length,$children.eq(currentSlide));options.onBeforeSlide(currentSlide,$children.length,$children.eq(currentSlide));if(options.mode=='horizontal'){var parentLeft=(options.moveSlideQty*childrenOuterWidth);$parent.animate({'left':'+='+parentLeft+'px'},options.speed,function(){isWorking=false;if(slideLoop){$parent.css('left','-'+getSlidePosition(currentSlide,'left')+'px');}
options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='vertical'){var parentTop=(options.moveSlideQty*childrenMaxHeight);$parent.animate({'top':'+='+parentTop+'px'},options.speed,function(){isWorking=false;if(slideLoop){$parent.css('top','-'+getSlidePosition(currentSlide,'top')+'px');}
options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});}else if(options.mode=='fade'){setChildrenFade();}
makeSlideActive(currentSlide);showCaptions();}}}
this.goToFirstSlide=function(stopAuto){if(typeof(stopAuto)=='undefined'){var stopAuto=true;}
base.goToSlide(firstSlide,stopAuto);}
this.goToLastSlide=function(){if(typeof(stopAuto)=='undefined'){var stopAuto=true;}
base.goToSlide(lastSlide,stopAuto);}
this.getCurrentSlide=function(){return currentSlide;}
this.getSlideCount=function(){return $children.length;}
this.stopShow=function(changeText){clearInterval(interval);if(typeof(changeText)=='undefined'){var changeText=true;}
if(changeText&&options.autoControls){$autoControls.html($startContent).removeClass('stop').addClass('start');autoPlaying=false;}}
this.startShow=function(changeText){if(typeof(changeText)=='undefined'){var changeText=true;}
setAutoInterval();if(changeText&&options.autoControls){$autoControls.html($stopContent).removeClass('start').addClass('stop');autoPlaying=true;}}
this.stopTicker=function(changeText){$parent.stop();if(typeof(changeText)=='undefined'){var changeText=true;}
if(changeText&&options.ticker){$autoControls.html($startContent).removeClass('stop').addClass('start');autoPlaying=false;}}
this.startTicker=function(changeText){if(options.mode=='horizontal'){if(options.tickerDirection=='next'){var stoppedLeft=parseInt($parent.css('left'));var remainingDistance=(origShowWidth+stoppedLeft)+$children.eq(0).width();}else if(options.tickerDirection=='prev'){var stoppedLeft=-parseInt($parent.css('left'));var remainingDistance=(stoppedLeft)-$children.eq(0).width();}
var finishingSpeed=(remainingDistance*options.tickerSpeed)/origShowWidth;moveTheShow(tickerLeft,remainingDistance,finishingSpeed);}else if(options.mode=='vertical'){if(options.tickerDirection=='next'){var stoppedTop=parseInt($parent.css('top'));var remainingDistance=(origShowHeight+stoppedTop)+$children.eq(0).height();}else if(options.tickerDirection=='prev'){var stoppedTop=-parseInt($parent.css('top'));var remainingDistance=(stoppedTop)-$children.eq(0).height();}
var finishingSpeed=(remainingDistance*options.tickerSpeed)/origShowHeight;moveTheShow(tickerTop,remainingDistance,finishingSpeed);if(typeof(changeText)=='undefined'){var changeText=true;}
if(changeText&&options.ticker){$autoControls.html($stopContent).removeClass('start').addClass('stop');autoPlaying=true;}}}
this.initShow=function(){initCss();if(options.pager&&!options.ticker){if(options.pagerType=='full'){showPager('full');}else if(options.pagerType=='short'){showPager('short');}}
if(options.controls&&!options.ticker){setControlsVars();}
if(options.auto||options.ticker){if(options.autoControls){setAutoControlsVars();}
if(options.autoStart){base.startShow(true);}else{base.stopShow(true);}
if(options.autoHover){setAutoHover();}}
makeSlideActive(currentSlide);checkEndControls();if(options.captions){showCaptions();}
options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));}
function initCss(){setChildrenLayout(options.startingSlide);if(options.mode=='horizontal'){$parent.wrap('<div class="'+options.wrapperClass+'" style="width:'+wrapperWidth+'px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden;"></div>').css({width:'99999px',position:'relative',left:'-'+(origLeft)+'px'});$parent.children().css({width:childrenWidth,float:'left',listStyle:'none'});$outerWrapper=$parent.parent().parent();$children.addClass('pager');}else if(options.mode=='vertical'){$parent.wrap('<div class="'+options.wrapperClass+'" style="width:'+childrenMaxWidth+'px; position:relative;"></div>').wrap('<div class="bx-window" style="width:'+childrenMaxWidth+'px; height:'+childrenMaxHeight+'px; position:relative; overflow:hidden;"></div>').css({height:'99999px',position:'relative',top:'-'+(origTop)+'px'});$parent.children().css({listStyle:'none',height:childrenMaxHeight});$outerWrapper=$parent.parent().parent();$children.addClass('pager');}else if(options.mode=='fade'){$parent.wrap('<div class="'+options.wrapperClass+'" style="width:'+childrenMaxWidth+'px; position:relative;"></div>').wrap('<div class="bx-window" style="height:'+childrenMaxHeight+'px; width:'+childrenMaxWidth+'px; position:relative; overflow:hidden;"></div>');$parent.children().css({listStyle:'none',position:'absolute',top:0,left:0,zIndex:98});$outerWrapper=$parent.parent().parent();$children.not(':eq('+currentSlide+')').fadeTo(0,0);$children.eq(currentSlide).css('zIndex',99);}
if(options.captions&&options.captionsSelector==null){$outerWrapper.append('<div class="bx-captions"></div>');}}
function setChildrenLayout(){if(options.mode=='horizontal'||options.mode=='vertical'){var $prependedChildren=getArraySample($children,0,options.moveSlideQty,'backward');$.each($prependedChildren,function(index){$parent.prepend($(this));});var totalNumberAfterWindow=($children.length+options.moveSlideQty)-1;var pagerExcess=$children.length-options.displaySlideQty;var numberToAppend=totalNumberAfterWindow-pagerExcess;var $appendedChildren=getArraySample($children,0,numberToAppend,'forward');$.each($appendedChildren,function(index){$parent.append($(this));});}}
function setControlsVars(){if(options.nextImage!=''){nextContent=options.nextImage;nextType='image';}else{nextContent=options.nextText;nextType='text';}
if(options.prevImage!=''){prevContent=options.prevImage;prevType='image';}else{prevContent=options.prevText;prevType='text';}
showControls(nextType,nextContent,prevType,prevContent);}
function setAutoInterval(){if(options.auto){if(!options.infiniteLoop){if(options.autoDirection=='next'){interval=setInterval(function(){currentSlide+=options.moveSlideQty;if(currentSlide>lastSlide){currentSlide=currentSlide%$children.length;}
base.goToSlide(currentSlide,false);},options.pause);}else if(options.autoDirection=='prev'){interval=setInterval(function(){currentSlide-=options.moveSlideQty;if(currentSlide<0){negativeOffset=(currentSlide%$children.length);if(negativeOffset==0){currentSlide=0;}else{currentSlide=($children.length)+negativeOffset;}}
base.goToSlide(currentSlide,false);},options.pause);}}else{if(options.autoDirection=='next'){interval=setInterval(function(){base.goToNextSlide(false);},options.pause);}else if(options.autoDirection=='prev'){interval=setInterval(function(){base.goToPreviousSlide(false);},options.pause);}}}else if(options.ticker){options.tickerSpeed*=100;$('.pager').each(function(index){origShowWidth+=$(this).width();origShowHeight+=$(this).height();});if(options.tickerDirection=='prev'&&options.mode=='horizontal'){$parent.css('left','-'+(origShowWidth+origLeft)+'px');}else if(options.tickerDirection=='prev'&&options.mode=='vertical'){$parent.css('top','-'+(origShowHeight+origTop)+'px');}
if(options.mode=='horizontal'){tickerLeft=parseInt($parent.css('left'));moveTheShow(tickerLeft,origShowWidth,options.tickerSpeed);}else if(options.mode=='vertical'){tickerTop=parseInt($parent.css('top'));moveTheShow(tickerTop,origShowHeight,options.tickerSpeed);}
if(options.tickerHover){setTickerHover();}}}
function moveTheShow(leftCss,distance,speed){if(options.mode=='horizontal'){if(options.tickerDirection=='next'){$parent.animate({'left':'-='+distance+'px'},speed,'linear',function(){$parent.css('left',leftCss);moveTheShow(leftCss,origShowWidth,options.tickerSpeed);});}else if(options.tickerDirection=='prev'){$parent.animate({'left':'+='+distance+'px'},speed,'linear',function(){$parent.css('left',leftCss);moveTheShow(leftCss,origShowWidth,options.tickerSpeed);});}}else if(options.mode=='vertical'){if(options.tickerDirection=='next'){$parent.animate({'top':'-='+distance+'px'},speed,'linear',function(){$parent.css('top',leftCss);moveTheShow(leftCss,origShowHeight,options.tickerSpeed);});}else if(options.tickerDirection=='prev'){$parent.animate({'top':'+='+distance+'px'},speed,'linear',function(){$parent.css('top',leftCss);moveTheShow(leftCss,origShowHeight,options.tickerSpeed);});}}}
function setAutoControlsVars(){if(options.startImage!=''){startContent=options.startImage;startType='image';}else{startContent=options.startText;startType='text';}
if(options.stopImage!=''){stopContent=options.stopImage;stopType='image';}else{stopContent=options.stopText;stopType='text';}
showAutoControls(startType,startContent,stopType,stopContent);}
function setAutoHover(){$outerWrapper.find('.bx-window').hover(function(){if(autoPlaying){base.stopShow(false);}},function(){if(autoPlaying){base.startShow(false);}});}
function setTickerHover(){$parent.hover(function(){if(autoPlaying){base.stopTicker(false);}},function(){if(autoPlaying){base.startTicker(false);}});}
function setChildrenFade(){$children.not(':eq('+currentSlide+')').fadeTo(options.speed,0).css('zIndex',98);$children.eq(currentSlide).css('zIndex',99).fadeTo(options.speed,1,function(){isWorking=false;options.onAfterSlide(currentSlide,$children.length,$children.eq(currentSlide));});};function makeSlideActive(number){if(options.pagerType=='full'&&options.pager){$('a',$pager).removeClass(options.pagerActiveClass);$('a',$pager).eq(number).addClass(options.pagerActiveClass);}else if(options.pagerType=='short'&&options.pager){$('.bx-pager-current',$pager).html(currentSlide+1);}}
function showControls(nextType,nextContent,prevType,prevContent){var $nextHtml=$('<a href="" class="bx-next png"></a>');var $prevHtml=$('<a href="" class="bx-prev png"></a>');if(nextType=='text'){$nextHtml.html(nextContent);}else{$nextHtml.html('<img src="'+nextContent+'" />');}
if(prevType=='text'){$prevHtml.html(prevContent);}else{$prevHtml.html('<img src="'+prevContent+'" />');}
if(options.prevSelector){$(options.prevSelector).append($prevHtml);}else{$outerWrapper.append($prevHtml);}
if(options.nextSelector){$(options.nextSelector).append($nextHtml);}else{$outerWrapper.append($nextHtml);}
$nextHtml.click(function(){base.goToNextSlide();return false;});$prevHtml.click(function(){base.goToPreviousSlide();return false;});}
function showPager(type){var pagerString='';if(options.buildPager){$children.each(function(index,value){pagerString+=options.buildPager(index,value);});}else if(type=='full'){$children.each(function(index){pagerString+='<a href="" class="pager-link pager-'+(index+1)+'">'+(index+1)+'</a>';});}else if(type=='short'){pagerString='<span class="bx-pager-current">'+(options.startingSlide+1)+'</span> '+options.pagerShortSeparator+' <span class="bx-pager-total">'+$children.length+'<span>';}
if(options.pagerSelector){$(options.pagerSelector).append(pagerString);$pager=$(options.pagerSelector);}else{var $pagerContainer=$('<div class="bx-pager"></div>');$pagerContainer.append(pagerString);if(options.pagerLocation=='top'){$outerWrapper.prepend($pagerContainer);}else if(options.pagerLocation=='bottom'){$outerWrapper.append($pagerContainer);}
$pager=$('.bx-pager',$outerWrapper);}
$pager.children().click(function(){if(options.pagerType=='full'){var slideIndex=$pager.children().index(this);base.goToSlide(slideIndex);}
return false;});}
function showCaptions(){var caption=$('img',$children.eq(currentSlide)).attr('title');if(caption!=''){if(options.captionsSelector){$(options.captionsSelector).html(caption);}else{$('.bx-captions',$outerWrapper).html(caption);}}else{if(options.captionsSelector){$(options.captionsSelector).html(' ');}else{$('.bx-captions',$outerWrapper).html(' ');}}}
function showAutoControls(startType,startContent,stopType,stopContent){$autoControls=$('<a href="" class="bx-start"></a>');if(startType=='text'){$startContent=startContent;}else{$startContent='<img src="'+startContent+'" />';}
if(stopType=='text'){$stopContent=stopContent;}else{$stopContent='<img src="'+stopContent+'" />';}
if(options.startSelector){$(options.startSelector).append($autoControls);}else{$outerWrapper.append('<div class="bx-auto"></div>');$('.bx-auto',$outerWrapper).html($autoControls);}
$autoControls.click(function(){if(options.ticker){if($(this).hasClass('stop')){base.stopTicker();}else if($(this).hasClass('start')){base.startTicker();}}else{if($(this).hasClass('stop')){base.stopShow(true);}else if($(this).hasClass('start')){base.startShow(true);}}
return false;});}
function checkEndControls(){if(!options.infiniteLoop&&options.hideControlOnEnd){if(currentSlide==firstSlide){$('.bx-prev',$outerWrapper).hide();}else{$('.bx-prev',$outerWrapper).show();}
if(currentSlide==lastSlide){$('.bx-next',$outerWrapper).hide();}else{$('.bx-next',$outerWrapper).show();}}}
function getSlidePosition(number,side){if(side=='left'){var position=$('.pager',$outerWrapper).eq(number).position().left;}else if(side=='top'){var position=$('.pager',$outerWrapper).eq(number).position().top;}
return position;}
function getWrapperWidth(){var wrapperWidth=$firstChild.outerWidth()*options.displaySlideQty;return wrapperWidth;}
function getWrapperHeight(){var wrapperHeight=$firstChild.outerHeight()*options.displaySlideQty;return wrapperHeight;}
function getArraySample(array,start,length,direction){var sample=[];var loopLength=length;var startPopulatingArray=false;if(direction=='backward'){array=$.makeArray(array);array.reverse();}
while(loopLength>0){$.each(array,function(index,val){if(loopLength>0){if(!startPopulatingArray){if(index==start){startPopulatingArray=true;sample.push($(this).clone());loopLength--;}}else{sample.push($(this).clone());loopLength--;}}else{return false;}});}
return sample;}
this.each(function(){base.initShow();});return this;}})(jQuery);





//	====================================================
//  追加スクリプト
//  フォントサイズ変更ボタン用
/*
 * jQuery fontsize switcher
 * http://az-store.nrym.org/
 */
$(function(){
   var currentstyle = readCookie('fontStyle');
   if (currentstyle){
   switchFont(currentstyle);
   };
   $("dd.sizeL").click(function(){
   switchFont("fontL");
   return false;
   });
   $("dd.sizeM").click(function(){
   switchFont("fontM");
   return false;
   });
   $("dd.sizeS").click(function(){
   switchFont("fontS");
   return false;
  });
});
function switchFont(className){
   $("body").removeAttr("class").addClass(className);
   createCookie('fontStyle', className, 365);
};
// cookie script http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days){
   if (days){
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = "; expires="+date.toGMTString();
   }
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name){
   var nameEQ = name + "=";
   var ca = document.cookie.split(';');
   for(var i=0;i < ca.length;i++)
   {
   var c = ca[i];
   while (c.charAt(0)==' ') c = c.substring(1,c.length);
   if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
   }
   return null;
}




/* =========================================================

// jquery.innerfade.js

// Datum: 2008-02-14
// Firma: Medienfreunde Hofmann & Baldes GbR
// Author: Torsten Baldes
// Mail: t.baldes@medienfreunde.com
// Web: http://medienfreunde.com

// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/
// and Ralf S. Engelschall http://trainofthoughts.org/

 *
 *  <ul id="news"> 
 *      <li>content 1</li>
 *      <li>content 2</li>
 *      <li>content 3</li>
 *  </ul>
 *  
 *  $('#news').innerfade({ 
 *	  animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
 *	  speed: Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'), 
 *	  timeout: Time between the fades in milliseconds (Default: '2000'), 
 *	  type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
 * 		containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
 *	  runningclass: CSS-Class which the container get’s applied (Default: 'innerfade'),
 *	  children: optional children selector (Default: null)
 *  }); 
 *

// ========================================================= */


(function($) {

    $.fn.innerfade = function(options) {
        return this.each(function() {   
            $.innerfade(this, options);
        });
    };

    $.innerfade = function(container, options) {
        var settings = {
        		'animationtype':    'fade',
            'speed':            'normal',
            'type':             'sequence',
            'timeout':          2000,
            'containerheight':  'auto',
            'runningclass':     'innerfade',
            'children':         null
        };
        if (options)
            $.extend(settings, options);
        if (settings.children === null)
            var elements = $(container).children();
        else
            var elements = $(container).children(settings.children);
        if (elements.length > 1) {
            $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass);
            for (var i = 0; i < elements.length; i++) {
                $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide();
            };
            if (settings.type == "sequence") {
                setTimeout(function() {
                    $.innerfade.next(elements, settings, 1, 0);
                }, settings.timeout);
                $(elements[0]).show();
            } else if (settings.type == "random") {
            		var last = Math.floor ( Math.random () * ( elements.length ) );
                setTimeout(function() {
                    do { 
												current = Math.floor ( Math.random ( ) * ( elements.length ) );
										} while (last == current );             
										$.innerfade.next(elements, settings, current, last);
                }, settings.timeout);
                $(elements[last]).show();
						} else if ( settings.type == 'random_start' ) {
								settings.type = 'sequence';
								var current = Math.floor ( Math.random () * ( elements.length ) );
								setTimeout(function(){
									$.innerfade.next(elements, settings, (current + 1) %  elements.length, current);
								}, settings.timeout);
								$(elements[current]).show();
						}	else {
							alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
						}
				}
    };

    $.innerfade.next = function(elements, settings, current, last) {
        if (settings.animationtype == 'slide') {
            $(elements[last]).slideUp(settings.speed);
            $(elements[current]).slideDown(settings.speed);
        } else if (settings.animationtype == 'fade') {
            $(elements[last]).fadeOut(settings.speed);
            $(elements[current]).fadeIn(settings.speed, function() {
							removeFilter($(this)[0]);
						});
        } else
            alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');
        if (settings.type == "sequence") {
            if ((current + 1) < elements.length) {
                current = current + 1;
                last = current - 1;
            } else {
                current = 0;
                last = elements.length - 1;
            }
        } else if (settings.type == "random") {
            last = current;
            while (current == last)
                current = Math.floor(Math.random() * elements.length);
        } else
            alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');
        setTimeout((function() {
            $.innerfade.next(elements, settings, current, last);
        }), settings.timeout);
    };

})(jQuery);

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
	if(element.style.removeAttribute){
		element.style.removeAttribute('filter');
	}
}
