// JavaScript Document

/*
var oWind_ChimeLayer = "";
var Wind_Chime_flashvars_labels = ["myUrl"];
var Wind_Chime_flashvars_values = [location.host];//location.hostnameにすると、ホスト名を取得しますよ。
var Wind_Chime_zIndex = 1;
*/

function showHeadMenu() {


	//var lay = document.createElement('div');
	var lay = document.getElementById('headmenu');
	
	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='516' height='170'>";
	str += "<param name='movie' value='/swf/menu.swf' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='wmode' value='transparent' />";
	str += "<param name='quality' value='high' /> ";
	str += "<embed src='/swf/menu.swf' loop='False' menu='false' quality='high' wmode='transparent'";
	str += "width='516' height='170'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	
	lay.zIndex = 200;
	lay.innerHTML = str;
	//document.body.appendChild(lay);

/*
	eventObserve(window, 'load', loadWindChime, false);
	//window.scrollにscrollWind_Chimeイベントハンドラを追加
	eventObserve(window, 'scroll', scrollWindChime, false);
	//window.resizeにresizeToolイベントハンドラを追加
	eventObserve(window, 'resize', resizeWindChime, false);
	//スクロールバー対策
	document.getElementsByTagName("html")[0].style.overflow="scroll";
*/
}


function showFlash(fname, fwidth, fheight, fbgcolor) {
	
	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='" + fwidth + "' height='" + fheight + "'>";
	str += "<param name='movie' value='" + fname + "' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='quality' value='high' /> ";
	str += "<param name='bgcolor' value='" + fbgcolor + "' /> ";
	str += "<embed src='" + fname + "' loop='False' menu='false' quality='high' bgcolor='" + fbgcolor + "'";
	str += "width='" + fwidth + "' height='" + fheight + "'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	document.write(str);

}

function showFlash_transparent(fname, fwidth, fheight) {
	
	/* 100% 表示だとだめみたいなので整数をわたす
	fwidth = screen.availWidth;
	fheight = screen.availHeight;
	*/
	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='" + fwidth + "' height='" + fheight + "'>";
	str += "<param name='movie' value='" + fname + "' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='scale' value='noScale' /> ";
	str += "<param name='salign' value='TL' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='wmode' value='transparent' />";
	str += "<param name='quality' value='high' /> ";
	str += "<embed src='" + fname + "' loop='false' menu='false' scale='noScale' salign='TL' quality='high' wmode='transparent'";
	str += "width='" + fwidth + "' height='" + fheight + "'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	document.write(str);

}

function showPhotoFlash(fname, l_title, s_title) {

	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='900' height='150'>";
	str += "<param name='movie' value='/swf/photoframe.swf' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='quality' value='high' /> ";
	str += "<param name='wmode' value='transparent' />";
	str += "<param name='FlashVars' value='fname=" + fname + "&amp;l_title=" + l_title + "&amp;s_title=" + s_title + "' />";
	str += "<embed src='/swf/photoframe.swf' FlashVars='fname=" + fname + "&amp;l_title=" + l_title + "&amp;s_title=" + s_title + "' loop='False' menu='false' quality='high' wmode='transparent'";
	str += "width='900' height='150'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	
	document.write(str);
}

function showHoleFlash(fname, photo_num) {

	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='320' height='240'>";
	str += "<param name='movie' value='/course/images/hole/hole.swf' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='quality' value='high' /> ";
	str += "<param name='FlashVars' value='foldername=" + fname + "&amp;photonum=" + photo_num + "' />";
	str += "<embed src='/course/images/hole/hole.swf' FlashVars='foldername=" + fname + "&amp;photonum=" + photo_num + "' loop='False' menu='false' quality='high'";
	str += "width='320' height='240'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	
	document.write(str);
}


