jQuery(document).ready(function(){
	
	//ページ内移動
 	$('a[href*=#top]').click(function() {			
		$('html,body').animate({ scrollTop : 0 });
        return false;
    });
	
    $('a[href*=#]').click(function() {			
		var targetY = $('[name=' + this.hash + ']').offset().top;
		if (targetY)$('html,body').animate({ scrollTop : targetY });
        return false;
    });
	
	//検索
	$('#serch_submit').click(function() {
		
		location.href="item."+ str2url( trim($('#serch').val() ) ) +".html";
		
	
	});
 
});


function str2url(str){
		
		str = mb_convert_kana(str,"rmnsKVo");
		str = str.replace(/[<>\"\{\}\|\\^\[\]`#%;\/\?:@&=\+\$,\'\(\) \.]/g,'-');
		str = str.replace(/^\-/,'x');
		str = str.replace(/\-$/,'x');
		return str;
		
}


//カスタムアラート st

// jQuery Alert Dialogs Plugin
//
// Version 1.1
//
// Cory S.N. LaViska
// A Beautiful Site (http://abeautifulsite.net/)
// 14 May 2009
//
// Visit http://abeautifulsite.net/notebook/87 for more information
//
// Usage:
//		jAlert( message, [title, callback] )
//		jConfirm( message, [title, callback] )
//		jPrompt( message, [value, title, callback] )
// 
// History:
//
//		1.00 - Released (29 December 2008)
//
//		1.01 - Fixed bug where unbinding would destroy all resize events
//
// License:
// 
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
// is copyright 2008 A Beautiful Site, LLC. 
//
(function($) {
	
	$.alerts = {
		
		// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
		
		verticalOffset: -75,                // vertical offset of the dialog from center screen, in pixels
		horizontalOffset: 0,                // horizontal offset of the dialog from center screen, in pixels/
		repositionOnResize: true,           // re-centers the dialog on window resize
		overlayOpacity: .01,                // transparency level of overlay
		overlayColor: '#FFF',               // base color of overlay
		draggable: true,                    // make the dialogs draggable (requires UI Draggables plugin)
		okButton: '&nbsp;OK&nbsp;',         // text for the OK button
		cancelButton: '&nbsp;Cancel&nbsp;', // text for the Cancel button
		dialogClass: null,                  // if specified, this class will be applied to all dialogs
		
		// Public methods
		
		alert: function(message, title, callback) {
			if( title == null ) title = 'Alert';
			$.alerts._show(title, message, null, 'alert', function(result) {
				if( callback ) callback(result);
			});
		},
		
		confirm: function(message, title, callback) {
			if( title == null ) title = 'Confirm';
			$.alerts._show(title, message, null, 'confirm', function(result) {
				if( callback ) callback(result);
			});
		},
			
		prompt: function(message, value, title, callback) {
			if( title == null ) title = 'Prompt';
			$.alerts._show(title, message, value, 'prompt', function(result) {
				if( callback ) callback(result);
			});
		},
		
		// Private methods
		
		_show: function(title, msg, value, type, callback) {
			
			$.alerts._hide();
			$.alerts._overlay('show');
			
			$("BODY").append(
			  '<div id="popup_container">' +
			    '<h2 id="popup_title"></h2>' +
			    '<div id="popup_content">' +
			      '<div id="popup_message"></div>' +
				'</div>' +
			  '</div>');
			
			if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
			
			// IE6 Fix
			var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; 
			
			$("#popup_container").css({
				position: pos,
				zIndex: 99999,
				padding: 0,
				margin: 0
			});
			
			$("#popup_title").text(title);
			$("#popup_content").addClass(type);
			$("#popup_message").text(msg);
			$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
			
			$("#popup_container").css({
				minWidth: $("#popup_container").outerWidth(),
				maxWidth: $("#popup_container").outerWidth()
			});
			
			$.alerts._reposition();
			$.alerts._maintainPosition(true);
			
			switch( type ) {
				case 'alert':
					$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
					$("#popup_ok").click( function() {
						$.alerts._hide();
						callback(true);
					});
					$("#popup_ok").focus().keypress( function(e) {
						if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
					});
				break;
				case 'confirm':
					$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
					$("#popup_ok").click( function() {
						$.alerts._hide();

						if( callback ) callback(true);
					});
					$("#popup_cancel").click( function() {
						$.alerts._hide();
						if( callback ) callback(false);
					});
					$("#popup_ok").focus();
					$("#popup_ok, #popup_cancel").keypress( function(e) {
						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
					});
				break;
				case 'prompt':
					$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
					$("#popup_prompt").width( $("#popup_message").width() );
					$("#popup_ok").click( function() {
						var val = $("#popup_prompt").val();
						$.alerts._hide();
						if( callback ) callback( val );
					});
					$("#popup_cancel").click( function() {
						$.alerts._hide();
						if( callback ) callback( null );
					});
					$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
					});
					if( value ) $("#popup_prompt").val(value);
					$("#popup_prompt").focus().select();
				break;
			}
			
			// Make draggable
			if( $.alerts.draggable ) {
				try {
					$("#popup_container").draggable({ handle: $("#popup_title") });
					$("#popup_title").css({ cursor: 'move' });
				} catch(e) { /* requires jQuery UI draggables */ }
			}
		},
		
		_hide: function() {
			$("#popup_container").remove();
			$.alerts._overlay('hide');
			$.alerts._maintainPosition(false);
		},
		
		_overlay: function(status) {
			switch( status ) {
				case 'show':
					$.alerts._overlay('hide');
					$("BODY").append('<div id="popup_overlay"></div>');
					$("#popup_overlay").css({
						position: 'absolute',
						zIndex: 99998,
						top: '0px',
						left: '0px',
						width: '100%',
						height: $(document).height(),
						background: $.alerts.overlayColor,
						opacity: $.alerts.overlayOpacity
					});
				break;
				case 'hide':
					$("#popup_overlay").remove();
				break;
			}
		},
		
		_reposition: function() {
			var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset;
			var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset;
			if( top < 0 ) top = 0;
			if( left < 0 ) left = 0;
			
			// IE6 fix
			if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
			
			$("#popup_container").css({
				top: top + 'px',
				left: left + 'px'
			});
			$("#popup_overlay").height( $(document).height() );
		},
		
		_maintainPosition: function(status) {
			if( $.alerts.repositionOnResize ) {
				switch(status) {
					case true:
						$(window).bind('resize', $.alerts._reposition);
					break;
					case false:
						$(window).unbind('resize', $.alerts._reposition);
					break;
				}
			}
		}
		
	}
	
	// Shortuct functions
	jAlert = function(message, title, callback) {
		$.alerts.alert(message, title, callback);
	}
	
	jConfirm = function(message, title, callback) {
		$.alerts.confirm(message, title, callback);
	};
		
	jPrompt = function(message, value, title, callback) {
		$.alerts.prompt(message, value, title, callback);
	};
	
})(jQuery);

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(8(C){C.h={19:{13:8(E,D,H){c G=C.h[E].1K;2H(c F 3D H){G.1W[F]=G.1W[F]||[];G.1W[F].2F([D,H[F]])}},2f:8(D,F,E){c H=D.1W[F];5(!H){e}2H(c G=0;G<H.1F;G++){5(D.a[H[G][0]]){H[G][1].1M(D.j,E)}}}},1Z:{},d:8(D){5(C.h.1Z[D]){e C.h.1Z[D]}c E=C(\'<2c 33="h-3C">\').1V(D).d({n:"Z",6:"-3a",7:"-3a",3E:"3F"}).1v("11");C.h.1Z[D]=!!((!(/1G|3I/).X(E.d("1q"))||(/^[1-9]/).X(E.d("w"))||(/^[1-9]/).X(E.d("T"))||!(/35/).X(E.d("3H"))||!(/3G|3z\\(0, 0, 0, 0\\)/).X(E.d("3y"))));3w{C("11").3c(0).3e(E.3c(0))}3T(F){}e C.h.1Z[D]},3Y:8(D){C(D).1N("1Q","3p").d("30","35")},3S:8(D){C(D).1N("1Q","3R").d("30","")},3L:8(G,D){c F=/6/.X(D||"6")?"v":"u",E=p;5(G[F]>0){e q}G[F]=1;E=G[F]>0?q:p;G[F]=0;e E}};c A=C.2Q.1u;C.2Q.1u=8(){C("*",4).13(4).2J("1u");e A.1M(4,3k)};8 B(F,D,G){c E=C[F][D].3Q||[];E=(2j E=="2D"?E.2K(/,?\\s+/):E);e(C.3P(G,E)!=-1)}C.1C=8(D,E){c F=D.2K(".")[0];D=D.2K(".")[1];C.2Q[D]=8(J){c H=(2j J=="2D"),I=3M.1K.3W.2f(3k,1);5(H&&B(F,D,J)){c G=C.U(4[0],D);e(G?G[J].1M(G,I):1L)}e 4.1h(8(){c K=C.U(4,D);5(H&&K&&C.39(K[J])){K[J].1M(K,I)}1A{5(!H){C.U(4,D,3K C[F][D](4,J))}}})};C[F][D]=8(H,I){c G=4;4.1m=D;4.3t=F+"-"+D;4.a=C.1S({},C.1C.1H,C[F][D].1H,I);4.j=C(H).1x("1R."+D,8(L,J,K){e G.1R(J,K)}).1x("2G."+D,8(K,J){e G.2G(J)}).1x("1u",8(){e G.2u()});4.2m()};C[F][D].1K=C.1S({},C.1C.1K,E)};C.1C.1K={2m:8(){},2u:8(){4.j.3l(4.1m)},2G:8(D){e 4.a[D]},1R:8(D,E){4.a[D]=E;5(D=="1j"){4.j[E?"1V":"2s"](4.3t+"-1j")}},3U:8(){4.1R("1j",p)},3Z:8(){4.1R("1j",q)}};C.1C.1H={1j:p};C.h.2k={3b:8(){c D=4;4.j.1x("3x."+4.1m,8(E){e D.3f(E)});5(C.2h.2o){4.3i=4.j.1N("1Q");4.j.1N("1Q","3p")}4.3A=p},3r:8(){4.j.2b("."+4.1m);(C.2h.2o&&4.j.1N("1Q",4.3i))},3f:8(F){(4.1e&&4.1Y(F));4.27=F;c D=4,G=(F.3V==1),E=(2j 4.a.2e=="2D"?C(F.1T).38().13(F.1T).3B(4.a.2e).1F:p);5(!G||E||!4.2M(F)){e q}4.23=!4.a.2g;5(!4.23){4.3J=3X(8(){D.23=q},4.a.2g)}5(4.2z(F)&&4.2y(F)){4.1e=(4.1U(F)!==p);5(!4.1e){F.3N();e q}}4.2C=8(H){e D.3u(H)};4.2n=8(H){e D.1Y(H)};C(i).1x("36."+4.1m,4.2C).1x("3h."+4.1m,4.2n);e p},3u:8(D){5(C.2h.2o&&!D.3O){e 4.1Y(D)}5(4.1e){4.1y(D);e p}5(4.2z(D)&&4.2y(D)){4.1e=(4.1U(4.27,D)!==p);(4.1e?4.1y(D):4.1Y(D))}e!4.1e},1Y:8(D){C(i).2b("36."+4.1m,4.2C).2b("3h."+4.1m,4.2n);5(4.1e){4.1e=p;4.1I(D)}e p},2z:8(D){e(S.2l(S.1b(4.27.1k-D.1k),S.1b(4.27.1i-D.1i))>=4.a.2p)},2y:8(D){e 4.23},1U:8(D){},1y:8(D){},1I:8(D){},2M:8(D){e q}};C.h.2k.1H={2e:3n,2p:1,2g:0}})(31);(8(A){A.1C("h.l",A.1S({},A.h.2k,{2m:8(){c B=4.a;5(B.g=="2q"&&!(/(o|Z|17)/).X(4.j.d("n"))){4.j.d("n","o")}4.j.1V("h-l");(B.1j&&4.j.1V("h-l-1j"));4.3b()},1U:8(F){c H=4.a;5(4.g||H.1j||A(F.1T).4h(".h-4q-26")){e p}c B=!4.a.26||!A(4.a.26,4.j).1F?q:p;A(4.a.26,4.j).4r("*").4s().1h(8(){5(4==F.1T){B=q}});5(!B){e p}5(A.h.1n){A.h.1n.4p=4}4.g=A.39(H.g)?A(H.g.1M(4.j[0],[F])):(H.g=="2O"?4.j.2O():4.j);5(!4.g.38("11").1F){4.g.1v((H.1v=="m"?4.j[0].1D:H.1v))}5(4.g[0]!=4.j[0]&&!(/(17|Z)/).X(4.g.d("n"))){4.g.d("n","Z")}4.Y={7:(r(4.j.d("4o"),10)||0),6:(r(4.j.d("4l"),10)||0)};4.W=4.g.d("n");4.b=4.j.b();4.b={6:4.b.6-4.Y.6,7:4.b.7-4.Y.7};4.b.z={7:F.1k-4.b.7,6:F.1i-4.b.6};4.t=4.g.t();c C=4.t.b();5(4.t[0]==i.11&&A.2h.4m){C={6:0,7:0}}4.b.m={6:C.6+(r(4.t.d("2i"),10)||0),7:C.7+(r(4.t.d("2x"),10)||0)};c E=4.j.n();4.b.o=4.W=="o"?{6:E.6-(r(4.g.d("6"),10)||0)+4.t[0].v,7:E.7-(r(4.g.d("7"),10)||0)+4.t[0].u}:{6:0,7:0};4.1s=4.2B(F);4.V={T:4.g.2P(),w:4.g.2E()};5(H.1g){5(H.1g.7!=1L){4.b.z.7=H.1g.7+4.Y.7}5(H.1g.3g!=1L){4.b.z.7=4.V.T-H.1g.3g+4.Y.7}5(H.1g.6!=1L){4.b.z.6=H.1g.6+4.Y.6}5(H.1g.37!=1L){4.b.z.6=4.V.w-H.1g.37+4.Y.6}}5(H.k){5(H.k=="m"){H.k=4.g[0].1D}5(H.k=="i"||H.k=="1B"){4.k=[0-4.b.o.7-4.b.m.7,0-4.b.o.6-4.b.m.6,A(H.k=="i"?i:1B).T()-4.b.o.7-4.b.m.7-4.V.T-4.Y.7-(r(4.j.d("2X"),10)||0),(A(H.k=="i"?i:1B).w()||i.11.1D.2W)-4.b.o.6-4.b.m.6-4.V.w-4.Y.6-(r(4.j.d("2Z"),10)||0)]}5(!(/^(i|1B|m)$/).X(H.k)){c D=A(H.k)[0];c G=A(H.k).b();4.k=[G.7+(r(A(D).d("2x"),10)||0)-4.b.o.7-4.b.m.7,G.6+(r(A(D).d("2i"),10)||0)-4.b.o.6-4.b.m.6,G.7+S.2l(D.4n,D.2U)-(r(A(D).d("2x"),10)||0)-4.b.o.7-4.b.m.7-4.V.T-4.Y.7-(r(4.j.d("2X"),10)||0),G.6+S.2l(D.2W,D.2S)-(r(A(D).d("2i"),10)||0)-4.b.o.6-4.b.m.6-4.V.w-4.Y.6-(r(4.j.d("2Z"),10)||0)]}}4.1d("1f",F);4.V={T:4.g.2P(),w:4.g.2E()};5(A.h.1n&&!H.32){A.h.1n.4u(4,F)}4.g.1V("h-l-3o");4.1y(F);e q},12:8(C,D){5(!D){D=4.n}c B=C=="Z"?1:-1;e{6:(D.6+4.b.o.6*B+4.b.m.6*B-(4.W=="17"||(4.W=="Z"&&4.t[0]==i.11)?0:4.t[0].v)*B+(4.W=="17"?A(i).v():0)*B+4.Y.6*B),7:(D.7+4.b.o.7*B+4.b.m.7*B-(4.W=="17"||(4.W=="Z"&&4.t[0]==i.11)?0:4.t[0].u)*B+(4.W=="17"?A(i).u():0)*B+4.Y.7*B)}},2B:8(E){c F=4.a;c B={6:(E.1i-4.b.z.6-4.b.o.6-4.b.m.6+(4.W=="17"||(4.W=="Z"&&4.t[0]==i.11)?0:4.t[0].v)-(4.W=="17"?A(i).v():0)),7:(E.1k-4.b.z.7-4.b.o.7-4.b.m.7+(4.W=="17"||(4.W=="Z"&&4.t[0]==i.11)?0:4.t[0].u)-(4.W=="17"?A(i).u():0))};5(!4.1s){e B}5(4.k){5(B.7<4.k[0]){B.7=4.k[0]}5(B.6<4.k[1]){B.6=4.k[1]}5(B.7>4.k[2]){B.7=4.k[2]}5(B.6>4.k[3]){B.6=4.k[3]}}5(F.1c){c D=4.1s.6+S.3j((B.6-4.1s.6)/F.1c[1])*F.1c[1];B.6=4.k?(!(D<4.k[1]||D>4.k[3])?D:(!(D<4.k[1])?D-F.1c[1]:D+F.1c[1])):D;c C=4.1s.7+S.3j((B.7-4.1s.7)/F.1c[0])*F.1c[0];B.7=4.k?(!(C<4.k[0]||C>4.k[2])?C:(!(C<4.k[0])?C-F.1c[0]:C+F.1c[0])):C}e B},1y:8(B){4.n=4.2B(B);4.1t=4.12("Z");4.n=4.1d("1l",B)||4.n;5(!4.a.1O||4.a.1O!="y"){4.g[0].1P.7=4.n.7+"21"}5(!4.a.1O||4.a.1O!="x"){4.g[0].1P.6=4.n.6+"21"}5(A.h.1n){A.h.1n.1l(4,B)}e p},1I:8(C){c D=p;5(A.h.1n&&!4.a.32){c D=A.h.1n.4B(4,C)}5((4.a.1w=="4z"&&!D)||(4.a.1w=="4y"&&D)||4.a.1w===q){c B=4;A(4.g).4v(4.1s,r(4.a.1w,10)||4w,8(){B.1d("1p",C);B.2r()})}1A{4.1d("1p",C);4.2r()}e p},2r:8(){4.g.2s("h-l-3o");5(4.a.g!="2q"&&!4.1X){4.g.1u()}4.g=3n;4.1X=p},1W:{},2t:8(B){e{g:4.g,n:4.n,2I:4.1t,a:4.a}},1d:8(C,B){A.h.19.2f(4,C,[B,4.2t()]);5(C=="1l"){4.1t=4.12("Z")}e 4.j.2J(C=="1l"?C:"1l"+C,[B,4.2t()],4.a[C])},2u:8(){5(!4.j.U("l")){e}4.j.3l("l").2b(".l").2s("h-l");4.3r()}}));A.1S(A.h.l,{1H:{1v:"m",1O:p,2e:":4x",2g:0,2p:1,g:"2q"}});A.h.19.13("l","1q",{1f:8(D,C){c B=A("11");5(B.d("1q")){C.a.2v=B.d("1q")}B.d("1q",C.a.1q)},1p:8(C,B){5(B.a.2v){A("11").d("1q",B.a.2v)}}});A.h.19.13("l","14",{1f:8(D,C){c B=A(C.g);5(B.d("14")){C.a.2w=B.d("14")}B.d("14",C.a.14)},1p:8(C,B){5(B.a.2w){A(B.g).d("14",B.a.2w)}}});A.h.19.13("l","1o",{1f:8(D,C){c B=A(C.g);5(B.d("1o")){C.a.2A=B.d("1o")}B.d("1o",C.a.1o)},1p:8(C,B){5(B.a.2A){A(B.g).d("1o",B.a.2A)}}});A.h.19.13("l","22",{1f:8(C,B){A(B.a.22===q?"4t":B.a.22).1h(8(){A(\'<2c 33="h-l-22" 1P="4k: #46;"></2c>\').d({T:4.2U+"21",w:4.2S+"21",n:"Z",1o:"0.40",14:47}).d(A(4).b()).1v("11")})},1p:8(C,B){A("2c.48").1h(8(){4.1D.3e(4)})}});A.h.19.13("l","1J",{1f:8(D,C){c E=C.a;c B=A(4).U("l");E.18=E.18||20;E.1a=E.1a||20;B.16=8(F){2Y{5(/1G|1J/.X(F.d("29"))||(/1G|1J/).X(F.d("29-y"))){e F}F=F.m()}3q(F[0].1D);e A(i)}(4);B.15=8(F){2Y{5(/1G|1J/.X(F.d("29"))||(/1G|1J/).X(F.d("29-x"))){e F}F=F.m()}3q(F[0].1D);e A(i)}(4);5(B.16[0]!=i&&B.16[0].25!="24"){B.2R=B.16.b()}5(B.15[0]!=i&&B.15[0].25!="24"){B.2T=B.15.b()}},1l:8(D,C){c E=C.a;c B=A(4).U("l");5(B.16[0]!=i&&B.16[0].25!="24"){5((B.2R.6+B.16[0].2S)-D.1i<E.18){B.16[0].v=B.16[0].v+E.1a}5(D.1i-B.2R.6<E.18){B.16[0].v=B.16[0].v-E.1a}}1A{5(D.1i-A(i).v()<E.18){A(i).v(A(i).v()-E.1a)}5(A(1B).w()-(D.1i-A(i).v())<E.18){A(i).v(A(i).v()+E.1a)}}5(B.15[0]!=i&&B.15[0].25!="24"){5((B.2T.7+B.15[0].2U)-D.1k<E.18){B.15[0].u=B.15[0].u+E.1a}5(D.1k-B.2T.7<E.18){B.15[0].u=B.15[0].u-E.1a}}1A{5(D.1k-A(i).u()<E.18){A(i).u(A(i).u()-E.1a)}5(A(1B).T()-(D.1k-A(i).u())<E.18){A(i).u(A(i).u()+E.1a)}}}});A.h.19.13("l","2V",{1f:8(D,C){c B=A(4).U("l");B.1r=[];A(C.a.2V===q?".h-l":C.a.2V).1h(8(){c F=A(4);c E=F.b();5(4!=B.j[0]){B.1r.2F({34:4,T:F.2P(),w:F.2E(),6:E.6,7:E.7})}})},1l:8(J,O){c I=A(4).U("l");c L=O.a.41||20;c D=O.2I.7,C=D+I.V.T,P=O.2I.6,N=P+I.V.w;2H(c H=I.1r.1F-1;H>=0;H--){c E=I.1r[H].7,B=E+I.1r[H].T,R=I.1r[H].6,M=R+I.1r[H].w;5(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<N&&N<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<N&&N<M+L))){43}5(O.a.3v!="49"){c K=S.1b(R-N)<=20;c Q=S.1b(M-P)<=20;c G=S.1b(E-C)<=20;c F=S.1b(B-D)<=20;5(K){O.n.6=I.12("o",{6:R-I.V.w,7:0}).6}5(Q){O.n.6=I.12("o",{6:M,7:0}).6}5(G){O.n.7=I.12("o",{6:0,7:E-I.V.T}).7}5(F){O.n.7=I.12("o",{6:0,7:B}).7}}5(O.a.3v!="4a"){c K=S.1b(R-P)<=20;c Q=S.1b(M-N)<=20;c G=S.1b(E-D)<=20;c F=S.1b(B-C)<=20;5(K){O.n.6=I.12("o",{6:R,7:0}).6}5(Q){O.n.6=I.12("o",{6:M-I.V.w,7:0}).6}5(G){O.n.7=I.12("o",{6:0,7:E}).7}5(F){O.n.7=I.12("o",{6:0,7:B-I.V.T}).7}}}}});A.h.19.13("l","3m",{1f:8(D,C){c B=A(4).U("l");B.2d=[];A(C.a.3m).1h(8(){5(A.U(4,"2N")){c E=A.U(4,"2N");B.2d.2F({f:E,3s:E.a.1w});E.4c();E.1d("4d",D,B)}})},1p:8(D,C){c B=A(4).U("l");A.1h(B.2d,8(){5(4.f.1z){4.f.1z=0;B.1X=q;4.f.1X=p;5(4.3s){4.f.a.1w=q}4.f.1I(D);4.f.j.2J("4j",[D,A.1S(4.f.h(),{4i:B.j})],4.f.a.4g);4.f.a.g=4.f.a.2L}1A{4.f.1d("42",D,B)}})},1l:8(F,E){c D=A(4).U("l"),B=4;c C=8(K){c H=K.7,J=H+K.T,I=K.6,G=I+K.w;e(H<(4.1t.7+4.b.z.7)&&(4.1t.7+4.b.z.7)<J&&I<(4.1t.6+4.b.z.6)&&(4.1t.6+4.b.z.6)<G)};A.1h(D.2d,8(G){5(C.2f(D,4.f.4A)){5(!4.f.1z){4.f.1z=1;4.f.2a=A(B).2O().1v(4.f.j).U("2N-34",q);4.f.a.2L=4.f.a.g;4.f.a.g=8(){e E.g[0]};F.1T=4.f.2a[0];4.f.2M(F,q);4.f.1U(F,q,q);4.f.b.z.6=D.b.z.6;4.f.b.z.7=D.b.z.7;4.f.b.m.7-=D.b.m.7-4.f.b.m.7;4.f.b.m.6-=D.b.m.6-4.f.b.m.6;D.1d("45",F)}5(4.f.2a){4.f.1y(F)}}1A{5(4.f.1z){4.f.1z=0;4.f.1X=q;4.f.a.1w=p;4.f.1I(F,q);4.f.a.g=4.f.a.2L;4.f.2a.1u();5(4.f.3d){4.f.3d.1u()}D.1d("44",F)}}})}});A.h.19.13("l","1E",{1f:8(D,B){c C=A.4b(A(B.a.1E.4e)).4f(8(F,E){e(r(A(F).d("14"),10)||B.a.1E.28)-(r(A(E).d("14"),10)||B.a.1E.28)});A(C).1h(8(E){4.1P.14=B.a.1E.28+E});4[0].1P.14=B.a.1E.28+C.1F}})})(31);',62,286,'||||this|if|top|left|function||options|offset|var|css|return|instance|helper|ui|document|element|containment|draggable|parent|position|relative|false|true|parseInt||offsetParent|scrollLeft|scrollTop|height|||click|||||||||||||||||||Math|width|data|helperProportions|cssPosition|test|margins|absolute||body|convertPositionTo|add|zIndex|overflowX|overflowY|fixed|scrollSensitivity|plugin|scrollSpeed|abs|grid|propagate|_mouseStarted|start|cursorAt|each|pageY|disabled|pageX|drag|widgetName|ddmanager|opacity|stop|cursor|snapElements|originalPosition|positionAbs|remove|appendTo|revert|bind|mouseDrag|isOver|else|window|widget|parentNode|stack|length|auto|defaults|mouseStop|scroll|prototype|undefined|apply|attr|axis|style|unselectable|setData|extend|target|mouseStart|addClass|plugins|cancelHelperRemoval|mouseUp|cssCache||px|iframeFix|_mouseDelayMet|HTML|tagName|handle|_mouseDownEvent|min|overflow|currentItem|unbind|div|sortables|cancel|call|delay|browser|borderTopWidth|typeof|mouse|max|init|_mouseUpDelegate|msie|distance|original|clear|removeClass|uiHash|destroy|_cursor|_zIndex|borderLeftWidth|mouseDelayMet|mouseDistanceMet|_opacity|generatePosition|_mouseMoveDelegate|string|outerHeight|push|getData|for|absolutePosition|triggerHandler|split|_helper|mouseCapture|sortable|clone|outerWidth|fn|overflowYOffset|offsetHeight|overflowXOffset|offsetWidth|snap|scrollHeight|marginRight|do|marginBottom|MozUserSelect|jQuery|dropBehaviour|class|item|none|mousemove|bottom|parents|isFunction|5000px|mouseInit|get|placeholder|removeChild|mouseDown|right|mouseup|_mouseUnselectable|round|arguments|removeData|connectToSortable|null|dragging|on|while|mouseDestroy|shouldRevert|widgetBaseClass|mouseMove|snapMode|try|mousedown|backgroundColor|rgba|started|filter|gen|in|display|block|transparent|backgroundImage|default|_mouseDelayTimer|new|hasScroll|Array|preventDefault|button|inArray|getter|off|enableSelection|catch|enable|which|slice|setTimeout|disableSelection|disable|001|snapTolerance|deactivate|continue|fromSortable|toSortable|fff|1000|DragDropIframeFix|inner|outer|makeArray|refreshItems|activate|group|sort|receive|is|sender|sortreceive|background|marginTop|mozilla|scrollWidth|marginLeft|current|resizable|find|andSelf|iframe|prepareOffsets|animate|500|input|valid|invalid|containerCache|drop'.split('|'),0,{}));


//カスタムアラート en

//ポップアップ st

/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 2.5.2
------------------------------------------------------------------------- */

(function($) {
	$.prettyPhoto = {version: '2.5'};
	
	$.fn.prettyPhoto = function(settings) {
		settings = jQuery.extend({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.80, /* Value between 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
			callback: function(){}
		}, settings);
		
		// Fallback to a supported theme for IE6
		if($.browser.msie && $.browser.version == 6){
			settings.theme = "light_square";
		}
		
		if($('.pp_overlay').size() == 0) {
			_buildOverlay(); // If the overlay is not there, inject it!
		}else{
			// Set my global selectors
			$pp_pic_holder = $('.pp_pic_holder');
			$ppt = $('.ppt');
		}
		
		// Global variables accessible only by prettyPhoto
		var doresize = true, percentBased = false, correctSizes,
		
		// Cached selectors
		$pp_pic_holder, $ppt, settings,
		
		// prettyPhoto container specific
		pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, pp_type = 'image',
	
		//Gallery specific
		setPosition = 0,

		// Global elements
		$scrollPos = _getScroll();
	
		// Window/Keyboard events
		$(window).scroll(function(){ $scrollPos = _getScroll(); _centerOverlay(); });
		$(window).resize(function(){ _centerOverlay(); _resizeOverlay(); });
		$(document).keydown(function(e){
			switch(e.keyCode){
				case 37:
					$.prettyPhoto.changePage('previous');
					break;
				case 39:
					$.prettyPhoto.changePage('next');
					break;
				case 27:
					$.prettyPhoto.close();
					break;
			};
	    });
	
		// Bind the code to each links
		$(this).each(function(){
			$(this).bind('click',function(){
				
				link = this; // Fix scoping
				
				// Find out if the picture is part of a set
				theRel = $(this).attr('rel');
				galleryRegExp = /\[(?:.*)\]/;
				theGallery = galleryRegExp.exec(theRel);
				
				// Build the gallery array
				var images = new Array(), titles = new Array(), descriptions = new Array();
				if(theGallery){
					$('a[rel*='+theGallery+']').each(function(i){
						if($(this)[0] === $(link)[0]) setPosition = i; // Get the position in the set
						images.push($(this).attr('alt'));
						titles.push($(this).find('img').attr('alt'));
						descriptions.push($(this).attr('title'));
					});
				}else{
					images = $(this).attr('alt');
					titles = ($(this).find('img').attr('alt')) ?  $(this).find('img').attr('alt') : '';
					descriptions = ($(this).attr('title')) ?  $(this).attr('title') : '';
				}

				$.prettyPhoto.open(images,titles,descriptions);
				return false;
			});
		});
	
		
		/**
		* Opens the prettyPhoto modal box.
		* @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
		* @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
		* @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
		*/
		$.prettyPhoto.open = function(gallery_images,gallery_titles,gallery_descriptions) {
			// To fix the bug with IE select boxes
			if($.browser.msie && $.browser.version == 6){
				$('select').css('visibility','hidden');
			};
			
			// Hide the flash
			$('object,embed').css('visibility','hidden');
			
			// Convert everything to an array in the case it's a single item
			images = $.makeArray(gallery_images);
			titles = $.makeArray(gallery_titles);
			descriptions = $.makeArray(gallery_descriptions);
			
			if($('.pp_overlay').size() == 0) {
				_buildOverlay(); // If the overlay is not there, inject it!
			}else{
				// Set my global selectors
				$pp_pic_holder = $('.pp_pic_holder');
				$ppt = $('.ppt');
			}
			
			$pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme

			isSet = ($(images).size() > 0) ?  true : false; // Find out if it's a set

			_getFileType(images[setPosition]); // Set the proper file type

			_centerOverlay(); // Center it

			// Hide the next/previous links if on first or last images.
			_checkPosition($(images).size());
		
			$('.pp_loaderIcon').show(); // Do I need to explain?
		
			// Fade the content in
			$('div.pp_overlay').show().fadeTo(settings.animationSpeed,settings.opacity, function(){
				$pp_pic_holder.fadeIn(settings.animationSpeed,function(){
					// Display the current position
					$pp_pic_holder.find('p.currentTextHolder').text((setPosition+1) + settings.counter_separator_label + $(images).size());

					// Set the description
					if(descriptions[setPosition]){
						$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));
					}else{
						$pp_pic_holder.find('.pp_description').hide().text('');
					};

					// Set the title
					if(titles[setPosition] && settings.showTitle){
						hasTitle = true;
						$ppt.html(unescape(titles[setPosition]));
					}else{
						hasTitle = false;
					};
					
					// Inject the proper content
					if(pp_type == 'image'){
						// Set the new image
						imgPreloader = new Image();

						// Preload the neighbour images
						nextImage = new Image();
						if(isSet && setPosition > $(images).size()) nextImage.src = images[setPosition + 1];
						prevImage = new Image();
						if(isSet && images[setPosition - 1]) prevImage.src = images[setPosition - 1];

						pp_typeMarkup = '<img id="fullResImage" src="" />';				
						$pp_pic_holder.find('#pp_full_res')[0].innerHTML = pp_typeMarkup;

						$pp_pic_holder.find('.pp_content').css('overflow','hidden');
						$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);

						imgPreloader.onload = function(){
							// Fit item to viewport
							correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);
							
							_showContent();
						};

						imgPreloader.src = images[setPosition];
					}else{
						// Get the dimensions
						movie_width = ( parseFloat(grab_param('width',images[setPosition])) ) ? grab_param('width',images[setPosition]) : "425";
						movie_height = ( parseFloat(grab_param('height',images[setPosition])) ) ? grab_param('height',images[setPosition]) : "344";

						// If the size is % based, calculate according to window dimensions
						if(movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1){
							movie_height = ($(window).height() * parseFloat(movie_height) / 100) - 100;
							movie_width = ($(window).width() * parseFloat(movie_width) / 100) - 100;
							percentBased = true;
						}

						movie_height = parseFloat(movie_height);
						movie_width = parseFloat(movie_width);

						if(pp_type == 'quicktime') movie_height+=13; // Add space for the control bar

						// Fit item to viewport
						correctSizes = _fitToViewport(movie_width,movie_height);

						if(pp_type == 'youtube'){
							pp_typeMarkup = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" /><embed src="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';
						}else if(pp_type == 'quicktime'){
							pp_typeMarkup = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'"><param name="src" value="'+images[setPosition]+'"><param name="autoplay" value="true"><param name="type" value="video/quicktime"><embed src="'+images[setPosition]+'" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
						}else if(pp_type == 'flash'){
							flash_vars = images[setPosition];
							flash_vars = flash_vars.substring(images[setPosition].indexOf('flashvars') + 10,images[setPosition].length);

							filename = images[setPosition];
							filename = filename.substring(0,filename.indexOf('?'));

							pp_typeMarkup = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+filename+'?'+flash_vars+'" /><embed src="'+filename+'?'+flash_vars+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';
						}else if(pp_type == 'iframe'){
							movie_url = images[setPosition];
							movie_url = movie_url.substr(0,movie_url.indexOf('iframe')-1);

							pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>';
						}

						// Show content
						_showContent();
					}
				});
			});
		};
		
		/**
		* Change page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changePage = function(direction){
			if(direction == 'previous') {
				setPosition--;
				if (setPosition < 0){
					setPosition = 0;
					return;
				}
			}else{
				if($('.pp_arrow_next').is('.disabled')) return;
				setPosition++;
			};

			// Allow the resizing of the images
			if(!doresize) doresize = true;

			_hideContent();
			$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed,function(){
				$(this).removeClass('pp_contract').addClass('pp_expand');
				$.prettyPhoto.open(images,titles,descriptions);
			});
		};
		
		/**
		* Closes the prettyPhoto modal box.
		*/
		$.prettyPhoto.close = function(){
			$pp_pic_holder.find('object,embed').css('visibility','hidden');
			
			$('div.pp_pic_holder,div.ppt').fadeOut(settings.animationSpeed);
			
			$('div.pp_overlay').fadeOut(settings.animationSpeed, function(){
				$('div.pp_overlay,div.pp_pic_holder,div.ppt').remove();
			
				// To fix the bug with IE select boxes
				if($.browser.msie && $.browser.version == 6){
					$('select').css('visibility','visible');
				};
				
				// Show the flash
				$('object,embed').css('visibility','visible');
				
				setPosition = 0;
				
				settings.callback();
			});
			
			doresize = true;
		};
	
		/**
		* Set the proper sizes on the containers and animate the content in.
		*/
		_showContent = function(){
			$('.pp_loaderIcon').hide();

			if($.browser.opera) {
				windowHeight = window.innerHeight;
				windowWidth = window.innerWidth;
			}else{
				windowHeight = $(window).height();
				windowWidth = $(window).width();
			};

			// Calculate the opened top position of the pic holder
			projectedTop = $scrollPos['scrollTop'] + ((windowHeight/2) - (correctSizes['containerHeight']/2));
			if(projectedTop < 0) projectedTop = 0 + $pp_pic_holder.find('.ppt').height();

			// Resize the content holder
			$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);
			
			// Resize picture the holder
			$pp_pic_holder.animate({
				'top': projectedTop,
				'left': ((windowWidth/2) - (correctSizes['containerWidth']/2)),
				'width': correctSizes['containerWidth']
			},settings.animationSpeed,function(){
				$pp_pic_holder.width(correctSizes['containerWidth']);
				$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);

				// Fade the new image
				$pp_pic_holder.find('#pp_full_res').fadeIn(settings.animationSpeed);

				// Show the nav
				if(isSet && pp_type=="image") { $pp_pic_holder.find('.pp_hoverContainer').fadeIn(settings.animationSpeed); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
				$pp_pic_holder.find('.pp_details').fadeIn(settings.animationSpeed);

				// Show the title
				if(settings.showTitle && hasTitle){
					$ppt.css({
						'top' : $pp_pic_holder.offset().top - 20,
						'left' : $pp_pic_holder.offset().left + (settings.padding/2),
						'display' : 'none'
					});

					$ppt.fadeIn(settings.animationSpeed);
				};
			
				// Fade the resizing link if the image is resized
				if(correctSizes['resized']) $('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);
				
				// Once everything is done, inject the content if it's now a photo
				if(pp_type != 'image') $pp_pic_holder.find('#pp_full_res')[0].innerHTML = pp_typeMarkup;
			});
		};
		
		/**
		* Hide the content...DUH!
		*/
		function _hideContent(){
			// Fade out the current picture
			$pp_pic_holder.find('.pp_hoverContainer,.pp_details').fadeOut(settings.animationSpeed);
			$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
			$pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){
				$('.pp_loaderIcon').show();
			});
			
			// Hide the title
			$ppt.fadeOut(settings.animationSpeed);
		}
	
		/**
		* Check the item position in the gallery array, hide or show the navigation links
		* @param setCount {integer} The total number of items in the set
		*/
		function _checkPosition(setCount){
			// If at the end, hide the next link
			if(setPosition == setCount-1) {
				$pp_pic_holder.find('a.pp_next').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');
			}else{ 
				$pp_pic_holder.find('a.pp_next').css('visibility','visible');
				$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('next');
					return false;
				});
			};
		
			// If at the beginning, hide the previous link
			if(setPosition == 0) {
				$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');
			}else{
				$pp_pic_holder.find('a.pp_previous').css('visibility','visible');
				$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('previous');
					return false;
				});
			};
			
			// Hide the bottom nav if it's not a set.
			if(setCount > 1) {
				$('.pp_nav').show();
			}else{
				$('.pp_nav').hide();
			}
		};
	
		/**
		* Resize the item dimensions if it's bigger than the viewport
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		* @return An array containin the "fitted" dimensions
		*/
		function _fitToViewport(width,height){
			hasBeenResized = false;
		
			_getDimensions(width,height);
			
			// Define them in case there's no resize needed
			imageWidth = width;
			imageHeight = height;

			windowHeight = $(window).height();
			windowWidth = $(window).width();
		
			if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allowresize && !percentBased) {
				hasBeenResized = true;
				notFitting = true;
			
				while (notFitting){
					if((pp_containerWidth > windowWidth)){
						imageWidth = (windowWidth - 200);
						imageHeight = (height/width) * imageWidth;
					}else if((pp_containerHeight > windowHeight)){
						imageHeight = (windowHeight - 200);
						imageWidth = (width/height) * imageHeight;
					}else{
						notFitting = false;
					};

					pp_containerHeight = imageHeight;
					pp_containerWidth = imageWidth;
				};
			
				_getDimensions(imageWidth,imageHeight);
			};

			return {
				width:imageWidth,
				height:imageHeight,
				containerHeight:pp_containerHeight,
				containerWidth:pp_containerWidth,
				contentHeight:pp_contentHeight,
				contentWidth:pp_contentWidth,
				resized:hasBeenResized
			};
		};
		
		/**
		* Get the containers dimensions according to the item size
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		*/
		function _getDimensions(width,height){
			$pp_pic_holder.find('.pp_details').width(width).find('.pp_description').width(width - parseFloat($pp_pic_holder.find('a.pp_close').css('width'))); /* To have the correct height */
			
			// Get the container size, to resize the holder to the right dimensions
			pp_contentHeight = height + $pp_pic_holder.find('.pp_details').height() + parseFloat($pp_pic_holder.find('.pp_details').css('marginTop')) + parseFloat($pp_pic_holder.find('.pp_details').css('marginBottom'));
			pp_contentWidth = width;
			pp_containerHeight = pp_contentHeight + $pp_pic_holder.find('.ppt').height() + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
			pp_containerWidth = width + settings.padding;
		}
	
		function _getFileType(itemSrc){
			if (itemSrc.match(/youtube\.com\/watch/i)) {
				pp_type = 'youtube';
			}else if(itemSrc.indexOf('.mov') != -1){ 
				pp_type = 'quicktime';
			}else if(itemSrc.indexOf('.swf') != -1){
				pp_type = 'flash';
			}else if(itemSrc.indexOf('iframe') != -1){
				pp_type = 'iframe'
			}else{
				pp_type = 'image';
			};
		};
	
		function _centerOverlay(){
			if($.browser.opera) {
				windowHeight = window.innerHeight;
				windowWidth = window.innerWidth;
			}else{
				windowHeight = $(window).height();
				windowWidth = $(window).width();
			};

			if(doresize) {
				$pHeight = $pp_pic_holder.height();
				$pWidth = $pp_pic_holder.width();
				$tHeight = $ppt.height();
				
				projectedTop = (windowHeight/2) + $scrollPos['scrollTop'] - ($pHeight/2);
				if(projectedTop < 0) projectedTop = 0 + $tHeight;
				
				$pp_pic_holder.css({
					'top': projectedTop,
					'left': (windowWidth/2) + $scrollPos['scrollLeft'] - ($pWidth/2)
				});
		
				$ppt.css({
					'top' : projectedTop - $tHeight,
					'left' : (windowWidth/2) + $scrollPos['scrollLeft'] - ($pWidth/2) + (settings.padding/2)
				});
			};
		};

	
		function _getScroll(){
			if (self.pageYOffset) {
				scrollTop = self.pageYOffset;
				scrollLeft = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
				scrollTop = document.documentElement.scrollTop;
				scrollLeft = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				scrollTop = document.body.scrollTop;
				scrollLeft = document.body.scrollLeft;	
			}
			
			return {scrollTop:scrollTop,scrollLeft:scrollLeft};
		};
	
		function _resizeOverlay() {
			$('div.pp_overlay').css({
				'height':$(document).height(),
				'width':$(window).width()
			});
		};
	
		function _buildOverlay(){
			toInject = "";
			
			// Build the background overlay div
			toInject += "<div class='pp_overlay'></div>";
			
			// Basic HTML for the picture holder
			toInject += '<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';
			
			// Basic html for the title holder
			toInject += '<div class="ppt"></div>';
			
			$('body').append(toInject);
			
			// So it fades nicely
			$('div.pp_overlay').css('opacity',0);
			
			// Set my global selectors
			$pp_pic_holder = $('.pp_pic_holder');
			$ppt = $('.ppt');
			
			$('div.pp_overlay').css('height',$(document).height()).hide().bind('click',function(){
				$.prettyPhoto.close();
			});

			$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });

			$('a.pp_expand').bind('click',function(){				
				$this = $(this);
				
				// Expand the image
				if($this.hasClass('pp_expand')){
					$this.removeClass('pp_expand').addClass('pp_contract');
					doresize = false;
				}else{
					$this.removeClass('pp_contract').addClass('pp_expand');
					doresize = true;
				};
			
				_hideContent();
				
				$pp_pic_holder.find('.pp_hoverContainer, #pp_full_res, .pp_details').fadeOut(settings.animationSpeed,function(){
					$.prettyPhoto.open(images,titles,descriptions);
				});
		
				return false;	
			});
		
			$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){
				$.prettyPhoto.changePage('previous');
				return false;
			});
		
			$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){
				$.prettyPhoto.changePage('next');
				return false;
			});

			$pp_pic_holder.find('.pp_hoverContainer').css({
				'margin-left': settings.padding/2
			});
		};
	};
	
	function grab_param(name,url){
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( url );
	  if( results == null )
	    return "";
	  else
	    return results[1];
	}
})(jQuery);

