/* ==================================================

 * gd-1.1.8.js(custom)
 *
 * Copyright (c) Global design, Inc.
 * http://www.glode.co.jp/ 
 * Version: 1.1.8
 * Last Modified: 2009/11/25
 * Library&Plugin: jQuery 1.3.2, jQuery.cookie, jQuery.attrrep

----------------------------------------------------

 * $.gd.Uri
 * $.gd.pageScroll
 
 * yuga.js
 * http://kyosuke.jp/yugajs/
 
 * custom
 
 $.gd.tab();
----------------------------------------------------
 
tabNavList = $(this).find('a[href^=#],area[href^=#]').not('a[href=#],area[href^=#]'),
↓
tabNavList = $(this).find('#tmp_tabmenu_ttl a'),

----------------------------------------------------

tabNavList.filter(':first').trigger('click');
↓
if($("#tmp_tokuban_shoukai").length){
	tabNavList.eq(1).trigger('click');
}else{
	tabNavList.filter(':first').trigger('click');
}
----------------------------------------------------

================================================== */

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/* ==================================================

 * jquery.attrrep.js
 *
 * Copyright (c) Global design, Inc. All rights reserved.
 * http://www.glode.co.jp/ 
 * Version: 1.0.0
 * Last Modified: 2009/4/4
 * Library&Plugin: jQuery 1.3.2
 
================================================== */

;(function($){

	//jQueryの名前空間の定義
	var NameSpace = 'attrRep';
	
	$.fn[NameSpace] = function(options){
		
		//デフォルト値の設定
		var c = $.extend({
			name: 'src',
			ret: '',
			rep: ''
		},options);

		//自身をtargetに格納
		var target = this;
		
		//オブジェクトの属性値を格納
		var attrValue = $(target).attr(c.name);
		
		//属性値があったら、検索・置換して属性を設定
		if(attrValue){
			
			//置換前の値ををbeforeに格納
			$(this).data('before',attrValue);
			
			attrValue = attrValue.replace(c.ret,c.rep);
			
			//置換後の値ををafterに格納
			$(this).data('after',attrValue);
			
			$(target).attr(c.name,attrValue);
		
		}
		//オブジェクトを返す
		return this;
	
	};

})(jQuery);

