(function (){

	document.observe('dom:loaded',function(){
		$$('#orderZone').each(function(){
			function setStyle(){
				$('orderZone').style.border = 'dotted #fcb6d7';
			}
			$("btnSetStyle").onclick = setStyle;
		})
	})

})();


/* Scrolling */
(function(){document.observe("dom:loaded",function(){$$("a[href^='#']:not([href='#'])").each(function(a){a.observe("click",function(b){new Effect.ScrollTo(this.hash.substr(1));Event.stop(b)}.bindAsEventListener(a))})})})();

/* Scriptaculous MouseOver Effect */
(function(){document.observe("dom:loaded",function(){$$("#rap").each(function(){var a=$("rap");var c=a.getElementsByTagName("img");for(var b=0;b<c.length;b++){c[b].onmouseover=function(){new Effect.Opacity(this,{from:1,to:0.5,duration:0.5})};c[b].onmouseout=function(){new Effect.Opacity(this,{from:0.5,to:1,duration:0.5})}}})})})();

/* Swap and Popup for prototype.js */
(function(){function b(){var c=$A(document.getElementsByClassName("swap"));c.each(function(e){e.imgsrc=e.src;var d=e.src.lastIndexOf(".");e.imgsrc_on=e.src.substr(0,d)+"_on"+e.src.substr(d,4);new Image().src=e.imgsrc_on;e.onmouseover=function(){this.src=this.imgsrc_on};e.onmouseout=function(){this.src=this.imgsrc}})}function a(){var c=$A(document.getElementsByTagName("a"));c.each(function(e){if(e.getAttribute("rel")){var d=e.getAttribute("rel");if(d.indexOf("popup")==0){e.onclick=function(){var f=this.rel.replace(/^[^\?]+\??/,"").replace(/&/g,",");var g=this.rel.replace(/\?.*$/,"").replace(/^popup_/,"");window.open(this.href,g,f).focus();return false}}}})}Event.observe(window,"load",b,false);Event.observe(window,"load",a,false)})();


/* VALIDATOR STYLE */

var addEvent=(window.addEventListener)?(function(c,a,b){c.addEventListener(a,b,false)}):(window.attachEvent)?(function(c,a,b){c.attachEvent("on"+a,b)}):(function(c,a,b){c["on"+a]=b});var Position2={offset:function(b){var a={};a.x=this.getOffset("Left",b);a.y=this.getOffset("Top",b);return a},getOffset:function(b,a){if(!a.offsetParent||a.offsetParent.tagName.toLowerCase()=="body"){return a["offset"+b]}else{return a["offset"+b]+this.getOffset(b,a.offsetParent)}}};function addEvent(d,b,a){try{d.addEventListener(b,a,false)}catch(c){d.attachEvent("on"+b,a)}};

/* //////// VALIDATOR.JS //////////////////////////////////////// */
var Validator={check:function(g,e,b){var c;var f=this.rule;f.field=g;f.value=g.value;f.extra=b;if(!e||!e.match(/^!/)){c=f.input()}if(e&&!c&&f.value!=""){e=e.replace(/^!/,"");var h=e.split(/\s+/);for(var d=0,a;a=h[d];d++){a=a.replace(/([\d\-]+)?$/,"");c=f[a](RegExp.$1);if(c){break}}}if(c){this.baloon.open(g,c)}},submit:function(c){this.allclose(c);var b=new Array;for(var a=0,d;d=c[a];a++){if(d.onblur){d.onblur()}if(d.type=="submit"){b.push(d)}}for(var a=0,d,e;d=c[a];a++){if(d._validbaloon&&d._validbaloon.visible()){while(e=b.shift()){this.baloon.open(e,this.rule.submit())}return false}}return true},allclose:function(b){for(var a=0,c;c=b[a];a++){if(c._validbaloon){c._validbaloon.close()}}}};Validator.baloon={index:0,open:function(d,f){if(!d._validbaloon){var c=new this.element(d);c.create();d._validbaloon=c;if(d.type=="radio"||d.type=="checkbox"){for(var a=0,b;b=d.form[d.name][a];a++){addEvent(b,"focus",function(){c.close()})}}}d._validbaloon.show(f)},element:function(){this.initialize.apply(this,arguments)}};