$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
});

//ポップアップ en



/**
 * PHPの mb_convert_kana() っぽいもの
 * mMオプションで記号 /[!#-&(-/:-@[\]^_{|}]/ を変換
 * PHPにおける a または A オプションは rnm または RNM オプションとほぼ等価
 * (バッククオーテーションを変換しない点がPHPと異なる)
 * PHPとは違い、hc または kC の組み合わせのオプションにおいて、c または C オプションを無視しない
 * PHPと同様に動かしたいときは上記の組み合わせのオプションを指定しない or このスクリプトをテキトーに弄る
 *
 * @param string str
 * @param string option デフォルトは KV
 *    r : 「全角」英字を「半角」に変換
 *    R : 「半角」英字を「全角」に変換
 *    n : 「全角」数字を「半角」に変換
 *    N : 「半角」数字を「全角」に変換
 *    m : 「全角」記号を「半角」に変換
 *    M : 「半角」記号を「全角」に変換
 *    s : 「全角」スペースを「半角」
 *    S : 「半角」スペースを「全角」
 *    k : 「全角カタカナ」を「半角カタカナ」に変換
 *    K : 「半角カタカナ」を「全角カタカナ」に変換
 *    h : 「全角ひらがな」を「半角カタカナ」に変換
 *    H : 「半角カタカナ」を「全角ひらがな」に変換
 *    c : 「全角カタカナ」を「全角ひらがな」に変換
 *    C : 「全角ひらがな」を「全角カタカナ」に変換
 *    V : 濁点付きの文字を一文字に変換。"K", "H" と共に使用
 
 *    o : [2011/8/25追加] ”“’‘｀￥ を ""''`\に変換
 *    O : [2011/8/25追加] "'`\ を ”’｀￥ に変換
 */