//gd.js
(function($){
	
	$.gd = {
		
		// URIを解析したオブジェクトを返す関数
		Uri: function(path){
			var self = this;
			this.originalPath = path;
			
			//絶対パスを取得
			this.absolutePath = (function(){
				var e = document.createElement('span');
				e.innerHTML = '<a href="' + path + '" />';
				return e.firstChild.href;
			})();
			
			//絶対パスを分解
			var fields = {'schema' : 2, 'username' : 5, 'password' : 6, 'host' : 7, 'path' : 9, 'query' : 10, 'fragment' : 11};
			var r = /^((\w+):)?(\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(this.absolutePath);
			for(var field in fields){
				this[field] = r[fields[field]];
			}
			this.querys = {};
			if(this.query){
				$.each(self.query.split('&'), function(){
					var a = this.split('=');
					if(a.length == 2) self.querys[a[0]] = a[1];
				});
			}
		},
			
		//windowサイズにあわせて幅指定
		wrapperWidth: function(options){
			
			var c = $.extend({
				area: '#tmp_wrapper',
				defWidth: '100%',
				maxWidth: 1280,
				minWidth: 780
			},options);	
			
			var 
				maxWidthSet = c.maxWidth + 'px',
				minWidthSet = c.minWidth + 'px',
				minWidthStyle = $(c.area).css('minWidth');
			
			//リサイズ関数
			function resiser(){
				if(!minWidthStyle){
					var bodyWidth = $(document.body).width();
					if(bodyWidth > c.maxWidth){
						$(c.area).width(maxWidthSet);
					}else if(bodyWidth < c.minWidth){
						$(c.area).width(minWidthSet);
					}else{
						$(c.area).width(c.defWidth);
					}
				}				
			}
			resiser();
			
			//ウィンドウがリサイズした際
			$(window).resize(function(){
				resiser();
			});
		},
		
		//キーワードを入力
		searchText: function(options){
			
			var c = $.extend({
				area: '#tmp_query',
				keyword: 'キーワードを入力'
			},options);
			
			//
			$(c.area)
				.each(function(){
					
					var obj = $(this);
					
					obj
						.focus(function(){
							if($(this).attr('value') == c.keyword){
								$(this)
									.attr('value','');
							}
						})
						.blur(function(){
							if($(this).attr('value') == ''){
								$(this)
									.attr('value',c.keyword);
							}
						});	
						
					if(obj.val() == ''){
						obj.val(c.keyword);
					}
					
				});
		},

		//独自HTMLを使ったカスタム検索にsetup
		googleSearchSetUp: function(options){
			
			var c = $.extend({
				formId: '#tmp_gsearch',					//切り替えるformのid
				resultHtmlPath: '/search/result.html',	//結果を表示するHTMLのパス（ルート相対で指定）
				hiddenBoxId: '#tmp_search_hidden',		//googleSearchのhiddenでパラメータを設定しているinputを内包している要素
				inputCof: 'FORID:9'
			},options);
			
			var host = window.location.host;
			var fixedResultHtmlPath = 'http://' + host + c.resultHtmlPath;
			var form = $(c.formId).attr({action: fixedResultHtmlPath});
			var p = $(c.hiddenBoxId);
			var hidden_cof = $('<input>').attr({type: 'hidden',name: 'cof'}).val(c.inputCof).appendTo(p);
			
		},
		
		//文字サイズ変更（段階別）
		textSize: function(options){
			
			var c = $.extend({
				cookieName: 'text_size',
				cookieValue: {expires: 365,path: '/'},
				sizeUpClass: '.text_size_up',
				sizeDownClass: '.text_size_down',
				sizeNormalClass: '.text_size_normal',
				size: '80%,90%,110%,130%',
				defaultSize: '90%',
				smallStr: 'これ以上文字を縮小することはできません。',
				bigStr: 'これ以上文字を拡大することはできません。'
			},options);
			
			var
				cookieData = $.cookie(c.cookieName),
				body = $(document.body);

			//default設定
			if(!cookieData){
				body.css('fontSize',c.defaultSize);
			}else{
				body.css('fontSize',cookieData);
			}

			var sizeArray = c.size.split(',');
			var smallSize = sizeArray[0];
			var bigSize = sizeArray[sizeArray.length - 1];
			var thisSize = body.css('fontSize');
			var thisNum = numSelect(sizeArray,thisSize);
			
			//サイズアップ
			$(c.sizeUpClass).each(function(){
				$(this).click(function(){
					
					if(thisSize == bigSize){
						alert(c.bigStr);
					}else{
						body.css('fontSize',sizeArray[thisNum + 1]);
						thisSize = body.css('fontSize');
						thisNum++;
					}
					
					//cookieにサイズを保存
					$.cookie(c.cookieName,body.css('fontSize'),c.cookieValue);
					
					//aタグのリンクを無効に
					return false;
				});						
			});
			
			//サイズダウン
			$(c.sizeDownClass).each(function(){
				$(this).click(function(){
					
					if(thisSize == smallSize){
						alert(c.smallStr);
					}else{
						body.css('fontSize',sizeArray[thisNum - 1]);
						thisSize = body.css('fontSize');
						thisNum--;
					}				
					
					//cookieにサイズを保存
					$.cookie(c.cookieName,thisSize,c.cookieValue);
					
					//aタグのリンクを無効に
					return false;
				});						
			});
			
			//標準サイズ
			$(c.sizeNormalClass).each(function(){
				$(this).click(function(){
					
					body.css('fontSize',c.defaultSize);
					thisSize = body.css('fontSize');
					thisNum = numSelect(sizeArray,thisSize);
					
					//cookieにサイズを保存
					$.cookie(c.cookieName,thisSize,c.cookieValue);
					
					//aタグのリンクを無効に
					return false;
				});
			});	
			
			//何番目のサイズかをかえす関数
			function numSelect(array,thisSize){
				
				for(var i = 0; i < array.length; i++){
					if(thisSize == array[i]){
						var num = i;
						break;
					}
				}
				
				return num;
			}
			
		},

		//スタイルシート切り替え
		changeStyle: function(options){
			
			var c = $.extend({
				switchClass: 'changestyle',
				switchChooseClass: 'changestyle_c',
				switchChooseBtn: 'changestyle_c_btn',
				switchChoosedefBtn: 'changestyle_d_btn',
				defaultLinkName: 'default',
				cookieValue: {expires: 365,path: '/'}
			},options);
			
			var
				myCookieName = 'cookies',
				cookieNameList = $.cookie(myCookieName);
				
			//
			$('.' + c.switchClass).each(function(){
					//
				$(this).click(function(){
					var 
						styleName = $(this).attr('id'),
						changeLink;
					if(styleName.indexOf('_' + c.defaultLinkName) > -1){
						var defaultIdName = styleName.replace('_' + c.defaultLinkName,'');
						styleName = c.defaultLinkName;
						changeLink = $('link[title=' + styleName +'][id=' + defaultIdName + ']');
					}else{
						styleName = styleName.replace(/^tmp_(.*)/,'$1');
						changeLink = $('link[title=' + styleName +']');
					}
					//
					var styleGloup = changeLink.attr('class');
					//
					styleSet(styleName,styleGloup,changeLink);
					
					//aタグのリンクを無効に
					return false;
				});
			});
			
			//
			$('.' + c.switchChooseBtn).each(function(){
				$(this).click(function(){
					var
						styleGloup = $(this).attr('name'),
						checked = $('.' + c.switchChooseClass).filter('[name=' + styleGloup + ']').filter(':checked'),
						styleName = checked.attr('value'),
						changeLink;
						
					if(styleName == c.defaultLinkName){
						changeLink = $('link[title=' + styleName +'][id=' + styleGloup + ']');
					}else{
						changeLink = $('link[title=' + styleName +']');
					}
					//
					styleSet(styleName,styleGloup,changeLink);
					
					//aタグのリンクを無効に
					return false;
				});
			});
			
			//
			$('.' + c.switchChoosedefBtn).click(function(){
				var
					styleName = c.defaultLinkName,
					styleGloup = $(this).attr('name'),
					defaultInput = $('.' + c.switchChooseClass).filter('[value=' + c.defaultLinkName + '][name=' + styleGloup + ']');
					
				if(styleName == c.defaultLinkName){
					changeLink = $('link[title=' + styleName +'][id=' + styleGloup + ']');
				}else{
					changeLink = $('link[title=' + styleName +']');
				}				
				//
				styleSet(styleName,styleGloup,changeLink);
				defaultInput.attr('checked',true);
				//aタグのリンクを無効に
				return false;
			});
			
			//スタイルシートを切り替えて、cookieをセットする関数
			function styleSet(styleName,styleGloup,changeLink){
				var
					changeLinkPath = changeLink.attr('href'),
					defaultLink = $('#' + styleGloup),
					defaultLinkHref = defaultLink.attr('href'),
					defaultLinkPath = $.cookie(styleGloup);
					
				//set cookie
				if((defaultLinkPath) == null){
					defaultLinkPath = defaultLinkHref + ',' + styleName;
					$.cookie(styleGloup,defaultLinkPath,c.cookieValue);
				}else{
					var 
						allCookie = $.cookie(styleGloup),
						allCookies = allCookie.split(','),
						str;
					//
					allCookies[1] = styleName;
					str = allCookies.join(',');
					$.cookie(styleGloup,str,c.cookieValue);
				}
				
				//set cookie myCookies
				if(changeLink.attr('id') == changeLink.attr('class')){//default
					defaultLink.attr('href',allCookies[0]);
				}else{//default以外
					defaultLink.attr('href',changeLinkPath);
				}
				
				if(cookieNameList == null){
					cookieNameList = styleGloup;
				}else if(cookieNameList.indexOf(styleGloup) == -1){
					cookieNameList += (',' + styleGloup);
				}
				
				$.cookie(myCookieName,cookieNameList,c.cookieValue);
			}
		},

		//アクティブリンク
		activeLink: function(options){
			
			var c = $.extend({
				area: 'body',
				level: 1,
				activeClass: 'active',
				activeThisClass: 'active_this',
				referId: '#tmp_pankuzu'
			},options);
			
			var
				reg = new RegExp(/index\..*/),
				thisPath = new $.gd.Uri(String(window.location.href)),
				area = $(c.area),
				href = area.find('a'),
				referHref = $(c.referId).find('a');
			thisPath = thisPath.absolutePath.replace('#' + thisPath.fragment,'').replace(reg,'');
			referHref = String(referHref[c.level]).replace(reg,'');
			//
			href.each(function(){
				this.hrefdata = new $.gd.Uri(this.getAttribute('href'));
				var absolutePath = '';
				if(this.hrefdata.absolutePath.indexOf('#') == -1){
					absolutePath = this.hrefdata.absolutePath.replace(reg,'');	
				}
				
				var parent = $(this).parent();
				
				//switchがspanで囲まれていたら
				if(parent.get(0) && parent.get(0).tagName == 'SPAN'){
					parent = $(this).parent().parent();
				}
				
				//現在のURLとマッチした場合
				if(thisPath == absolutePath){
					$(this).addClass(c.activeThisClass);
					parent
						.addClass(c.activeClass);
				}
				//パンくずの指定の階層のリンクとマッチした場合
				if(referHref == absolutePath){
					parent
						.addClass(c.activeClass);
				}
				
			});
			// 
		},
		//ロールオーバー
		rollover: function(options){
			
			var c = $.extend({
				area: 'body',
				onSuffix:'_on.',
				offSuffix:'_off.',
				activeSuffix:'_on.',
				activeClass:'active'
			}, options);
			
			$(c.area)
				.each(function(){
					$(this)
						.find('img')
						.filter('[src*=' + c.offSuffix + ']')
						.each(function(){
							var src = $(this).attr('src');
							
							//プリロード
							this.onImg = new Image();
							this.activeImg = new Image();
							this.onImg.src = src.replace(c.offSuffix, c.onSuffix);
							this.activeImg.src = src.replace(c.offSuffix, c.activeSuffix);
							
							//アクティブclassがあった場合の処理
							if($(this).parent().parent().hasClass(c.activeClass)){
								this.src = this.activeImg.src;
								return true;
							}
							
							//マウスオーバー、マウスアウト処理
							$(this)
								.mouseover(function(){
									this.src = this.onImg.src;
								})
								.mouseout(function(){
									this.src = src;
								});
						});
				});	
		},
		//タブメニュー
		tab: function(options){
			
			var c = $.extend({
				area: 'body',
				type: 'normal',
				easing: 'swing',
				speead: 300,
				naviClass:'tab_menu',
				activeClass:'active',
				onSuffix:'_on.',
				offSuffix:'_off.',
				cookie: false,
				cookieValue: {expires: 365,path: '/'}
			},options);
			
			$(c.area).find('.' + c.naviClass).each(function(i){
				var 
					//#でない#からはじまるaタグもしくはareaタグ
					tabNavList = $(this).find('#tmp_tabmenu_ttl a'),
					tabBodyList,
					activeImg = tabNavList.find('img[src*=' + c.offSuffix + ']'),
					defaultIdName = new $.gd.Uri(tabNavList.filter(':first').attr('href')).fragment,
					activeMenu = defaultIdName,
					cookieName = c.naviClass + i,
					cookieData = $.cookie(cookieName),
					times = 0;
					//
				//
				tabNavList.each(function(){
					this.hrefdata = new $.gd.Uri(this.getAttribute('href'));
					var selecter = '#' + this.hrefdata.fragment;
					//
					if(tabBodyList){
						tabBodyList = tabBodyList.add(selecter);
					}else{
						tabBodyList = $(selecter);
					}
					
					$(this)
						//clickイベントから他の関数を削除
						.unbind('click')
						.click(function(){
							
							//cookieに追加
							$.cookie(cookieName, selecter, c.cookieValue);
							
							//tab_menuにclass="アクティブid"を追加
							var thisTabNavi = $(this).closest('.' + c.naviClass);
							thisTabNavi
								.removeClass(activeMenu)
								.addClass(this.hrefdata.fragment);
							activeMenu = this.hrefdata.fragment;
							
							//class="active"を付与
							tabNavList
								.parent()
								.removeClass(c.activeClass);
							$(this)
								.parent()
								.addClass(c.activeClass);
								
							//imgをアクティブに
							activeImg.each(function(){
													
								$(this).attrRep({
									name: 'src',
									ret: c.onSuffix,
									rep: c.offSuffix
								});
								
							});	
							
							//imgをアクティブに
							$(this)
								.find('img[src*=' + c.offSuffix + ']')
								.each(function(){
									$(this).attrRep({
										name: 'src',
										ret: c.offSuffix,
										rep: c.onSuffix
									});
								});
							
							//初期動作はtypeを'normal'に
							var type;
							if(times == 0){
								type = 'normal';
								times ++;
							}else{
								type = c.type;
							}
							
							//表示・非表示
							switch(type){
								
								//ノーマル切り替え
								case 'normal':
									tabBodyList.hide();
									$(selecter).show();
									break;
								
								//フェード切り替え
								case 'fade':
									tabBodyList
										.filter(':visible')
										.fadeOut('slow',function(){
											$(selecter).fadeIn('fast');
										});
									break;
								
								//スライド切り替え
								case 'slide':
									tabBodyList
										.filter(':visible')
										.animate({
												height:'1px'
											},
											c.speed,
											c.easing,
											function(){
												tabBodyList.filter(':visible').css('height','auto');	
												tabBodyList.filter(':visible').hide();
												$(selecter).slideDown('fast');
											}
										);
									break;
								
								default:
									tabBodyList
										.filter(':visible')
										.hide();
									$(selecter).show();
									break;
							}
							//aタグのリンクを無効に
							return false;
						});
				});
				
				//default設定
				
				if(c.cookie && $.cookie(cookieName)){
					tabNavList.filter('[href^=' + $.cookie(cookieName) + ']').trigger('click');
				}else{
					if($("#tmp_tokuban_shoukai").length){
						tabNavList.eq(1).trigger('click');
					}else{
						tabNavList.filter(':first').trigger('click');
					}
				}
			});
		},
		//開閉式メニュー
		switchMenu: function(options){
			
			var c = $.extend({
				area: 'body',
				type: 'normal',
				easing: 'swing',
				speead: 300,
				naviClass: 'switch_menu',
				switchClass: 'switch',
				cntClass: 'switch_cnt',
				activeClass: 'active',
				onSuffix: '_on.',
				offSuffix: '_off.',
				onAlt: 'メニューを閉じます',
				offAlt :'メニューを開きます',
				targetParentLevel: 1
			},options);
			
			$(c.area)
				.find('.' + c.naviClass)
				.each(function(){
					var activeParent = $(this).find('.' + c.activeClass).parent();
					//
					if(activeParent.hasClass(c.cntClass)){
						activeParent.addClass(c.activeClass);
					};
					
					//
					$(this)
						//switch_cnt
						.find('.' + c.cntClass)
						.each(function(){
							if($(this).hasClass(c.activeClass)){
								$(this)
									.parent()
									.addClass(c.activeClass);
								return true;
							}else{
								$(this).hide();
							}
						})
						.end()
						
						//activeの中にswitch_cntがある場合
						.find('.' + c.activeClass + ' .' + c.cntClass)
						.addClass(c.activeClass)
						.show()
						.end()
						
						//スイッチをクリックしたときの処理
						.find('.' + c.switchClass)
						.css('cursor','pointer')
						.click(function(){
							//
							
							var parent = $(this).parent();
							
							//指定した数分親を参照しなおす
							//1.1.7
							for(var i = 0; i < c.targetParentLevel - 1; i++){
								parent = parent.parent();
							}
							
							//switchがspanで囲まれていたら
							if(parent.get(0) && parent.get(0).tagName == 'SPAN'){
								parent = $(this).parent().parent();
							}
							
							var 
								obj = parent.find('.' + c.cntClass).eq(0),
								img = $(this).find('img[src*=' + c.offSuffix + '],img[src*=' + c.onSuffix + ']'),
								src = img.attr('src');
								
							//クラス切り替え
							parent
								.toggleClass(c.activeClass);
							obj.toggleClass(c.activeClass);
							
							//開閉様式
							switch(c.type){
								
								//ノーマル切り替え
								case 'normal':
									obj.toggle();
									break;
									
								//スライド切り替え
								case 'slide':
									obj
										.filter(':visible')
										.animate({
												height:'1px'
											},
											c.speead,
											c.easing,
											function(){
												obj.css('height','auto');	
												obj.hide();
											}
										)
										.end()
										.filter(':hidden')
										.slideDown("fast");
									break;
									
								default:
									obj.toggle();
									break;
							}
							
							//switchの中にimgがあった場合の処理
							changeImg($(this),src,img);
							
							//aタグのリンクを無効に
							return false;
						})
						//プリロード
						.find('img[src*=' + c.offSuffix + ']')
						.each(function(){
							var src = $(this).attr('src');
							this.preImg = new Image();
							this.preImg.src = src.replace(c.offSuffix,c.onSuffix);
						});
					
					var
						activeA = $(this).find('.' + c.activeClass + ' a'),
						activeImg = activeA.find('img[src*=' + c.offSuffix + ']'),
						activeSrc = activeImg.attr('src');
					
					//アクティブclassがあった場合の処理
					changeImg(activeA,activeSrc,activeImg);
					
					//イメージを切り替える関数
					function changeImg(jObj,src,img){

						var parent = jObj.parent();
						
						//指定した数分親を参照しなおす
						//1.1.7
						for(var i = 0; i < c.targetParentLevel - 1; i++){
							parent = parent.parent();
						}
						
						//switchがspanで囲まれていたら
						if(parent.get(0) && parent.get(0).tagName == 'SPAN'){
							parent = jObj.parent().parent();
						}
						
						if(src){
							if(parent.hasClass(c.activeClass)){
								src = src.replace(c.offSuffix,c.onSuffix);
								img.attr('alt',c.onAlt);
							}else{
								src = src.replace(c.onSuffix,c.offSuffix);
								img.attr('alt',c.offAlt);
							}
							jObj
								.find('img[src*=' + c.offSuffix + '],img[src*=' + c.onSuffix + ']')
								.attr('src',src);
						}
					}
				});
		},
		
		//ラベルの中に画像があってもinputにチェックを入れる（IE）
		labelClickable: function(options){
			
			if(!$.browser.msie) return;
			
			var c = $.extend({
				area: 'body'
			},options);
			
			$(c.area).find('label:has(img)').each(function(){
				var id = $(this).attr('for');
				var input = $('#' + id);
				$(this).toggle(
					function(){
						input.attr('checked',true).select();
					},
					function(){
						//radioボタンの場合チェックをはずすことをしない
						if(input.attr('type' == 'radio')) return;
						input.attr('checked',false).select();
					}
				);
			});	
		},
		
		//ディレクトリを判別して真偽値を返す
		directoryFlg: function(options){
			
			var c = $.extend({
				directory: '/'
			},options);		
			
			var thisPath = new $.gd.Uri(String(window.location.href));
			var directory = thisPath.path.replace(/index\..*/,'');
			directory = directory.replace('/cms8341','');
			var flg = false;
			
			var arr = c.directory.split(',');
			
			for(var i = 0; i < arr.length; i++){
				
				if(directory.search(arr[i]) == 0){
					flg = true;
					break;
				}
				
			}
			
			return flg;
		}

	};
	
	//changeStyleのcookieをloadして、スタイルシートを切り替え
	var styleCookies = $.cookie('cookies');
	if(styleCookies){
		var cookiesArray = styleCookies.split(',');
		for(var i = 0; i < cookiesArray.length; i++){
			var
				styleCookies = $.cookie(cookiesArray[i]),

				cookieArray = styleCookies.split(','),
				value = cookieArray[1],
				href = $('link[title=' + value + ']').attr('href'),
				target = $('#' + cookiesArray[i]);
			target.attr('href',href);
		}
	}

})(jQuery);