Validator.baloon.element.prototype = {
	initialize: function(field){
		this.parent = Validator.baloon;
		this.field = field;
	},

	create: function(){
		var field  = this.field;

		var box = document.createElement('div');
		box.className = 'baloon';

		var offset = Position2.offset(field);
		var top  = offset.y - 25;
		var left = offset.x - 20 + field.offsetWidth;
		box.style.top  = top +'px';
		box.style.left = left+'px';

		var self = this;
		addEvent(box, 'click', function(){ self.toTop(); });

		var bindClose = function(){ self.close(); };
		var link = document.createElement('a');
		link.appendChild(document.createTextNode('×'));
		link.setAttribute('href', 'javascript:void(0);');
		addEvent(link, 'click', bindClose);
		addEvent(field, 'focus', bindClose);

		var msg = document.createElement('span');
		var div = document.createElement('div');
		div.appendChild(link);
		div.appendChild(msg);
		box.appendChild(div);
		document.body.appendChild(box);

		this.box = box;
		this.msg = msg;
	},

	show: function(msg){
		var field = this.field;
		this.msg.innerHTML  = msg;

		this.box.style.display = '';
		this.toTop();

		if(field.type != 'radio' && field.type != 'checkbox'){
			var colors = new Array('#fff0f5', '#ffe4e1', '#fff0f5', '#ffe4e1');
			window.setTimeout(function(){
				if(colors.length > 0){
					field.style.backgroundColor = colors.shift();
					window.setTimeout(arguments.callee, 70);
				}
			}, 10);
		}
	},

	close: function(){
		this.box.style.display = 'none';
		this.field.style.backgroundColor = '';
	},

	visible: function(){
		return (this.box.style.display == '');
	},

	toTop: function(){
		this.box.style.zIndex = ++ this.parent.index;
	}
};

Validator.rule = {
	msg: null,

	submit: function(){
		return this.msg.submit;
	},

	input: function(){
		if(this.field.type == 'radio'){
			for(var i = 0, e; e = this.field.form[this.field.name][i]; i++){
				if(e.checked) return;
			}
			return this.msg.compare;
		}else if(this.field.type == 'checkbox'){
			for(var i = 0, e; e = this.field.form[this.field.name][i]; i++){
				if(e.checked) return;
			}
			return this.msg.noselect;
		}/*else if(
			// フルネームで、ご記入下さい。
			this.value == '\u30D5\u30EB\u30CD\u30FC\u30E0\u3067\u3001\u3054\u8A18\u5165\u4E0B\u3055\u3044\u3002' || 
			// ハンドルネームでも結構です。
			this.value == '\u30CF\u30F3\u30C9\u30EB\u30CD\u30FC\u30E0\u3067\u3082\u7D50\u69CB\u3067\u3059\u3002' || 
			// ビル名などはこちらにご記入下さい。
			this.value == '\u30D3\u30EB\u540D\u306A\u3069\u306F\u3053\u3061\u3089\u306B\u3054\u8A18\u5165\u4E0B\u3055\u3044\u3002' || 
			// 携帯電話も結構です
			this.value == '\u643A\u5E2F\u96FB\u8A71\u3082\u7D50\u69CB\u3067\u3059\u3002' || 
			// 500文字以内にまとめて、ご記入下さい。
			this.value == '500\u6587\u5B57\u4EE5\u5185\u306B\u307E\u3068\u3081\u3066\u3001\u3054\u8A18\u5165\u4E0B\u3055\u3044\u3002'){
			return this.msg.textfield;
		}*/else if(this.value == ''){
			return (this.field.type == 'select-one') ? this.msg.noselect : this.msg.noinput;
		}
	},

	//zipcode: function(){ if(!this.value.match(/^\d{3,4}$/)) return this.msg.zipcode; },

	mail: function(){ // ^[\x01-\x7F]+@((([-a-z0-9]+\.)*[a-z]+)|(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))$
		// 半角英数字で、間違えないようご記入下さい。
		/*if(this.value == '\u534A\u89D2\u82F1\u6570\u5B57\u3067\u3001\u9593\u9055\u3048\u306A\u3044\u3088\u3046\u3054\u8A18\u5165\u4E0B\u3055\u3044\u3002'){
			return this.msg.textfield;
		}else */if(!this.value.match(/^[A-Za-z0-9]+[\w-]+@[\w\.-]+\.\w{2,}$/)){
			return this.msg.mail;
		}
	},

	equal: function(){
		if(this.field.form[this.extra].value && this.value != this.field.form[this.extra].value)
			return this.msg.unequal;
	},

	alphabet: function(){
		if(!this.value.match(/^[a-zA-Z\-\d]+$/))
			return this.msg.alphabet;
	},

	phone: function(){
		if(!this.value.match(/^\d{1,4}/)){
			return this.msg.phone;
		}else if(!this.value.match(/^\d{1,4}[\-\d]+$/)){
			return this.msg.phone2;
		}
	},
/*
	kana: function(){
		for(var i = 0;i < this.value.length;i++){
			if(this.value.charAt(i) == ' ' || this.value.charAt(i) == '\u3000') continue;
			if(this.value.charAt(i) < '\u30A1' || this.value.charAt(i) > '\u30F6')
				return this.msg.kana;
		}
	},
*/
	count: function(arg){
		return this._range(arg, this.value.length, this.msg.count);
	},

	num: function(arg){
		if(!this.value.match(/^[\d]+$/))
			return this.msg.num.nonumber;

		return this._range(arg, parseInt(this.value), this.msg.num);
	},

	check: function(arg){
		var value = 0;
		for(var i = 0, e; e = this.field.form[this.field.name][i]; i++)
			if(e.checked) value += 1;

		return this._range(arg, value, this.msg.check);
	},

	_range: function(range, value, msg){
		if(!range) return;

		var result = '';
		var c = (" "+range).split(/\-/);
		var min = parseInt(c[0]) || 0;
		var max = parseInt(c[1]) || 0;

		if(value != min && /^\d+$/.test(range)) result = msg.unequal;
		else if(min == 0 && value > max) result = msg.too_big;
		else if(max == 0 && value < min) result = msg.too_small;
		else if(min > 0 && max > 0 && (value < min || value > max)) result = msg.outofrange;

		return result.replace(/%1/g, min).replace(/%2/g, max);
	}
};

