// JavaScript Document
//
function getOSType() { 
	var uAgent = navigator.userAgent.toUpperCase();
	if (uAgent.indexOf("MAC") >= 0) return "Mac";
	if (uAgent.indexOf("WIN") >= 0) return "Win";
	if (uAgent.indexOf("X11") >= 0) return "UNI";
	return "";
}
function getBrowserName() { 
	var aName = navigator.appName.toUpperCase();
	var uName = navigator.userAgent.toUpperCase();
	if (uName.indexOf("SAFARI") >= 0) return "Safari";
	if (uName.indexOf("OPERA") >= 0) return "Opera";
	if (uName.indexOf("FIREFOX") >= 0) return "Firefox";
	if (aName.indexOf("NETSCAPE") >= 0) return "Netscape";
	if (aName.indexOf("MICROSOFT") >= 0) return "Explorer";
	return "";
}
//if(getOSType() == "Mac" && getBrowserName() != "Firefox"){
//MACかつFFOX以外だったら
//setInterval("setLayer()",50);
//}else{
//
window.onscroll = function(){
setLayer();
}
//}
//
//
//
function checkBrowser(){
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) return "Safari";
	if (uName.indexOf("MSIE") > -1) return "MSIE";
	return "Netscape";
}
//
function setLayer(){
	var browser =checkBrowser() ;
	var YY;
	if(browser == "MSIE"){
		YY = document.body.scrollTop;
	}else {
		YY = window.pageYOffset;
	}
	window.document.scr.SetVariable("_level0.scr_txt",YY);
}
//
//
//
//自動スクロール
//function scr_DoFSCommand(command, str){
	//scroller();
//	goLast('last');
//}
function goLast(point){
  xWinScrollTo(window, 0, point, 5000);
  return false;
}
var xWinScrollWin = null;
function xWinScrollTo(win,x,y,uTime){
  var e = win;
  if (!e.timeout) e.timeout = 25;
  var st = xScrollTop(e, 1);
  var sl = xScrollLeft(e, 1);
  e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;
  e.yA = e.yTarget - st;
  e.xA = e.xTarget - sl; // A = distance
  if (e.slideLinear) e.B = 1/e.slideTime;
  else e.B = Math.PI / (2 * e.slideTime); // B = period
  e.yD = st;
  e.xD = sl; // D = initial position
  var d = new Date(); e.C = d.getTime();
  if (!e.moving) {
    xWinScrollWin = e;
    _xWinScrollTo();
  }
}
function _xWinScrollTo(){
  var e = xWinScrollWin || window;
  var now, s, t, newY, newX;
  now = new Date();
  t = now.getTime() - e.C;
  if (e.stop) { e.moving = false; }
  else if (t < e.slideTime) {
    setTimeout("_xWinScrollTo()", e.timeout);

    s = e.B * t;
    if (!e.slideLinear) s = Math.sin(s);
//    if (e.slideLinear) s = e.B * t;
//    else s = Math.sin(e.B * t);

    newX = Math.round(e.xA * s + e.xD);
    newY = Math.round(e.yA * s + e.yD);
    e.scrollTo(newX, newY);
    e.moving = true;
  }  
  else {
    e.scrollTo(e.xTarget, e.yTarget);
    xWinScrollWin = null;
    e.moving = false;
    if (e.onslideend) e.onslideend();
  }  
}
//-------------------------------------

//レイヤー制御

//-------------------------------------



