function air(){
	this.mainRight = $('right');
	this.mainRightHeight = 422;
	this.mainRightWidth = 680;
	this.topButton = $('topButton');
	this.conceptButton = $('conceptButton');
	this.style_catalogButton = $('style_catalogButton');
	this.price_menuButton = $('price_menuButton');
	this.staffButton = $('staffButton');
	this.salon_guideButton = $('salon_guideButton');
	this.recruitmentButton = $('recruitmentButton');
	this.linkButton = $('linkButton');
	this.contactButton = $('contactButton');
	this.blogButton = $('blogButton');
	this.logoButton = $('logoButton');
	this.setTimer = setInterval(function(){return ture;},100000);
	this.changeBack = [];
	this.cache = {};
	this.flag = false;
	for (var i=0; i<4; i++){
		this.changeBack[i] = new Image;
		this.changeBack[i].src = 'img/back/back_'+i+'.gif';
	}
	this.airShopPhoto = [];
	for(var i=0; i<5; i++){
		this.airShopPhoto[i] = new Image;
		this.airShopPhoto[i].src = 'img/salon_guide/air_shop_'+i+'.jpg';
	}
	if (document.all){
    var mainMarginTop;
		if(document.documentElement.offsetHeight >= 470){
			mainMarginTop = (document.documentElement.offsetHeight - 470)/2 + 'px';
		} else {
			mainMarginTop = '0px';
		}
	} else {
		if(window.innerHeight >= 470){
			mainMarginTop = (window.innerHeight - 470)/2 + 'px';
		} else {
			mainMarginTop = '0px';
		}
	}
	$('main').style.marginTop = mainMarginTop;
	$('main').style.visibility = 'visible';
	Event.observe(window,'resize',function(){
    var mainMarginTop;
		if (document.all){
			if(document.documentElement.offsetHeight >= 470){
				mainMarginTop = (document.documentElement.offsetHeight - 470)/2 + 'px';
			} else {
				mainMarginTop = '0px';
			}
		} else {
			if(window.innerHeight >= 470){
				mainMarginTop = (window.innerHeight - 470)/2 + 'px';
			} else {
				mainMarginTop = '0px';
			}
		}
		$('main').style.marginTop = mainMarginTop;
	},true);
}
	