var mb_convert_kana = function( str, option )
{
	if( option === '' || option === undefined || option === null )
	{
		// デフォルトのオプション
		option = 'KV';
	}

	// 1文字用の正規表現
	var re = '[';

	// 2文字(濁点との組み合わせ)用の正規表現
	var re_v = '(?:';

	// 変換用の配列
	var list = {};

	// list に配列をマージする
	var m = function( o )
	{
		for( var k in o )
		{
			list[k] = o[k];
		}
	}

	if( option.indexOf('r') !== -1 && str.search(/[ａ-ｚＡ-Ｚ]/) !== -1 )
	{
		m( {'ａ':'a','ｂ':'b','ｃ':'c','ｄ':'d','ｅ':'e','ｆ':'f','ｇ':'g','ｈ':'h','ｉ':'i','ｊ':'j','ｋ':'k','ｌ':'l','ｍ':'m','ｎ':'n','ｏ':'o','ｐ':'p','ｑ':'q','ｒ':'r','ｓ':'s','ｔ':'t','ｕ':'u','ｖ':'v','ｗ':'w','ｘ':'x','ｙ':'y','ｚ':'z','Ａ':'A','Ｂ':'B','Ｃ':'C','Ｄ':'D','Ｅ':'E','Ｆ':'F','Ｇ':'G','Ｈ':'H','Ｉ':'I','Ｊ':'J','Ｋ':'K','Ｌ':'L','Ｍ':'M','Ｎ':'N','Ｏ':'O','Ｐ':'P','Ｑ':'Q','Ｒ':'R','Ｓ':'S','Ｔ':'T','Ｕ':'U','Ｖ':'V','Ｗ':'W','Ｘ':'X','Ｙ':'Y','Ｚ':'Z'} );
		re += 'ａ-ｚＡ-Ｚ';
	}

	if( option.indexOf('R') !== -1 && str.search(/[a-zA-Z]/) !== -1 )
	{
		m( {'a':'ａ','b':'ｂ','c':'ｃ','d':'ｄ','e':'ｅ','f':'ｆ','g':'ｇ','h':'ｈ','i':'ｉ','j':'ｊ','k':'ｋ','l':'ｌ','m':'ｍ','n':'ｎ','o':'ｏ','p':'ｐ','q':'ｑ','r':'ｒ','s':'ｓ','t':'ｔ','u':'ｕ','v':'ｖ','w':'ｗ','x':'ｘ','y':'ｙ','z':'ｚ','A':'Ａ','B':'Ｂ','C':'Ｃ','D':'Ｄ','E':'Ｅ','F':'Ｆ','G':'Ｇ','H':'Ｈ','I':'Ｉ','J':'Ｊ','K':'Ｋ','L':'Ｌ','M':'Ｍ','N':'Ｎ','O':'Ｏ','P':'Ｐ','Q':'Ｑ','R':'Ｒ','S':'Ｓ','T':'Ｔ','U':'Ｕ','V':'Ｖ','W':'Ｗ','X':'Ｘ','Y':'Ｙ','Z':'Ｚ'} );
		re += 'a-zA-Z';
	}

	if( option.indexOf('n') !== -1 && str.search(/[０-９]/) !== -1 )
	{
		m( {'０':'0','１':'1','２':'2','３':'3','４':'4','５':'5','６':'6','７':'7','８':'8','９':'9'} );
		re += '０-９';
	}

	if( option.indexOf('N') !== -1 && str.search(/\d/) !== -1 )
	{
		m( {'0':'０','1':'１','2':'２','3':'３','4':'４','5':'５','6':'６','7':'７','8':'８','9':'９'} );
		re += '\\d';
	}

	if( option.indexOf('s') !== -1 && str.indexOf('　') !== -1 )
	{
		m( {'　':' '} );
		re += '　';
	}

	if( option.indexOf('S') !== -1 && str.indexOf(' ') !== -1 )
	{
		m( {' ':'　'} );
		re += ' ';
	}

	if( option.indexOf('m') !== -1 && str.search(/[！＃＄％＆（）＊＋，－．／：；＜＝＞？＠［］＾＿｛｜｝]/) !== -1 )
	{
		m( {'！':'!','＃':'#','＄':'$','％':'%','＆':'&','（':'(','）':')','＊':'*','＋':'+','，':',','－':'-','．':'.','／':'/','：':':','；':';','＜':'<','＝':'=','＞':'>','？':'?','＠':'@','［':'[','］':']','＾':'^','＿':'_','｛':'{','｜':'|','｝':'}'} );
		re += '！＃＄％＆（）＊＋，－．／：；＜＝＞？＠［］＾＿｛｜｝';
	}

	if( option.indexOf('M') !== -1 && str.search(/[!#-&(-/:-@[\]^_{|}]/) !== -1 )
	{
		m( {'!':'！','#':'＃','$':'＄','%':'％','&':'＆','(':'（',')':'）','*':'＊','+':'＋',',':'，','-':'－','.':'．','/':'／',':':'：',';':'；','<':'＜','=':'＝','>':'＞','?':'？','@':'＠','[':'［',']':'］','^':'＾','_':'＿','{':'｛','|':'｜','}':'｝'} );
		re += '!#-&(-/:-@[\\]^_{|}';
	}

	if( option.indexOf('o') !== -1 && str.search(/[”“’‘｀￥]/) !== -1 )
	{
		m( {'”':'"','“':'"','’':"'",'‘':"'",'｀':'`','￥':'\\'} );
		re += '”“’‘｀￥';
	}

	if( option.indexOf('O') !== -1 && str.search(/["'`\\]/) !== -1 )
	{
		m( {'"':'”',"'":'’','`':'｀','\\':'￥'} );
		re += '"\\\'`\\\\';
	}

	if( option.indexOf('k') !== -1 && str.search(/[、。「」゛゜ァ-ヴ・ー]/) !== -1 )
	{
		m( {
			'ガ':'ｶﾞ','ギ':'ｷﾞ','グ':'ｸﾞ','ゲ':'ｹﾞ','ゴ':'ｺﾞ','ザ':'ｻﾞ','ジ':'ｼﾞ','ズ':'ｽﾞ','ゼ':'ｾﾞ','ゾ':'ｿﾞ','ダ':'ﾀﾞ','ヂ':'ﾁﾞ','ヅ':'ﾂﾞ','デ':'ﾃﾞ','ド':'ﾄﾞ','バ':'ﾊﾞ','パ':'ﾊﾟ','ビ':'ﾋﾞ','ピ':'ﾋﾟ','ブ':'ﾌﾞ','プ':'ﾌﾟ','ベ':'ﾍﾞ','ペ':'ﾍﾟ','ボ':'ﾎﾞ','ポ':'ﾎﾟ','ヴ':'ｳﾞ',
			'。':'｡','「':'｢','」':'｣','、':'､','・':'･','ヲ':'ｦ','ァ':'ｧ','ィ':'ｨ','ゥ':'ｩ','ェ':'ｪ','ォ':'ｫ','ャ':'ｬ','ュ':'ｭ','ョ':'ｮ','ッ':'ｯ','ー':'ｰ','ア':'ｱ','イ':'ｲ','ウ':'ｳ','エ':'ｴ','オ':'ｵ','カ':'ｶ','キ':'ｷ','ク':'ｸ','ケ':'ｹ','コ':'ｺ','サ':'ｻ','シ':'ｼ','ス':'ｽ','セ':'ｾ','ソ':'ｿ','タ':'ﾀ','チ':'ﾁ','ツ':'ﾂ','テ':'ﾃ','ト':'ﾄ','ナ':'ﾅ','ニ':'ﾆ','ヌ':'ﾇ','ネ':'ﾈ','ノ':'ﾉ','ハ':'ﾊ','ヒ':'ﾋ','フ':'ﾌ','ヘ':'ﾍ','ホ':'ﾎ','マ':'ﾏ','ミ':'ﾐ','ム':'ﾑ','メ':'ﾒ','モ':'ﾓ','ヤ':'ﾔ','ユ':'ﾕ','ヨ':'ﾖ','ラ':'ﾗ','リ':'ﾘ','ル':'ﾙ','レ':'ﾚ','ロ':'ﾛ','ワ':'ﾜ','ン':'ﾝ','゜':'ﾟ','゛':'ﾞ','ヮ':'ﾜ','ヰ':'ｲ','ヱ':'ｴ'} );
		re += '、。「」゛゜ァ-ヴ・ー';
	}

	if( option.indexOf('V') !== -1 && str.search(/(?:[ｳｶ-ﾄﾊ-ﾎ]ﾞ|[ﾊ-ﾎ]ﾟ)/) !== -1 && option.indexOf('K') !== -1 )
	{
		m( {'ｶﾞ':'ガ','ｷﾞ':'ギ','ｸﾞ':'グ','ｹﾞ':'ゲ','ｺﾞ':'ゴ','ｻﾞ':'ザ','ｼﾞ':'ジ','ｽﾞ':'ズ','ｾﾞ':'ゼ','ｿﾞ':'ゾ','ﾀﾞ':'ダ','ﾁﾞ':'ヂ','ﾂﾞ':'ヅ','ﾃﾞ':'デ','ﾄﾞ':'ド','ﾊﾞ':'バ','ﾊﾟ':'パ','ﾋﾞ':'ビ','ﾋﾟ':'ピ','ﾌﾞ':'ブ','ﾌﾟ':'プ','ﾍﾞ':'ベ','ﾍﾟ':'ペ','ﾎﾞ':'ボ','ﾎﾟ':'ポ','ｳﾞ':'ヴ'} );
		re_v += '[ｳｶ-ﾄﾊ-ﾎ]ﾞ|[ﾊ-ﾎ]ﾟ|';
	}

	if( option.indexOf('K') !== -1 && str.search(/[｡-ﾟ]/) !== -1 )
	{
		m( {'｡':'。','｢':'「','｣':'」','､':'、','･':'・','ｦ':'ヲ','ｧ':'ァ','ｨ':'ィ','ｩ':'ゥ','ｪ':'ェ','ｫ':'ォ','ｬ':'ャ','ｭ':'ュ','ｮ':'ョ','ｯ':'ッ','ｰ':'ー','ｱ':'ア','ｲ':'イ','ｳ':'ウ','ｴ':'エ','ｵ':'オ','ｶ':'カ','ｷ':'キ','ｸ':'ク','ｹ':'ケ','ｺ':'コ','ｻ':'サ','ｼ':'シ','ｽ':'ス','ｾ':'セ','ｿ':'ソ','ﾀ':'タ','ﾁ':'チ','ﾂ':'ツ','ﾃ':'テ','ﾄ':'ト','ﾅ':'ナ','ﾆ':'ニ','ﾇ':'ヌ','ﾈ':'ネ','ﾉ':'ノ','ﾊ':'ハ','ﾋ':'ヒ','ﾌ':'フ','ﾍ':'ヘ','ﾎ':'ホ','ﾏ':'マ','ﾐ':'ミ','ﾑ':'ム','ﾒ':'メ','ﾓ':'モ','ﾔ':'ヤ','ﾕ':'ユ','ﾖ':'ヨ','ﾗ':'ラ','ﾘ':'リ','ﾙ':'ル','ﾚ':'レ','ﾛ':'ロ','ﾜ':'ワ','ﾝ':'ン','ﾟ':'゜','ﾞ':'゛'} );
		re += '｡-ﾟ';
	}

	if( option.indexOf('h') !== -1 && str.search(/[、。「」゛゜ぁ-ん・ー]/) !== -1 )
	{
		m( {
			'が':'ｶﾞ','ぎ':'ｷﾞ','ぐ':'ｸﾞ','げ':'ｹﾞ','ご':'ｺﾞ','ざ':'ｻﾞ','じ':'ｼﾞ','ず':'ｽﾞ','ぜ':'ｾﾞ','ぞ':'ｿﾞ','だ':'ﾀﾞ','ぢ':'ﾁﾞ','づ':'ﾂﾞ','で':'ﾃﾞ','ど':'ﾄﾞ','ば':'ﾊﾞ','ぱ':'ﾊﾟ','び':'ﾋﾞ','ぴ':'ﾋﾟ','ぶ':'ﾌﾞ','ぷ':'ﾌﾟ','べ':'ﾍﾞ','ぺ':'ﾍﾟ','ぼ':'ﾎﾞ','ぽ':'ﾎﾟ',
			'。':'｡','「':'｢','」':'｣','、':'､','・':'･','を':'ｦ','ぁ':'ｧ','ぃ':'ｨ','ぅ':'ｩ','ぇ':'ｪ','ぉ':'ｫ','ゃ':'ｬ','ゅ':'ｭ','ょ':'ｮ','っ':'ｯ','ー':'ｰ','あ':'ｱ','い':'ｲ','う':'ｳ','え':'ｴ','お':'ｵ','か':'ｶ','き':'ｷ','く':'ｸ','け':'ｹ','こ':'ｺ','さ':'ｻ','し':'ｼ','す':'ｽ','せ':'ｾ','そ':'ｿ','た':'ﾀ','ち':'ﾁ','つ':'ﾂ','て':'ﾃ','と':'ﾄ','な':'ﾅ','に':'ﾆ','ぬ':'ﾇ','ね':'ﾈ','の':'ﾉ','は':'ﾊ','ひ':'ﾋ','ふ':'ﾌ','へ':'ﾍ','ほ':'ﾎ','ま':'ﾏ','み':'ﾐ','む':'ﾑ','め':'ﾒ','も':'ﾓ','や':'ﾔ','ゆ':'ﾕ','よ':'ﾖ','ら':'ﾗ','り':'ﾘ','る':'ﾙ','れ':'ﾚ','ろ':'ﾛ','わ':'ﾜ','ん':'ﾝ','゜':'ﾟ','゛':'ﾞ','ゎ':'ﾜ','ゐ':'ｲ','ゑ':'ｴ'} );
		re += '、。「」゛゜ぁ-ん・ー';
	}

	if( option.indexOf('H') !== -1 && option.indexOf('K') === -1 && option.indexOf('V') !== -1 && str.search(/(?:[ｶ-ﾄﾊ-ﾎ]ﾞ|[ﾊ-ﾎ]ﾟ)/) !== -1 )
	{
		m( {'ｶﾞ':'が','ｷﾞ':'ぎ','ｸﾞ':'ぐ','ｹﾞ':'げ','ｺﾞ':'ご','ｻﾞ':'ざ','ｼﾞ':'じ','ｽﾞ':'ず','ｾﾞ':'ぜ','ｿﾞ':'ぞ','ﾀﾞ':'だ','ﾁﾞ':'ぢ','ﾂﾞ':'づ','ﾃﾞ':'で','ﾄﾞ':'ど','ﾊﾞ':'ば','ﾊﾟ':'ぱ','ﾋﾞ':'び','ﾋﾟ':'ぴ','ﾌﾞ':'ぶ','ﾌﾟ':'ぷ','ﾍﾞ':'べ','ﾍﾟ':'ぺ','ﾎﾞ':'ぼ','ﾎﾟ':'ぽ'} );
		re_v += '[ｶ-ﾄﾊ-ﾎ]ﾞ|[ﾊ-ﾎ]ﾟ|';
	}

	if( option.indexOf('H') !== -1 && option.indexOf('K') === -1 && str.search(/[｡-ﾟ]/) !== -1 )
	{
		m( {'｡':'。','｢':'「','｣':'」','､':'、','･':'・','ｦ':'を','ｧ':'ぁ','ｨ':'ぃ','ｩ':'ぅ','ｪ':'ぇ','ｫ':'ぉ','ｬ':'ゃ','ｭ':'ゅ','ｮ':'ょ','ｯ':'っ','ｰ':'ー','ｱ':'あ','ｲ':'い','ｳ':'う','ｴ':'え','ｵ':'お','ｶ':'か','ｷ':'き','ｸ':'く','ｹ':'け','ｺ':'こ','ｻ':'さ','ｼ':'し','ｽ':'す','ｾ':'せ','ｿ':'そ','ﾀ':'た','ﾁ':'ち','ﾂ':'つ','ﾃ':'て','ﾄ':'と','ﾅ':'な','ﾆ':'に','ﾇ':'ぬ','ﾈ':'ね','ﾉ':'の','ﾊ':'は','ﾋ':'ひ','ﾌ':'ふ','ﾍ':'へ','ﾎ':'ほ','ﾏ':'ま','ﾐ':'み','ﾑ':'む','ﾒ':'め','ﾓ':'も','ﾔ':'や','ﾕ':'ゆ','ﾖ':'よ','ﾗ':'ら','ﾘ':'り','ﾙ':'る','ﾚ':'れ','ﾛ':'ろ','ﾜ':'わ','ﾝ':'ん','ﾟ':'゜','ﾞ':'゛'} );
		re += '｡-ﾟ';
	}

	if( option.indexOf('c') !== -1 && option.indexOf('k') === -1 && str.search(/[ァ-ン]/) !== -1 )
	{
	
		m( {
			'ガ':'が','ギ':'ぎ','グ':'ぐ','ゲ':'げ','ゴ':'ご','ザ':'ざ','ジ':'じ','ズ':'ず','ゼ':'ぜ','ゾ':'ぞ','ダ':'だ','ヂ':'ぢ','ヅ':'づ','デ':'で','ド':'ど','バ':'ば','パ':'ぱ','ビ':'び','ピ':'ぴ','ブ':'ぶ','プ':'ぷ','ベ':'べ','ペ':'ぺ','ボ':'ぼ','ポ':'ぽ',
			'ヲ':'を','ァ':'ぁ','ィ':'ぃ','ゥ':'ぅ','ェ':'ぇ','ォ':'ぉ','ャ':'ゃ','ュ':'ゅ','ョ':'ょ','ッ':'っ','ア':'あ','イ':'い','ウ':'う','エ':'え','オ':'お','カ':'か','キ':'き','ク':'く','ケ':'け','コ':'こ','サ':'さ','シ':'し','ス':'す','セ':'せ','ソ':'そ','タ':'た','チ':'ち','ツ':'つ','テ':'て','ト':'と','ナ':'な','ニ':'に','ヌ':'ぬ','ネ':'ね','ノ':'の','ハ':'は','ヒ':'ひ','フ':'ふ','ヘ':'へ','ホ':'ほ','マ':'ま','ミ':'み','ム':'む','メ':'め','モ':'も','ヤ':'や','ユ':'ゆ','ヨ':'よ','ラ':'ら','リ':'り','ル':'る','レ':'れ','ロ':'ろ','ワ':'わ','ン':'ん','ヮ':'ゎ','ヰ':'ゐ','ヱ':'ゑ'} );
		re += 'ァ-ン';
	}

	if( option.indexOf('C') !== -1 && option.indexOf('h') === -1 && str.search(/[ぁ-ん]/) !== -1 )
	{
	
		m( {
			'が':'ガ','ぎ':'ギ','ぐ':'グ','げ':'ゲ','ご':'ゴ','ざ':'ザ','じ':'ジ','ず':'ズ','ぜ':'ゼ','ぞ':'ゾ','だ':'ダ','ぢ':'ヂ','づ':'ヅ','で':'デ','ど':'ド','ば':'バ','ぱ':'パ','び':'ビ','ぴ':'ピ','ぶ':'ブ','ぷ':'プ','べ':'ベ','ぺ':'ペ','ぼ':'ボ','ぽ':'ポ','を':'ヲ',
			'ぁ':'ァ','ぃ':'ィ','ぅ':'ゥ','ぇ':'ェ','ぉ':'ォ','ゃ':'ャ','ゅ':'ュ','ょ':'ョ','っ':'ッ','あ':'ア','い':'イ','う':'ウ','え':'エ','お':'オ','か':'カ','き':'キ','く':'ク','け':'ケ','こ':'コ','さ':'サ','し':'シ','す':'ス','せ':'セ','そ':'ソ','た':'タ','ち':'チ','つ':'ツ','て':'テ','と':'ト','な':'ナ','に':'ニ','ぬ':'ヌ','ね':'ネ','の':'ノ','は':'ハ','ひ':'ヒ','ふ':'フ','へ':'ヘ','ほ':'ホ','ま':'マ','み':'ミ','む':'ム','め':'メ','も':'モ','や':'ヤ','ゆ':'ユ','よ':'ヨ','ら':'ラ','り':'リ','る':'ル','れ':'レ','ろ':'ロ','わ':'ワ','ん':'ン','ゎ':'ヮ','ゐ':'ヰ','ゑ':'ヱ'} );
		re += 'ぁ-ん';
	}

	if( re === '[' )
	{
		return str;
	}

	re += ']';
	if( re_v === '(?:' )
	{
		re_all = new RegExp( re, 'g' );
	}
	else
	{
		re_v += '))';
		re_v = re_v.replace('|)', '');
		var re_all = '(?:';
		re_all += re_v;
		re_all += '|';
		re_all += re;
		re_all += ')';
		re_all = new RegExp( re_all, 'g' );
	}

	return str.replace( re_all, function(m){
		return list[m];
	} );
};

function trim (str, charlist) {
    // Strips whitespace from the beginning and end of a string  
    // 
    // version: 1109.2015
    // discuss at: http://phpjs.org/functions/trim    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: mdsjack (http://www.mdsjack.bo.it)
    // +   improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
    // +      input by: Erkekjetter
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)    // +      input by: DxGx
    // +   improved by: Steven Levithan (http://blog.stevenlevithan.com)
    // +    tweaked by: Jack
    // +   bugfixed by: Onno Marsman
    // *     example 1: trim('    Kevin van Zonneveld    ');    // *     returns 1: 'Kevin van Zonneveld'
    // *     example 2: trim('Hello World', 'Hdle');
    // *     returns 2: 'o Wor'
    // *     example 3: trim(16, 1);
    // *     returns 3: 6    var whitespace, l = 0,
        i = 0;
    str += '';
 
    if (!charlist) {        // default list
        whitespace = " \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";
    } else {
        // preg_quote custom list
        charlist += '';        whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '$1');
    }
 
    l = str.length;
    for (i = 0; i < l; i++) {        if (whitespace.indexOf(str.charAt(i)) === -1) {
            str = str.substring(i);
            break;
        }
    } 
    l = str.length;
    for (i = l - 1; i >= 0; i--) {
        if (whitespace.indexOf(str.charAt(i)) === -1) {
            str = str.substring(0, i + 1);            break;
        }
    }
 
    return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}