/* test.js compiled from X 4.0 with XC 0.28b. Distributed under GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xAddEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e))) return;eT=eT.toLowerCase();if((!xIE4Up && !xOp7Up) && e==window) {if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }}var eh='e.on'+eT+'=eL';if(e.addEventListener) e.addEventListener(eT,eL,cap);else if(e.attachEvent) e.attachEvent('on'+eT,eL);else eval(eh);}function xResizeEvent(){if (window.xREL) setTimeout('xResizeEvent()', 250);var cw = xClientWidth(), ch = xClientHeight();if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }}function xScrollEvent(){if (window.xSEL) setTimeout('xScrollEvent()', 250);var sl = xScrollLeft(), st = xScrollTop();if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }}function xClientHeight(){var h=0;if(xOp6Dn) h=window.innerHeight;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)h=document.documentElement.clientHeight;else if(document.body && document.body.clientHeight)h=document.body.clientHeight;else if(xDef(window.innerWidth,window.innerHeight,document.width)) {h=window.innerHeight;if(document.width>window.innerWidth) h-=16;}return h;}function xClientWidth(){var w=0;if(xOp6Dn) w=window.innerWidth;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)w=document.documentElement.clientWidth;else if(document.body && document.body.clientWidth)w=document.body.clientWidth;else if(xDef(window.innerWidth,window.innerHeight,document.height)) {w=window.innerWidth;if(document.height>window.innerHeight) w-=16;}return w;}function xDef(){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}return true;}function xGetElementById(e){if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);else if(document.all) e=document.all[e];else e=null;return e;}function xLeft(e, iX){if(!(e=xGetElementById(e))) return 0;var css=xDef(e.style);if (css && xStr(e.style.left)) {if(xNum(iX)) e.style.left=iX+'px';else {iX=parseInt(e.style.left);if(isNaN(iX)) iX=0;}}else if(css && xDef(e.style.pixelLeft)) {if(xNum(iX)) e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}return iX;}function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y);}function xNum(){for(var i=0; i<arguments.length; ++i){if(isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;}return true;}function xPageY(e){if (!(e=xGetElementById(e))) return 0;var y = 0;while (e) {if (xDef(e.offsetTop)) y += e.offsetTop;e = xDef(e.offsetParent) ? e.offsetParent : null;}return y;}function xScrollLeft(e, bWin){var offset=0;if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {var w = window;if (bWin && e) w = e;if(w.document.documentElement && w.document.documentElement.scrollLeft) offset=w.document.documentElement.scrollLeft;else if(w.document.body && xDef(w.document.body.scrollLeft)) offset=w.document.body.scrollLeft;}else {e = xGetElementById(e);if (e && xNum(e.scrollLeft)) offset = e.scrollLeft;}return offset;}function xScrollTop(e, bWin){var offset=0;if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {var w = window;if (bWin && e) w = e;if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;}else {e = xGetElementById(e);if (e && xNum(e.scrollTop)) offset = e.scrollTop;}return offset;}function xSlideTo(e, x, y, uTime){if (!(e=xGetElementById(e))) return;if (!e.timeout) e.timeout = 25;e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); if (e.slideLinear) e.B = 1/e.slideTime;else e.B = Math.PI / (2 * e.slideTime); e.yD = xTop(e); e.xD = xLeft(e); var d = new Date(); e.C = d.getTime();if (!e.moving) _xSlideTo(e);}function _xSlideTo(e){if (!(e=xGetElementById(e))) return;var now, s, t, newY, newX;now = new Date();t = now.getTime() - e.C;if (e.stop) { e.moving = false; }else if (t < e.slideTime) {setTimeout("_xSlideTo('"+e.id+"')", e.timeout);if (e.slideLinear) s = e.B * t;else s = Math.sin(e.B * t);newX = Math.round(e.xA * s + e.xD);newY = Math.round(e.yA * s + e.yD);xMoveTo(e, newX, newY);e.moving = true;}  else {xMoveTo(e, e.xTarget, e.yTarget);e.moving = false;}  }function xStr(s){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}return true;}function xTop(e, iY){if(!(e=xGetElementById(e))) return 0;var css=xDef(e.style);if(css && xStr(e.style.top)) {if(xNum(iY)) e.style.top=iY+'px';else {iY=parseInt(e.style.top);if(isNaN(iY)) iY=0;}}else if(css && xDef(e.style.pixelTop)) {if(xNum(iY)) e.style.pixelTop=iY;else iY=e.style.pixelTop;}return iY;}
/*
var speed = 3; // スクロールのスピード（1に近いほど速く）
var move = 30; // スクロールのなめらかさ（1に近いほどなめらかに）
var y = 0;
var ny = 0;
function scroller(){
	window.scrollBy(0, move); // スクロール処理
	var rep = setTimeout("scroller()", speed);
	// スクロール位置をチェック（IE用）
	if(document.all){
		y = document.body.scrollTop;
	}
	// スクロール位置をチェック（NN用）
	else if(document.layers || document.getElementById){
		y = window.pageYOffset;
	}
	if(ny == y){ // スクロールし終わっていたら処理を終了
		clearTimeout(rep);
	}else{
		ny = y;
	}
}
*/

//
//
function side_function(){
var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="2800" id="scr" align="middle">'
+ '<param name="allowScriptAccess" value="sameDomain" />'
+ '<param name="movie" value="banner01/banner.swf" />'
+ '<param name="quality" value="high" />'
+ '<param name="bgcolor" value="#000000" />'
+ '<embed src="banner01/banner.swf" quality="high" bgcolor="#000000" swLiveConnect=true width="160" height="2800" name="scr" id="scr" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
+ '</object><br>'
+ '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="2800" id="scr2" align="middle">'
+ '<param name="allowScriptAccess" value="sameDomain" />'
+ '<param name="movie" value="banner01/banner2.swf" />'
+ '<param name="quality" value="high" />'
+ '<param name="bgcolor" value="#000000" />'
+ '<embed src="banner01/banner2.swf" quality="high" bgcolor="#000000" swLiveConnect=true width="160" height="2800" name="scr2" id="scr2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
+ '</object><br>'
+ '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="1400" id="scr3" align="middle">'
+ '<param name="allowScriptAccess" value="sameDomain" />'
+ '<param name="movie" value="banner01/banner3.swf" />'
+ '<param name="quality" value="high" />'
+ '<param name="bgcolor" value="#000000" />'
+ '<embed src="banner01/banner3.swf" quality="high" bgcolor="#000000" swLiveConnect=true width="160" height="1400" name="scr3" id="scr3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
+ '</object>'
document.write(oeTags);
};

function under_function(){
var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="920" height="320" hspace="0" vspace="0" align="middle">'
+ '<param name="allowScriptAccess" value="sameDomain" />'
+ '<param name="movie" value="banner01/banner4.swf" />'
+ '<param name="quality" value="high" />'
+ '<param name="bgcolor" value="#000000" />'
+ '<embed src="banner01/banner4.swf" width="920" height="320" hspace="0" vspace="0" align="middle" quality="high" bgcolor="#000000" swLiveConnect=true id="scr4" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
+ '</object>'
document.write(oeTags);
};
	