function showCommentFlash(bid) {

	var str = '';
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	str += "codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
	str += "width='585' height='200'>";
	str += "<param name='movie' value='comment.swf' />";
	str += "<param name='loop' value='false' /> ";
	str += "<param name='menu' value='false' /> ";
	str += "<param name='quality' value='high' /> ";
	str += "<param name='bgcolor' value='#E9F8DA' /> ";
	str += "<param name='FlashVars' value='bid=" + bid + "' />";
	str += "<embed src='comment.swf' FlashVars='bid=" + bid + "' loop='False' menu='false' quality='high' bgcolor='#E9F8DA'";
	str += "width='585' height='200'";
	str += "type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer'></embed>";
	str += "</object>";
	document.write(str);
}

function showFooter() {

	var str = '';
	str += '<table width="900" border="0" celpadding="0">';
	str += '  <tr><td class="pathbox">';
	str += showPathBox();
	str += '	</td>';
	str += '    <td align="right" width=130>';
	str += '	<a href="javascript:pageTopScroll();" id="page_top" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'pagetop\',\'\',\'\/images/common/pagetop2.jpg\',1);">';
	str += '	<img src="/images/common/pagetop1.jpg" alt="ページ上部へ" border="0" name="pagetop" id="pagetop" /></a></td>';
	str += ' </tr></table>';

	str += '<img src="/images/common/mainfoot.jpg" width="900" height="40" border="0" usemap="#footer" />';
	str += '<map name="footer" id="footer"><area shape="rect" coords="1,8,37,23" href="/" alt="ホーム" />';
	str += '<area shape="rect" coords="68,9,118,23" href="/extra/sitemap.html" alt="サイトマップ" />';
	str += '<area shape="rect" coords="153,9,213,24" href="/extra/policy.html" alt="サイトポリシー" />';
	str += '</map>';
	
	document.write(str);
}


function showPathBox() {
	
	var fpath = new Array();
	
	fpath['intro']        = '<a href="http://www.orion-agc.co.jp/intro/index.html">施設のご案内</a>';
	fpath['course'] = '<a href="http://www.orion-agc.co.jp/course/index.html">コース</a>';
	fpath['reserve']         = '<a href="http://www.orion-agc.co.jp/reserve/index.html">ご予約</a>';
	fpath['topics']  = '<a href="http://www.orion-agc.co.jp/topics/index.html">トピックス</a>';
	fpath['note']  = '<a href="http://www.orion-agc.co.jp/topics/note/note.php">Master\'s Note</a>';


	//タイトル文字の取得
	var str_title = new String(document.title);
	var title_text = str_title.split('-');
	
	//パスの取得
	var url = document.location.href;
	var dir = url.split('/');
	
	//ホームから順にパスをつくるよ
	var str = '<a href="http://www.orion-agc.co.jp/">ホーム</a>';
	
	// [0] = http: / [1] = / [2] = www.orion-agc.co.jp/ なので3からはじめるよ
	for (i = 3; i < dir.length; i++) {
		
		//ピリオドがあったらファイル名とし、最後の配列要素とみなす。リンクはつけない
		//location.hrefの最後が、'index.html'　の場合はページタイトルを表示しない
		var fname = new String(dir[i]);
		
		if (fname.indexOf('.') != -1) {
			
			str += ' / ' + title_text[0];

		} else {
		
			if (fpath[dir[i]] != undefined) {
				
				str += ' / ' + fpath[dir[i]];
			}
		}
	}
	
	return str;
	
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;



// Visual basic helper required to detect Flash Player ActiveX control version information
if( isIE && isWin ){
	document.open();
	document.write('<scr' + 'ipt type="text/vbscript">'+'\n');
	document.write('Function VBGetSwfVer(i)'+'\n');
	document.write('on error resume next'+'\n');
	document.write('Dim swControl, swVersion'+'\n');
	document.write('swVersion = 0'+'\n');
	document.write('set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))'+'\n');
	document.write('if (IsObject(swControl)) then'+'\n');
	document.write('swVersion = swControl.GetVariable("$version")'+'\n');
	document.write('end if'+'\n');
	document.write('VBGetSwfVer = swVersion'+'\n');
	document.write('End Function'+'\n');
	document.write('<\/scr' + 'ipt\>'+'\n');
	document.close();
}



// Detect Client Browser type
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		} else {
			flashVer = -1;
		}
	}
// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
// Can't detect in all other cases
	else {
		flashVer = -1;
	}
	return flashVer;
}


// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);
		}
		if (versionStr == -1 ) {
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray = versionStr.split(" ");
				tempString = tempArray[1];
				versionArray = tempString .split(",");
			} else {
				versionArray = versionStr.split(".");
			}
			versionMajor = versionArray[0];
			versionMinor = versionArray[1];
			versionRevision = versionArray[2];
			
			versionString = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum = parseFloat(versionString);
// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if( versionMajor == reqMajorVer ){
				if( versionMinor == reqMinorVer ){
					return ( versionRevision >= reqRevision );
				}else{
					return( versionMinor > reqMinorVer );
				}
			}else{
				return ( versionMajor > reqMajorVer );
			}
		}
	}	
}








function detectFlash( o ){
	var requiredMajorVersion = ( o.requiredMajorVersion ) ? o.requiredMajorVersion : 8;
	var requiredMinorVersion = ( o.requiredMinorVersion ) ? o.requiredMinorVersion : 0;
	var requiredRevision = ( o.requiredRevision ) ? o.requiredRevision : 0;
	var jsVersion = 1.0;

	var hasProductInstall = DetectFlashVer(6, 0, 65);
	var hasRequiredVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

	var MMredirectURL = window.location;

	if ( hasProductInstall ) {
		var codes = '';

		if( hasRequiredVersion ){
			var swfA = o.swf;
			var swfP = o.swf;
		}else{
			if( o.swfInstall ){
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				var MMdoctitle = document.title;

				var swfA = o.swfInstall + '?MMredirectURL='+MMredirectURL+'&MMplayerType=ActiveX&MMdoctitle='+MMdoctitle;
				var swfP = o.swfInstall + '?MMredirectURL='+MMredirectURL+'&MMplayerType=PlugIn&MMdoctitle='+MMdoctitle;
			}else{
				location.replace(o.substitute);
				return;
			}
		}

		codes += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + o.name + '" width="' + o.width + '" height="' + o.height + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';
		codes += '<param name="movie" value="' + swfA + '" />';
		codes += '<param name="quality" value="' + o.quality + '" />';
		codes += '<param name="bgcolor" value="' + o.bgcolor + '" />';
		codes += '<param name="flashvars" value="' + o.flashvars + '" />';
		codes += "<param name='scale' value='noScale' /> ";
		codes += "<param name='salign' value='TL' /> ";
		codes += '<param name="loop" value="' + o.loop + '" />';
		codes += '<param name="menu" value="' + o.menu + '" />';
		codes += '<param name="wmode" value="' + o.wmode + '" />';
		codes += '<embed src="' + swfP + '" scale="noScale" salign="TL" quality="' + o.quality + '" bgcolor="' + o.bgcolor + '" width="' + o.width + '" height="' + o.height + '" name="' + o.name + '" flashvars="' + o.flashvars + '" wmode="' + o.wmode + '" loop="' + o.loop + '" menu="' + o.menu + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
		codes += '<\/embed>';
		codes += '<\/object>';

		document.open();
		document.write(codes);
		document.close();
	}else{
		location.replace(o.substitute);
	}


}


<!--
function getFullscreen( url ){
	var isWin=(navigator.appVersion.indexOf("Win")!=-1)? true : false;
	var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)? true : false;

	if(screen.availHeight > 1050 || screen.availWidth > 1680){

		var ah=1050;
		var aw=1680;
		var h = Math.floor( (screen.availHeight-ah)/2 );
		var w = Math.floor( (screen.availWidth-aw)/2 );

		var str="screenX=0,screenY=0";
		str = ",top="+h+",left="+w;

		if(window.screen){
			str+=",height="+ah;
			str+=",width="+aw;
		}

		var tmp=window.open(url,'orion',str);
		tmp.resizeTo(aw,ah);

	}else{
		if(isWin&&isIE){
			window.open(url,'orion','fullscreen=yes');
		}else{
			var str="left=0,screenX=0,top=0,screenY=0";
			if(window.screen){
				var ah=screen.availHeight;
				var aw=screen.availWidth;
				str+=",height="+ah;
				str+=",width="+aw;
			}

			var tmp=window.open(url,'orion',str);
			tmp.moveTo(0,0);
			tmp.resizeTo(aw,ah);
		}
	}
}