/*
* Orginal: http://adomas.org/javascript-mouse-wheel/
* prototype extension by "Frank Monnerjahn" themonnie @gmail.com
*/
Object.extend(Event, {
	wheel:function (event){
		var delta = 0;
		if (!event) event = window.event;
		if (event.wheelDelta) {
			delta = event.wheelDelta/120;
			if (window.opera) delta = -delta;
		} else if (event.detail) { delta = -event.detail/3;     }
		return Math.round(delta); //Safari Round
	}
});
/*
* end of extension
*/
air.prototype = {
	init : function(){
		this.topFunc();
	//mouseover
		$$('img.menu').each((function(obj){
			Event.observe(obj,'mouseover',this.overFunc.bind(this,obj));
		}).bind(this));
	//click
		Event.observe(this.topButton,'click',this.topFunc.bind(this));
		Event.observe(this.conceptButton,'click',this.conceptFunc.bind(this,false));
		Event.observe(this.style_catalogButton,'click',this.style_catalogFunc.bind(this,false));
		Event.observe(this.price_menuButton,'click',this.price_menuFunc.bind(this,false));
		Event.observe(this.staffButton,'click',this.staffFunc.bind(this,false));
		Event.observe(this.salon_guideButton,'click',this.salon_guideFunc.bind(this,false));
		Event.observe(this.recruitmentButton,'click',this.recruitmentFunc.bind(this,false));
		Event.observe(this.linkButton,'click',this.linkFunc.bind(this,false));
		Event.observe(this.contactButton,'click',this.contactFunc.bind(this));
		Event.observe(this.blogButton,'click',this.blogFunc.bind(this));
		Event.observe(this.logoButton,'click',this.topFunc.bind(this));
	},
	overFunc : function(obj,e){
		obj.parentNode.style.background = "url('img/main/point_over.gif')  no-repeat";
		obj.src = obj.src.replace('.gif','_over.gif');
		Event.observe(obj,'mouseout',this.outFunc.bind(this,obj));
	},
	outFunc : function(obj,e){
		obj.parentNode.style.background = "url('img/main/point.gif')  no-repeat";
		obj.src = obj.src.replace('_over.gif','.gif');
	},
	topFunc : function(){
		this.moveIconId = [];
		this.changeMenuButton(this.topButton);
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'hidden';
		});
		this.mainRight.style.overflow = 'hidden';
		this.mainRight.style.border = "0px";
		this.mainRight.style.backgroundColor = "#ffffff";
		var topHtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="680" height="425" id="index" align="middle">'
			        + '<param name="allowScriptAccess" value="sameDomain" />'
			        + '<param name="allowFullScreen" value="false" />'
			        + '<param name="movie" value="index.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="index.swf?v=2010091002" quality="high" bgcolor="#ffffff" width="680" height="425" name="index" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		this.mainRight.innerHTML = topHtml;
	},
	conceptFunc : function(historyTop){
		this.mainRight.style.overflow = 'hidden';
		if(this.maskClear){
			clearInterval(this.maskClear);
		}
		if($('conceptMask')){
			Element.remove('conceptMask');
		}
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.backDivSet(0,historyTop);
		this.changeMenuButton(this.conceptButton);
		this.mainRight.style.border = "solid 1px #505050";
		this.mainRight.style.background = "url('img/concept/concept_text.gif') 50% no-repeat";
		var divMask = document.createElement('div');
		divMask.id='conceptMask';
		with(divMask.style){
			marginLeft = '20px';
			marginTop = '0px';
			width = '420px';
			height = '420px';
		}
		for(var i=0; i<10; i++){
			var divMaskOpa = document.createElement('div');
			with (divMaskOpa.style){
				width = '100%';
				height = '1px';
				background = '#ffffff';
				fontSize = '1px';
				if(document.all){
					filter = "alpha(opacity="+10*i+")";
				} else if (navigator.userAgent.indexOf("Safari") > -1){
					opacity = parseFloat(i/10);
				} else {
					MozOpacity = parseFloat(i/10);
				}
			}
			divMask.appendChild(divMaskOpa);
		}
		var divMaskBottom = document.createElement('div');
		divMaskBottom.id='conceptMaskBottom';
		with(divMaskBottom.style){
			width = '100%';
			height = '400px';
			fontSize = '1px';
			background = '#ffffff';
		}
		divMask.appendChild(divMaskBottom);
		this.mainRight.appendChild(divMask);
		this.maskClear = setInterval((function(){
			if(this.opa == 0){
				if($('conceptMask') && parseFloat($('conceptMaskBottom').style.height) > 2){
					$('conceptMaskBottom').style.height = (parseFloat($('conceptMaskBottom').style.height)-2)+'px';
					$('conceptMask').style.height = (parseFloat($('conceptMask').style.height)-2)+'px';
					$('conceptMask').style.marginTop = (parseFloat($('conceptMask').style.marginTop)+2)+'px';
				} else {
					clearInterval(this.maskClear);
					if($('conceptMask')){
						Element.remove('conceptMask');
					}
				}
			}
		}).bindAsEventListener(this),50);
	},
	style_catalogFunc: function(historyTop){
		this.flag = false;
		this.mainRight.style.overflow = 'hidden';
		this.mainRight.style.backgroundImage = '';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.changeMenuButton(this.style_catalogButton);
		this.mainRight.style.border = "solid 1px #505050";
		var iframeDiv = document.createElement('div');
		with (iframeDiv.style){
			width = '100%';
			height = '100%';
			display = 'none';
			padding = '0px';
		}
		this.mainRight.innerHTML="";
		this.mainRight.appendChild(iframeDiv);
		this.backDivSet(1,historyTop,iframeDiv);
		this.styleIframe = document.createElement('iframe');
		this.styleIframe.id = 'styleCatalog'
		this.styleIframe.name = 'styleCtalogFrame';
		this.styleIframe.frameBorder = '0';
		this.styleIframe.marginHeight = '0';
		this.styleIframe.marginWidth = '0';
		this.styleIframe.scrolling = 'auto';
		with (this.styleIframe.style){
			width = this.mainRightWidth - 1+'px';
			height = '100%';
			padding = '0px';
			fontSize = '1px';
		}
		this.styleIframe.src = './style.html';
		iframeDiv.appendChild(this.styleIframe);
	},
	price_menuFunc : function(historyTop){
		this.mainRight.style.overflow = 'hidden';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.changeMenuButton(this.price_menuButton);
		this.backDivSet(2,historyTop);
		this.mainRight.style.border = "solid 1px #505050";
		this.mainRight.style.background = "url('img/price_menu/price_menu_text.gif') 50% no-repeat";
	},
	staffFunc : function(historyTop){
		this.flag = false;
		this.mainRight.style.overflow = 'hidden';
		this.mainRight.style.backgroundImage = '';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.changeMenuButton(this.staffButton);
		this.mainRight.style.border = "solid 1px #505050";
		var iframeDiv = document.createElement('div');
		with (iframeDiv.style){
			width = '100%';
			height = '100%';
			display = 'none';
			padding = '0px';
		}
		this.mainRight.innerHTML="";
		this.mainRight.appendChild(iframeDiv);
		this.backDivSet(3,historyTop,iframeDiv);
		this.staffIframe = document.createElement('iframe');
		this.staffIframe.id = 'staff';
		this.staffIframe.name = 'staffFrame';
		this.staffIframe.frameBorder = '0';
		this.staffIframe.marginHeight = '0';
		this.staffIframe.marginWidth = '0';
		//this.staffIframe.scrolling = (staff.comment.length > 17)? 'auto' : 'no';
		this.staffIframe.scrolling = 'auto';
		with (this.staffIframe.style){
			width = this.mainRightWidth - 1+'px';
			height = '100%';
			padding = '0px';
			fontSize = '1px';
		}
		this.staffIframe.src = './staff.html?'+new Date().getTime();
		iframeDiv.appendChild(this.staffIframe);
/*
		var divComment = document.createElement('div');
		divComment.innerHTML = "<div id='s_comment0' class='scom'></div><div id='s_comment1' class='scom'></div><div id='s_comment2' class='scom'></div><div id='s_comment3' class='scom'></div><div id='s_comment4' class='scom'></div><div id='s_comment5' class='scom'></div><div id='s_comment6' class='scom'></div><div id='s_comment7' class='scom'></div><div id='s_comment8' class='scom'></div>"
		divComment.id = "staff_comment";
		with(divComment.style){
			position = "relative";
			top = "-400px";
			height = "200px";
		}
		var divFace = document.createElement('div');
		divFace.id = "staff_face";
		with(divFace.style){
			position = "relative";
			top = "-330px";
			left = "230px";
		}
		divFace.innerHTML = "<img src=img/staff/face/face_mask.gif id=faceMask>";
		var divQuestion = document.createElement('div');
		divQuestion.innerHTML = "<div id='q_comment0' class='qcom'></div><div id='q_comment1' class='qcom'></div><div id='q_comment2' class='qcom'></div><div id='q_comment3' class='qcom'></div><div id='q_comment4' class='qcom'></div><div id='q_comment5' class='qcom'></div><div id='q_comment6' class='qcom'></div><div id='q_comment7' class='qcom'></div>";
		divQuestion.id = "staff_question";
		with(divQuestion.style){
			marginTop = (Prototype.Browser.Gecko)? "-115px" : (Prototype.Browser.WebKit)? "-115px" : "-283px" ;
			marginLeft = (Prototype.Browser.Gecko)? "20px" : (Prototype.Browser.WebKit)? "20px" : "0px" ;
			if(Prototype.Browser.IE) {
				position = "relative";
				left = "-235px";
			}
			width = "300px";
			height = "150px";
		}
*/
		if (Prototype.Browser.IE || Prototype.Browser.Opera){ /* IE/Opera. */
			//Event.observe(divFace, "mousewheel", this.handleDIV.bindAsEventListener(this), false);
			//Event.observe(divComment, "mousewheel", this.handleDIV.bindAsEventListener(this), false);
			//Event.observe(divQuestion, "mousewheel", this.handleDIV.bindAsEventListener(this), false);
		} else if (Prototype.Browser.Gecko || Prototype.Browser.WebKit) { /** Mozilla case. */
			//Event.observe(divFace, "DOMMouseScroll", this.handleDIV.bindAsEventListener(this), false); 
			//Event.observe(divComment, "DOMMouseScroll", this.handleDIV.bindAsEventListener(this), false); 
			//Event.observe(divQuestion, "DOMMouseScroll", this.handleDIV.bindAsEventListener(this), false); 
		}
		
		
		//this.mainRight.appendChild(divComment);
		//this.mainRight.appendChild(divFace);
		//this.mainRight.appendChild(divQuestion);
	},
	salon_guideFunc : function(historyTop){
		this.salon_anime = ['img/salon_guide/circle_anime/circle_0.gif','img/salon_guide/circle_anime/circle_1.gif','img/salon_guide/circle_anime/circle_2.gif','img/salon_guide/circle_anime/circle_3.gif',
							'img/salon_guide/circle_anime/circle_4.gif','img/salon_guide/circle_anime/circle_5.gif','img/salon_guide/circle_anime/circle_6.gif','img/salon_guide/circle_anime/circle_7.gif'];
		
		this.mainRight.style.overflow = 'hidden';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.changeMenuButton(this.salon_guideButton);
		this.backDivSet(null,historyTop);
		this.mainRight.style.border = "0px";
		this.mainRight.style.background = "url('img/salon_guide/air_shop_0.jpg') no-repeat";
		this.photoDiv = document.createElement('div');
		this.photoDiv.id = 'photoDiv';
		this.trValue = '-480px';
		this.vrValure = '-785px';
		with (this.photoDiv.style){
			backgroundImage = "url('img/salon_guide/circle_anime/circle_0.gif')";
			backgroundPosition = this.trValue+' '+this.vrValure;
			backgroundRepeat = 'no-repeat';
			width = '100%';
			height = '100%';
			if(document.all){
				filter = "alpha(opacity=50)";
			} else if (navigator.userAgent.indexOf("Safari") > -1){
				opacity = 0.5;
			} else {
				MozOpacity = 0.5;
			}
		}
		this.mainRight.appendChild(this.photoDiv);
		var iconDiv = document.createElement('div');
		with(iconDiv.style){
			width = '100%';
			height = '100%';
			position = 'relative';
			top = '-100%';
			zIndex = '98';
		}
		this.mainRight.appendChild(iconDiv);
		var salonIconPosition = [
			{"left":"500px","top":"13px", "width" : "24px", "height" : "24px"},
			{"left":"510px","top":"13px", "width" : "24px", "height" : "24px"},
			{"left":"520px","top":"13px", "width" : "24px", "height" : "24px"},
			{"left":"530px","top":"13px", "width" : "24px", "height" : "24px"},
			{"left":"540px","top":"13px", "width" : "24px", "height" : "24px"}
		];
		this.salon_anime_img = [];
		for(var i=0; i<this.salon_anime.length; i++){
			this.salon_anime_img[i] = new Image();
			this.salon_anime_img[i].src = this.salon_anime[i];
		}
		for(var i =0; i<5; i++){
			var salonIcon = document.createElement('img');
			salonIcon.src = 'img/salon_guide/circle_icon_'+i+'.png';
			salonIcon.id = 'salonIcon_'+i;
			Element.addClassName(salonIcon,'iepngfix');
			with(salonIcon.style){
				position = 'relative';
				cursor = 'pointer';
				zIndex = '101';
				left = salonIconPosition[i].left;
				top = salonIconPosition[i].top;
				width = salonIconPosition[i].width;
				height = salonIconPosition[i].height;
			}
			this.circleAnimeOutTimer = {};
			this.circleAnimeInTimer = {};
			Event.observe(salonIcon,'click',(function(obj){
				var imgNum = 0;
				clearInterval(this.circleAnimeOutTimer);
				clearInterval(this.circleAnimeInTimer);
				with(this.photoDiv.style){
					backgroundImage = "url('img/salon_guide/circle_anime/circle_0.gif')";
					if(document.all){
						filter = "alpha(opacity=50)";
					} else if (navigator.userAgent.indexOf("Safari") > -1){
						opacity = 0.5;
					} else {
						MozOpacity = 0.5;
					}
				}
				this.circleAnimeOutTimer = setInterval((function(){
					imgNum++;
					if(imgNum < 7){
						with(this.photoDiv.style){
							if(document.all){
								filter = "alpha(opacity="+((imgNum/2)+3)/6*100+")";
							} else if (navigator.userAgent.indexOf("Safari") > -1){
								opacity = parseFloat(((imgNum/2)+3)/6);
							} else {
								MozOpacity = parseFloat(((imgNum/2)+3)/6);
							}
							backgroundImage = "url("+this.salon_anime_img[imgNum].src+")";
						}
					} else {
						clearInterval(this.circleAnimeOutTimer);
						this.photoDiv.style.backgroundImage = "url("+this.salon_anime_img[imgNum].src+")";
						this.mainRight.style.backgroundImage = "url("+this.airShopPhoto[obj.id.split('_')[1]].src+")";
						imgNum = 6;
						this.circleAnimeInTimer = setInterval((function(){
							if(imgNum > 0){
								with(this.photoDiv.style){
									if(document.all){
										filter = "alpha(opacity="+((imgNum/2)+3)/6*100+")";
									} else if (navigator.userAgent.indexOf("Safari") > -1){
										opacity = parseFloat(((imgNum/2)+3)/6);
									} else {
										MozOpacity = parseFloat(((imgNum/2)+3)/6);
									}
									backgroundImage = "url("+this.salon_anime_img[imgNum].src+")";
								}
								imgNum--;
							} else {
								clearInterval(this.circleAnimeInTimer);
								with(this.photoDiv.style){
									backgroundImage = "url('img/salon_guide/circle_anime/circle_0.gif')";
									if(document.all){
										filter = "alpha(opacity=50)";
									} else if (navigator.userAgent.indexOf("Safari") > -1){
										opacity = 0.5;
									} else {
										MozOpacity = 0.5;
									}
								}
								imgNum = 0;
							}
						}).bindAsEventListener(this),50);
					}
				}).bindAsEventListener(this),50);
			}).bind(this,salonIcon));
			iconDiv.appendChild(salonIcon);
			IEPNGFIX.fix(salonIcon);
		}
		var timeImg = document.createElement('img');
		timeImg.src = 'img/salon_guide/time_info.png';
		Element.addClassName(timeImg,'iepngfix');
		with (timeImg.style){
			position = 'relative'
			left = '10px';
			top = '225px'
			width = '170px';
			height = '155px';
			zIndex = '99';
		}
		var mapImg = document.createElement('img');
		mapImg.src = 'img/salon_guide/map.png';
		mapImg.id = 'mapIcon';
		Element.addClassName(mapImg,'iepngfix');
		with (mapImg.style){
			cursor = 'pointer';
			position = 'relative'
			left = '-35px';
			top = '207px'
			width = '45px';
			height = '45px';
			zIndex = '99';
		}
		Event.observe(mapImg, 'click', function(){
			window.open('map.html','map','left=0,top=0,width=350px,height=350px,status=0,scrollbars=0,menubar=0,location=0,toolbar=0,resizable=0');
		});
		var womanImg = document.createElement('img');
		womanImg.src = 'img/salon_guide/back_woman.png';
		Element.addClassName(womanImg,'iepngfix');
		with(womanImg.style){
			position = 'relative';
			left = '-5px';
			top = '230px';
			width = '218px';
			height = '95px';
			zIndex = '100';
		}
		iconDiv.appendChild(document.createElement('br'));
		iconDiv.appendChild(timeImg);
		iconDiv.appendChild(mapImg);
		iconDiv.appendChild(womanImg);
		IEPNGFIX.fix(timeImg);
		IEPNGFIX.fix(mapImg);
		IEPNGFIX.fix(womanImg);
		/*
		var circleMoveDiv = document.createElement('div');
		circleMoveDiv.id = 'circleMoveDiv';
		with (circleMoveDiv.style){
			width = '185px'
			height = '185px';
			position = 'relative';
			left = '430px';
			top = '-730px';
			zIndex = '100';
			cursor = 'pointer';
		}
		this.mainRight.appendChild(circleMoveDiv);
		Event.observe($('circleMoveDiv'),'mousedown',(function(e){
			$('salonIcon_0','salonIcon_1','salonIcon_2','salonIcon_3','salonIcon_4','mapIcon').each(function(obj){
				with(obj.style){
					zIndex = '99';
				}
			});
			this.pointX = Event.pointerX(e);
			this.pointY = Event.pointerY(e);
			this.targetLeft = parseFloat($('circleMoveDiv').style.left);
			this.targetTop = parseFloat($('circleMoveDiv').style.top);
			if(!this.photoDiv.style.backgroundPositionX){
				this.targetBackLeft = parseFloat(this.photoDiv.style.backgroundPosition.split(' ')[0]);
				this.targeBacktTop = parseFloat(this.photoDiv.style.backgroundPosition.split(' ')[1]);
			} else {
				this.targetBackLeft = parseFloat(this.photoDiv.style.backgroundPositionX);
				this.targeBacktTop = parseFloat(this.photoDiv.style.backgroundPositionY);
			}
			this.drag = true;
			Event.observe($('circleMoveDiv'),'mousemove',this.salonMoveBack.bind(this),false);
			if(document.all){
				$('circleMoveDiv').setCapture();
			}
		}).bind(this));
		Event.observe($('circleMoveDiv'),'mouseup',(function(e){
			this.drag = false;
			$('salonIcon_0','salonIcon_1','salonIcon_2','salonIcon_3','salonIcon_4','mapIcon').each(function(obj){
				with(obj.style){
					zIndex = '101';
				}
			});
			if(document.all){
				$('circleMoveDiv').releaseCapture();
			}
		}).bind(this),false);
	*/
			if(this.animateCircle) clearInterval(this.animateCircle);
      this.a = 150; // 横方向移動量
      this.b = 0.005; // 勾配

      this.yoko = -660; //x方向表示位置
      this.tate = -785; //y方向表示位置

      // 変数
      this.x = 0;
      this.y = 0;
      this.direction = "inc";
      this.animateCircle = setInterval((function() {
        if (this.direction == "inc") {
          if ((this.x >= 0) && (this.x <= this.a*2)) {
          this.y = this.b * (Math.pow((this.x-this.a),2) - Math.pow(this.a,2));
        }
        else if ((this.x < 0) && (this.x >= 0 - this.a*2)) {
          this.y = this.b * (0 - Math.pow((this.x+this.a),2) + Math.pow(this.a,2));
        }
      	}
      	else if (this.direction == "dec") {
      		if ((this.x >= 0) && (this.x <= this.a*2)) {
      			this.y = this.b * (0 - Math.pow((this.x-this.a),2) + Math.pow(this.a,2));
      		}
      		else if ((this.x < 0) && (this.x >= 0 - this.a*2)) {
      			this.y = this.b * (Math.pow((this.x+this.a),2) - Math.pow(this.a,2));
      		}
      	}
      	window.status = this.photoDiv.style.backgroundPosition;
      	var yox = this.yoko + this.x + "px";
      	var yoy = this.tate + this.y + "px";
      	with (this.photoDiv.style){
					backgroundPosition = yox + " "+yoy;
				}
      	if (this.direction == "inc") {
      		if (this.x < this.a*2) this.x+=5;
      		else { this.direction = "dec"; this.x-=5; }
      	}
      	else if (this.direction == "dec") {
      		if (this.x > 0-this.a*2) this.x-=5;
      		else { this.direction = "inc"; this.x+=5; }
      	}
      }).bindAsEventListener(this),80);
	},
	salonMoveBack : function(e){
		if(this.drag){
			var moveX = Event.pointerX(e);
			var moveY = Event.pointerY(e);
			var moveLeft = (this.targetLeft + (moveX - this.pointX));
			var moveTop = (this.targetTop + (moveY - this.pointY));
			var moveBackLeft = (this.targetBackLeft + (moveX - this.pointX))+'px';
			var moveBackTop = (this.targeBacktTop + (moveY - this.pointY))+'px';
			if( moveLeft > -85 && moveLeft < 580 && moveTop > -930 && moveTop < -540){
				with ($('circleMoveDiv').style){
					left = moveLeft + 'px';
					top = moveTop + 'px';
				}
				with (this.photoDiv.style){
					backgroundPosition = moveBackLeft+' '+moveBackTop;
				}
			}
		}
	},
	recruitmentFunc : function(historyTop){
		this.flag = false;
		this.mainRight.style.overflow = 'hidden';
		this.mainRight.style.backgroundImage = '';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.backDivSet(null,historyTop);
		this.changeMenuButton(this.recruitmentButton);
		this.mainRight.style.border = "0px";
		var iframeFrameDiv = document.createElement('div');
		with (iframeFrameDiv.style){
			width = '100%';
			height = '100%';
			padding = '0px';
			backgroundColor = '#DCDCDC';
		}
		var iframeDiv = document.createElement('div');
		with (iframeDiv.style){
			width = '100%';
			height = '100%';
			padding = '0px 0px';
			backgroundColor = '#DCDCDC';
		}
		this.mainRight.innerHTML="";
		iframeFrameDiv.appendChild(iframeDiv);
		this.mainRight.appendChild(iframeFrameDiv);
		this.recruitmentIframe = document.createElement('iframe');
		this.recruitmentIframe.id = 'rec_frame'
		this.recruitmentIframe.name = 'recruitmentFrame';
		this.recruitmentIframe.frameBorder = '0';
		this.recruitmentIframe.marginHeight = '0';
		this.recruitmentIframe.marginWidth = '0';
		with (this.recruitmentIframe.style){
			width = this.mainRightWidth - 1+'px';
			height = '100%';
			padding = '0px';
			fontSize = '1px';
		}
		this.recruitmentIframe.src = './recruitment.html';
		iframeDiv.appendChild(this.recruitmentIframe);
	},
	contactFunc : function(){
		location.href="mailto:press@air-hairmake.com";
	},
	
	linkFunc : function(historyTop){
		this.mainRight.style.overflow = 'hidden';
		$('top','concept','style_catalog','price_menu','staff','salon_guide','recruitment','link','contact','blog').each(function(menuDiv){
			menuDiv.style.visibility = 'visible';
		});
		this.changeMenuButton(this.linkButton);
		this.backDivSet(null,historyTop);
		this.mainRight.style.border = "solid 1px #505050";
		this.mainRight.style.background = "url('img/company/back_company.gif') center no-repeat";
	},
	
	blogFunc : function(){
		window.open('http://blog.livedoor.jp/airpress/');
	},
	infoFunc : function(){
		window.open('information.html','information','left=0,top=0,width=500px,height=750px,status=no,menubar=no,location=no,toolbar=no,resizable=no,scrollbars=yes');
	},
	
	changeMenuButton: function(changeObj){
		if(this.cache.src != changeObj.src){
			if(this.cache.src){
				if(this.cache.src.match('_on_over')){
					this.cache.src = this.cache.src.split("_on_over")[0]+".gif";
				} else if(this.cache.src.match('_over')){
					this.cache.src = this.cache.src.split("_over")[0]+".gif";
				} else if(this.cache.src.match('_on')) {
					this.cache.src = this.cache.src.split("_on")[0]+".gif";
				} 
			}
		}
		if (changeObj.id != 'topButton'){
			if(changeObj.src.match('_on_over')){
				changeObj.src = changeObj.src;
			} else if(changeObj.src.match('_over')){
				changeObj.src = changeObj.src.split("_over")[0]+"_on_over.gif";
			} else if(changeObj.src.match('_on')) {
				changeObj.src = changeObj.src.split("_on")[0]+"_on.gif";
			} else {
				changeObj.src = changeObj.src.split(".gif")[0]+"_on.gif";
			}
			this.cache = changeObj;
		}
	},
	backDivSet : function(imgNum,historyTop,showObj){
		clearInterval(this.setTimer);
		if($('backDiv')){
			Element.remove('backDiv');
		}
		var backDiv = document.createElement('div');
		backDiv.id = "backDiv";
		if(imgNum != null){
			var imgUrl = this.changeBack[imgNum].src;
		}
		with(backDiv.style){
			if(imgNum != null){
				background = "url("+imgUrl+") 50% no-repeat";
			}
			if(document.all){
				top = "0px";
				left = "0px";
				height = this.mainRight.offsetHeight-2+"px";
				width = this.mainRightWidth-2+"px";
			} else {
				top = $('right').offsetTop+$('right').parentNode.parentNode.offsetTop+1+"px";
				left = $('right').offsetLeft+$('right').parentNode.parentNode.offsetLeft+1+"px";
				height = "422px";
				width = "680px";
			}
			position = "absolute";
			zIndex = "999";
		}
		if(historyTop){
			var whiteDiv = document.createElement('div');
			whiteDiv.id = "whiteDiv";
			with(whiteDiv.style){
				background = '#ffffff';
				position = 'absolute';
			if(document.all){
				top = "-1px";
				left = "-1px";
				height = this.mainRightHeight+1+"px";
				width = this.mainRightWidth+1+"px";
			} else {
				top = "-1px";
				left = "-1px";
				height = "424px";
				width = "682px";
			}
			}
			backDiv.appendChild(whiteDiv);
		}
		if(!showObj){
			this.mainRight.innerHTML = "";
		}
		this.mainRight.appendChild(backDiv);
		this.opa = 11;
		if(historyTop){
			this.setTimer = setInterval(this.whiteDivHidden.bindAsEventListener(this),100);
		} else {
			this.setTimer = setInterval(this.backDivHidden.bindAsEventListener(this),140);
		}
		if(showObj){
			setTimeout(function(){showObj.style.display = "";}.bindAsEventListener(this),100);
		}
	},
	backDivHidden: function(e){
		var backObj = $('backDiv');
		if(backObj){
			if(document.all){
				backObj.style.filter = "alpha(opacity="+this.opa*10+")";
			} else if (navigator.userAgent.indexOf("Safari") > -1){
				backObj.style.opacity = parseFloat(this.opa/10);
			} else {
				backObj.style.MozOpacity = parseFloat(this.opa/10);
			}
		}
		if(this.opa <= 0){
			clearInterval(this.setTimer);
			if($('backDiv')){
				Element.remove($('backDiv'));
			}
		} else {
			this.opa = this.opa-1;
		}
	},
	whiteDivHidden : function(e){
		var whiteObj = $('whiteDiv');
		if(whiteObj){
			if(document.all){
				whiteObj.style.filter = "alpha(opacity="+this.opa*10+")";
			} else if (navigator.userAgent.indexOf("Safari") > -1){
				whiteObj.style.opacity = parseFloat(this.opa/10);
			} else {
				whiteObj.style.MozOpacity = parseFloat(this.opa/10);
			}
		}
		if(this.opa <= 0){
			clearInterval(this.setTimer);
			this.opa=11;
			this.setTimer = setInterval(this.backDivHidden.bindAsEventListener(this),140);
		} else {
			this.opa = this.opa-1;
		}
	},
	jik : 0,
	flag : false,
	handleDIV : function(e) {
		this.vv = Event.wheel(e);
		var targetDiv = this.staffIframe;
		this.scrollPosition = targetDiv.contentWindow.document.body.scrollTop;
		var chkScroll = this.scrollPosition + targetDiv.offsetHeight;
		var iframeScrollHeight = targetDiv.scrollHeight;
		var IFSscrollTop = iframeScrollHeight - targetDiv.offsetHeight;
		if(this.vv < 0){

				this.scrollPosition -= 40 * this.vv;
				targetDiv.contentWindow.scroll(0,this.scrollPosition);
				//targetDiv.scrollTop = this.scrollPosition;
		} else {
			if(this.scrollPosition > 0){
					this.scrollPosition -= 40 * this.vv;
				targetDiv.contentWindow.scroll(0,this.scrollPosition);
				//targetDiv.scrollTop = this.scrollPosition;
			} else {
				this.scrollPosition = 0;
				targetDiv.contentWindow.scroll(0,0);
				//targetDiv.scrollTop = 0;
			}
		}
		//window.status = this.scrollPosition;
	},
	scrollMoveEvent : function(e){
	//window.status = $("staff");
		var _moveY = this.moveY;
		var _top = this.moveTop;
		var _moveYnow = Event.pointerY(e);
		var _ms = _top+_moveYnow-_moveY;
		window.status = _moveYnow+'px';
		var ifs = $("staff").scrollHeight;
		var chkScroll = ifs - $("staff").offsetHeight;
		if(_ms >= 0){
			this.scrollPosition += _ms;
			//window.status = this.scrollPosition;
			frames[0].scroll(0,this.scrollPosition);
		}
		if(_ms <= 0){
			frames[0].scroll(0,0);
		}
	}
}