Validator.lang = {
	ja: {
		compare:			'\u3069\u3061\u3089\u304B\u306B\u30C1\u30A7\u30C3\u30AF\u3092\u5165\u308C\u3066\u4E0B\u3055\u3044\u3002',//どちらかにチェックを入れて下さい。
		noselect:			'\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002',//選択されていません。
		noinput:	 			'\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002',//入力されていません。
		unequal:			'\u5165\u529B\u304C\u63C3\u3063\u3066\u3044\u307E\u305B\u3093\u3002',//入力が揃っていません。

		submit:				'\u5165\u529B\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002',//入力エラーがあります。
		//zipcode:			'\u534A\u89D2\u6570\u5024\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//半角数値で入力して下さい。
		mail:					'\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002',//メールアドレスの形式が正しくありません。
		alphabet:			'\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u3001\u6570\u5B57\u3001' +
								'- \u4EE5\u5916\u306F\u5165\u529B\u51FA\u6765\u307E\u305B\u3093\u3002',//アルファベット、数字、- 以外は入力出来ません。
		captcha:			'\u534A\u89D2\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\uFF14\u6587\u5B57\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//半角アルファベット４文字を入力して下さい。
		phone:				'\u96FB\u8A71\u756A\u53F7\u306F\u6570\u5B57\u304B\u3089\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//電話番号は数字から入力して下さい。
		phone2:				'\u534A\u89D2\u6570\u5B57\u3068-\u4EE5\u5916\u5165\u529B\u3067\u304D\u307E\u305B\u3093\u3002\u4F8B\uFF1A0776-21-1111',//半角数字と-以外入力できません。例：0776-21-1111
		//kana:					'\u5168\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//全角カタカナで入力して下さい。
		textfield:			'\u8A18\u5165\u6F0F\u308C\u304C\u3042\u308A\u307E\u3059\u3002',//記入漏れがあります。

		count: {
			unequal:		'%1'+'\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~文字で入力して下さい。
			too_big:			'%2'+'\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~文字以内で入力して下さい。
			too_small:		'%1'+'\u6587\u5B57\u4EE5\u4E0A\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~文字以上入力して下さい。
			outofrange:	'%1'+'\u304B\u3089'+'%2'+'\u6587\u5B57\u306E\u9593\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002'// ~から~文字の間で入力して下さい。
		},

		num: {
			nonumber:		'\u6570\u5024\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//数値で入力して下さい。
			unequal:		'%1'+'\u3068\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~と入力して下さい。
			too_big:			'%2'+'\u4EE5\u4E0B\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~以下の値を入力して下さい。
			too_small:		'%1'+'\u4EE5\u4E0A\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002',//~以上の値を入力して下さい。
			outofrange:	'%1'+'\u304B\u3089'+'%2'+'\u306E\u9593\u3067\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044\u3002'//~から~の間で入力して下さい。
		},

		check: {
			unequal:		'\u30C1\u30A7\u30C3\u30AF\u306F'+'%1'+'\u500B\u3057\u3066\u4E0B\u3055\u3044\u3002',//チェックは~個して下さい。
			too_big:			'\u30C1\u30A7\u30C3\u30AF\u306F'+'%2'+'\u500B\u307E\u3067\u3067\u3059\u3002',//チェックは~個までです。
			too_small:		'\u30C1\u30A7\u30C3\u30AF\u306F'+'%1'+'\u500B\u4EE5\u4E0A\u3057\u3066\u4E0B\u3055\u3044\u3002',//チェックは~個以上して下さい。
			outofrange:	'\u30C1\u30A7\u30C3\u30AF\u306F'+'%1'+'\u500B\u304B\u3089'+'%2'+'\u500B\u307E\u3067\u3067\u3059\u3002'//チェックは~個から~個までです。
		}
	}
};