function pageTopScroll() {
	var scrj = 1;
   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat") {
      var scdist = document.body.parentNode.scrollTop;
   } else {
      var scdist = document.body.scrollTop;
   }
   if(scrj<50 && scdist) {
      scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;
      scrj++;
      scrollBy(0,-scdist);
      setTimeout("pageTopScroll()",20);
   } else {
      scrollTo(0,0);
      scrj = 1;
   }
}


/***************************************

flash menu用

****************************************/

function SWFLayer(){
	//コンストラクタ
	this.swf_url = "";
	this.swf_id = "Flash";
	this.layer_name = "";
	this.xx = 0;//windowに対してのX座標
	this.yy = 0;//windowに対してのY座標
	this.width = 1;
	this.height = 1;
	this.zIndex = 0;
	this.body = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];
	this._oLayer = "";

	this.flashvars_labels = [];
	this.flashvars_values = [];

	this._ww_full_flg = "false";
	this._hh_full_flg = "false";
}

//----------------------------
// SWFレイヤーを生成
//----------------------------
SWFLayer.prototype._createFlashVarsValue = function(){
	var value = "browser=" + this._checkBrowser() + "&";
	var flashvars_labels = this.flashvars_labels;
	var flashvars_values = this.flashvars_values;
	for(var i=0; i < flashvars_labels.length; i++){
		value += flashvars_labels[i] + "=" + flashvars_values[i] + "&";
	}
	value = value.substring(0,value.length - 1);
	return value;
};


SWFLayer.prototype.create = function(){
	var swf_url = this.swf_url;
	var swf_id = this.swf_id;
	var layer_name = this.layer_name;
	
	var html = "";
	html += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='100%' height='100%' id='"+swf_id+"' align='middle'>";
	html += "<param name='allowScriptAccess' value='always' />";

	if(this.flashvars_labels.length > 0){
		html += "<param name='flashvars' value='" + this._createFlashVarsValue() + "'>";
	}

	html += "<param name='movie' value='" + swf_url + "' /><param name='scale' value='noscale' /><param name='salign' value='lt' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><embed src='" + swf_url + "' quality='high' scale='noscale' salign='lt' wmode='transparent' width='100%' height='100%' name='"+swf_id+"' id='"+swf_id+"' swLiveConnect=true align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'";
	if(this.flashvars_labels.length > 0){
		html += " flashvars='" + this._createFlashVarsValue() + "'";
	}
	html += "/>";
	html += "</object>";

	var oLayer = document.createElement('div');
	oLayer.setAttribute('id',layer_name);
	//oLayer.style.background = "#FF0000";
	oLayer.innerHTML = html;
	oLayer.style.position = 'absolute';
	oLayer.style.zIndex = this.zIndex;
	document.body.appendChild(oLayer);
	this._oLayer = oLayer;

};

//----------------------------
// ブラウザ判定
//----------------------------
SWFLayer.prototype._checkBrowser = function(){
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) return "Safari";
	if (uName.indexOf("MSIE") > -1){
		return "MSIE";
	}
	return "Netscape";
};