Validator.rule.msg = Validator.lang.ja;

Validator.rule.textlimit300 = function(){
	if(this.value.length > 300){
		return '300\u6587\u5B57\u4EE5\u5185\u3067\u304A\u9858\u3044\u3057\u307E\u3059\u3002'; //300文字以内でお願いします。
	}
}

Validator.rule.textlimit500 = function(){
	if(this.value.length > 500){
		return '500\u6587\u5B57\u4EE5\u5185\u3067\u304A\u9858\u3044\u3057\u307E\u3059\u3002'; //500文字以内でお願いします。
	}
}

/*//////// Enter キー 無効 Key #13 ///////////////////*/
function myEvent(b){var a=b?b:(event?event:window.event);if(a){if(a.keyCode==13){return false}}}window.document.onkeydown=myEvent;


/* Simple Accordion Script Requires Prototype and Script.aculo.us Libraries By: Brian Crescimanno <brian.crescimanno@gmail.com> http://briancrescimanno.com This work is licensed under the Creative Commons Attribution-Share Alike 3.0 http://creativecommons.org/licenses/by-sa/3.0/us/ */
if(typeof Effect=="undefined"){throw ("You must have the script.aculo.us library to use this accordion")}var Accordion=Class.create({initialize:function(c,a){if(!$(c)){throw ("Attempted to initalize accordion with id: "+c+" which was not found.")}this.accordion=$(c);this.options={toggleClass:"accordion-toggle",toggleActive:"accordion-toggle-active",contentClass:"accordion-content"};this.contents=this.accordion.select("div."+this.options.contentClass);this.isAnimating=false;this.maxHeight=0;this.current=a?this.contents[a-1]:this.contents[0];this.toExpand=null;this.checkMaxHeight();this.initialHide();this.attachInitialMaxHeight();var b=this.clickHandler.bindAsEventListener(this);this.accordion.observe("click",b)},expand:function(a){this.toExpand=a.next("div."+this.options.contentClass);if(this.current!=this.toExpand){this.toExpand.show();this.animate()}},checkMaxHeight:function(){for(var a=0;a<this.contents.length;a++){if(this.contents[a].getHeight()>this.maxHeight){this.maxHeight=this.contents[a].getHeight()}}},attachInitialMaxHeight:function(){this.current.previous("div."+this.options.toggleClass).addClassName(this.options.toggleActive);if(this.current.getHeight()!=this.maxHeight){this.current.setStyle({height:this.maxHeight+"px"})}},clickHandler:function(b){var a=b.element();if(a.hasClassName(this.options.toggleClass)&&!this.isAnimating){this.expand(a)}},initialHide:function(){for(var a=0;a<this.contents.length;a++){if(this.contents[a]!=this.current){this.contents[a].hide();this.contents[a].setStyle({height:0})}}},animate:function(){var c=new Array();var a={sync:true,scaleFrom:0,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleMode:{originalHeight:this.maxHeight,originalWidth:this.accordion.getWidth()},scaleX:false,scaleY:true};c.push(new Effect.Scale(this.toExpand,100,a));a={sync:true,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleX:false,scaleY:true};c.push(new Effect.Scale(this.current,0,a));var b=0.75;new Effect.Parallel(c,{duration:b,fps:35,queue:{position:"end",scope:"accordion"},beforeStart:function(){this.isAnimating=true;this.current.previous("div."+this.options.toggleClass).removeClassName(this.options.toggleActive);this.toExpand.previous("div."+this.options.toggleClass).addClassName(this.options.toggleActive)}.bind(this),afterFinish:function(){this.current.hide();this.toExpand.setStyle({height:this.maxHeight+"px"});this.current=this.toExpand;this.isAnimating=false}.bind(this)})}});

var site_flag = 0;
var siteUrl = new Array('std_info.php', 'site_info.php', 'sitemap.php'/* , 'inquiry.php' */);
var sPath = window.location.pathname;
sPath = sPath.replace(/^\//g, '');
if(sPath == siteUrl[0]|sPath == siteUrl[1]|sPath == siteUrl[2]){site_flag = 1;}

document.observe("dom:loaded",function(){accordion=(site_flag>0)?new Accordion("menu",2):new Accordion("menu",1)});