//---------------------------------------------------------------
// レイヤーのサイズ設定(ww :"full" or 数値 , hh: "full" or 数値)
//---------------------------------------------------------------
SWFLayer.prototype.setSize = function(ww,hh){
	var browser = this._checkBrowser();
	//幅
	if(ww == 'full'){
		this._ww_full_flg = "true";
		if(browser == "MSIE"){
			this.width = this.body.clientWidth;
		}else if(browser == "Netscape"){
			this.width = window.innerWidth - 17;
		}else{
			this.width = window.innerWidth;
		}
	}else{
		this._ww_full_flg = "false";
		this.width = ww;
	}

	//高さ
	if(hh == 'full'){
		this._hh_full_flg = "true";
		if(browser == "MSIE"){
			this.height = this.body.clientHeight;
		}else if(browser == "Netscape"){
			this.height = window.innerHeight-17;
		}else{
			this.height = window.innerHeight;
		}
	}else{
		this._hh_full_flg = "false";
		this.height = hh;
	}
	this._oLayer.style.width = this.width + 'px';
	this._oLayer.style.height = this.height + 'px';
};


//--------------------------------------------------------------------
//レイヤーの位置設定(絶対位置)
//--------------------------------------------------------------------
SWFLayer.prototype.setPos = function(xx,yy){
	var browser = this._checkBrowser();

	this.xx = xx;
	this.yy = yy;

	//X座標
	if(browser == "MSIE"){
		this._oLayer.style.left = this.xx + this.body.scrollLeft + 'px';
		this._oLayer.style.top = this.yy + this.body.scrollTop + 'px';
	}else {
		this._oLayer.style.left = this.xx + pageXOffset + 'px';
		this._oLayer.style.top = this.yy + pageYOffset + 'px';
	}

};

//--------------------------------------------------------------------
//レイヤーの位置設定(絶対位置:固定)
//--------------------------------------------------------------------
SWFLayer.prototype.setPosFixed = function(xx,yy){

	this.xx = xx;
	this.yy = yy;

	//X座標
	this._oLayer.style.left = this.xx + 'px';
	this._oLayer.style.top = this.yy + 'px';

};

//--------------------------------------------------------------------
//レイヤーの位置設定(相対位置)
//--------------------------------------------------------------------

SWFLayer.prototype.setdPos = function(d_xx,d_yy){

	this.xx += d_xx;
	this.yy += d_yy;

	this.setPos(this.xx,this.yy);
};

//--------------------------------------------------------------------
//レイヤーの位置揃え str='left' or 'right'
//--------------------------------------------------------------------
SWFLayer.prototype.setWindowAlign = function(str){
	var browser = this._checkBrowser() ;
	if(str == 'right'){
		if(browser == "MSIE"){
			this.xx = this.body.clientWidth - this.width;
		}else {
			this.xx = window.innerWidth - this.width;
			//Mozilla系はスクロールバー分(17px)補正
			if(browser == "Netscape"){
				this.xx -= 17;
			}
		}
	}else{
		if(browser == "MSIE"){
			this.xx = 0;
		}else {
			this.xx = 0;
		}
	}


	this.setPos(this.xx,this.yy);
};

//--------------------------------------------------------------------
//レイヤーの位置揃え str='left' or 'right'(固定)
//--------------------------------------------------------------------
SWFLayer.prototype.setWindowAlignFixed = function(str){
//alert("aaa");
	var browser = this._checkBrowser() ;
	if(str == 'right'){
		if(browser == "MSIE"){
			this.xx = this.body.clientWidth - this.width + this.body.scrollLeft;
		}else {
			this.xx = window.innerWidth - this.width + pageXOffset;
			//Mozilla系はスクロールバー分(17px)補正
			if(browser == "Netscape"){
				this.xx -= 17;
			}
		}
	}else{
		if(browser == "MSIE"){
			this.xx = 370; //メニュー用に固定です！
		}else {
			this.xx = 0;
		}
	}


	this.setPosFixed(this.xx,this.yy);
};

//--------------------------------------------------------------------
//レイヤーの位置揃え str='top' or 'bottom'
//--------------------------------------------------------------------
SWFLayer.prototype.setWindowValign = function(str){
	//Y座標
	var browser = this._checkBrowser();
	if(str == 'bottom'){
		if(browser == "MSIE"){
			this.yy = this.body.clientHeight - this.height;
		}else {
			this.yy = window.innerHeight - this.height;
			//Mozilla系はスクロールバー分(17pxほど)補正
			if(browser == "Netscape"){
				this.yy -= 17;
			}
		}
	}else{
		if(browser == "MSIE"){
			this.yy = 0;
		}else {
			this.yy = 0;
		}
	}
	this.setPos(this.xx,this.yy);
};

//--------------------------------------------------------------------
//レイヤーの位置揃え str='top' or 'bottom'(固定)
//--------------------------------------------------------------------
SWFLayer.prototype.setWindowValignFixed = function(str){
	//Y座標
	var browser = this._checkBrowser();
	if(str == 'bottom'){
		if(browser == "MSIE"){
			//alert(this.body.scrollHeight);
			this.yy = this.body.scrollHeight - this.height;
		}else {
			this.yy = this.body.offsetHeight - this.height;
			//this.yy = window.innerHeight - this.height;
			//Mozilla系はスクロールバー分(17pxほど)補正
			if(browser == "Netscape"){
				this.yy -= 17;
			}
		}
	}else{
		if(browser == "MSIE"){
			this.yy = 0;
		}else {
			this.yy = 0;
		}
	}
	this.setPosFixed(this.xx,this.yy);
};

//--------------------------------------------------------------------
//レイヤーの表示/非表示(str = 'visible' or 'hidden')
//--------------------------------------------------------------------
SWFLayer.prototype.setVisible = function(str){
	this._oLayer.style.visibility = str;
};

//--------------------------------------------------------------------
//ウィンドウをリサイズしたときの補正(フローティング用)
//--------------------------------------------------------------------
SWFLayer.prototype.correctWindowSize = function(str){
	if(this._ww_full_flg == "true" && this._hh_full_flg == "true"){
		this.setSize("full","full");
	}
	else if(this._ww_full_flg == "true"){
		//alert("_ww_full_flg = true");
		this.setSize("full",this.height);
	}
	else if(this._hh_full_flg == "true"){
		//alert("_hh_full_flg = true");
		this.setSize(this.width,"full");
	}
};


//---------------------------------------------------------------------
// イベント登録
//---------------------------------------------------------------------
function eventObserve(obj,e, func, bool){
	if (obj.addEventListener){
		obj.addEventListener(e, func, bool)
	}else if (obj.attachEvent){
		obj.attachEvent("on" + e, func)
	}
}



//--------------------------------------------------------------------
//load時の処理
//--------------------------------------------------------------------
function loadWindChime(data){
	oWind_ChimeLayer = new SWFLayer();
	oWind_ChimeLayer.zIndex = Wind_Chime_zIndex;
	oWind_ChimeLayer.swf_url = "/swf/menu.swf";
	oWind_ChimeLayer.swf_id = "menu_swf";
	oWind_ChimeLayer.layer_name = "menu_layer";
	
	oWind_ChimeLayer.flashvars_labels = Wind_Chime_flashvars_labels;
	oWind_ChimeLayer.flashvars_values = Wind_Chime_flashvars_values;
	
	oWind_ChimeLayer.create();
	oWind_ChimeLayer.setSize(516,170);//win IEでは必須
	oWind_ChimeLayer.setWindowAlignFixed('left');
	oWind_ChimeLayer.setWindowValignFixed('top');
	if(checkBrowser() == "Safari"){
		window.resizeBy(1,0);
	}
}


//--------------------------------------------------------------------
//scroll時の処理
//--------------------------------------------------------------------
function scrollWindChime(){
	oWind_ChimeLayer.setWindowAlignFixed('left');

}


//--------------------------------------------------------------------
//resize時の処理
//--------------------------------------------------------------------
function resizeWindChime(){
	oWind_ChimeLayer.setWindowAlignFixed('left');

}

//--------------------------------------------------------------------
//カスタム
//--------------------------------------------------------------------

function hideWind_Chime(){
	oWind_ChimeLayer.setVisible("hidden");
}

function setClose(){
	oWind_ChimeLayer.setSize(0,0);
}

function checkBrowser(){
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) return "Safari";
	if (uName.indexOf("MSIE") > -1){
		return "MSIE";
	}
	return "Netscape";
};



