function SymError()
{
return true;
}

window.onerror = SymError;

function gourl(parts){
	URL=parts.options[parts.selectedIndex].value;
	location=URL;
}

function disp(parts){
	URL=parts.options[parts.selectedIndex].value;
	window.open(URL, "window_name", "");
}

var gDivName;
var gObject;
var gDisU;
var gDisD;
var gCurPosY;
var gIniPosY;
var gFilDisY = 0;
var gwFilDisY = 0;
var gTurnFlg = 0;

function VersionGet() {
	this.ver   = navigator.appVersion;
	this.agent = navigator.userAgent;
	this.dom   = document.getElementById ? 1 : 0;
	this.mac   = (this.agent.indexOf("Mac") > -1) ? 1 : 0;
	this.op6   = ((this.agent.indexOf("Opera 6") > -1) && this.dom) ? 1 : 0;
	this.ie5   = ((this.ver.indexOf("MSIE 5") > -1) && this.dom && !this.op6) ? 1 : 0;
	this.ie6r  = ((this.ver.indexOf("MSIE 6") > -1) && this.dom && (document.compatMode == "BackCompat")) ? 1 : 0;
	this.ie6s  = ((this.ver.indexOf("MSIE 6") > -1) && this.dom && (document.compatMode == "CSS1Compat")) ? 1 : 0;
	this.ie4   = (document.all && !this.dom) ? 1 : 0;
	this.ie    = (this.ie4 || this.ie5 || this.ie6r || this.ie6s) ? 1 : 0;
	this.ns6   = (this.dom && (parseInt(this.ver) >= 5)) ? 1 : 0;
	this.ns4   = (document.layers && !this.dom) ? 1 : 0;
	this.ns    = (this.ns4 || this.ns6) ? 1 : 0;
	this.bw5   = (this.ie5 || this.ie6r) ? 1 : 0;
	this.bw6   = (this.ie6s || this.ns6 || this.op6) ? 1 : 0;
	this.bw    = (this.ie6r || this.ie6s || this.ie5 || this.ns6 || this.op6) ? 1 : 0;
	return this;
}

function BodyInit(id, mt, mb, tp) {
	oBw = new VersionGet;
	if (oBw.bw) {
		gDivName         = oBw.bw5 ? document.all(id) : oBw.bw6 ? document.getElementById(id) : 0;
		gObject          = gDivName.style;
		gObject.position = 'absolute';
		gDisU          = mt ? mt : 0;
		gDisD          = mb ? mb : 0;
		gCurPosY = gIniPosY = tp ? tp : gDivName.offsetTop;
		startFix();
		DivisionMove();
	}
}
function BodyInitHome(id, mt, mb, tp) {
	oBw = new VersionGet;
	if (oBw.bw) {
		gDivName         = oBw.bw5 ? document.all(id) : oBw.bw6 ? document.getElementById(id) : 0;
		gObject          = gDivName.style;
		gObject.position = 'absolute';
		gDisU          = mt ? mt : 0;
		gDisD          = mb ? mb : 0;
		gCurPosY = gIniPosY = tp ? tp : gDivName.offsetTop;
		startFix_home();
		DivisionMove();
	}
}

function DivisionMove() {
	var WndHeight = 0;
	var DivHeight = 0;
	var SetPosY   = 0;
	var SetPosYD  = 0;
	var SetPosYU  = 0;
	var DisPosY   = 0;

	DivHeight = gDivName.offsetHeight;

	if (oBw.ie6s) {
		WndHeight = document.documentElement.clientHeight;
	} else if (oBw.ns6 || oBw.op6) {
		WndHeight = innerHeight;
	} else if (oBw.bw5) {
		WndHeight = document.body.clientHeight;
	} else {
		WndHeight = 0;
	}

	if (oBw.ie6s) {
		SetPosY = document.documentElement.scrollTop;
	} else if (oBw.bw5) {
		SetPosY = document.body.scrollTop;
	} else if (oBw.ns6 || oBw.op6) {
		SetPosY = window.pageYOffset;
	} else {
		SetPosY = 0;
	}

	if (WndHeight >= gDisU + DivHeight + gDisD) {
		SetPosY = Math.max(SetPosY + gDisU, gIniPosY);
	} else {
		SetPosYD = Math.max(SetPosY + gDisU, gIniPosY);
		SetPosYU = Math.max(SetPosY - (DivHeight + gDisD - WndHeight), gIniPosY);
		if (SetPosYD > gCurPosY && SetPosYU < gCurPosY) {
			SetPosY = gCurPosY;
		} else if (SetPosYU < gCurPosY) {
			SetPosY = Math.max(SetPosYD, SetPosYU);
		} else {
			SetPosY = Math.min(SetPosYD, SetPosYU);
		}
	}
	SetPosY += gFilDisY;

	if (SetPosY != gCurPosY) {
		DisPosY = (SetPosY - gCurPosY) * 0.25;
		if (Math.abs(DisPosY) < 1 || (Math.abs(SetPosY - gCurPosY) <= gwFilDisY && gTurnFlg == 1)) {
			DisPosY = (DisPosY > 0) ? 1 : (DisPosY < 0) ? -1 : 0;
		}
		gCurPosY   += Math.round(DisPosY);
		gObject.top =  gCurPosY + 'px';
		if (Math.abs(SetPosY - gCurPosY) <= gwFilDisY && gTurnFlg == 1) {
			gFilDisY  = 0;
		} else {
			gFilDisY  = (DisPosY > 0) ? gwFilDisY : (DisPosY < 0) ? -gwFilDisY : 0;
			gTurnFlg = 0;
		}
	} else {
		if (gTurnFlg == 0) {
			gTurnFlg = 1;
			gFilDisY  = 0;
		} else {
			gTurnFlg = 2;
		}
	}
	setTimeout('DivisionMove()', 20);
}

function startFix(){
	fixedLAYER('chasemenu','center',-400,-80,400)
}
function startFix_home(){
	fixedLAYER('chasemenu_home','center',-400,-80,400)
}

function fixedLAYER(layName,posString,offSetX,offSetY,endLeft){
	if(!window.fixedLAYER[layName]){
		this.ie    = !!document.all
		this.n4    = !!document.layers
		this.w3c   = !!document.getElementById
		this.ua    = navigator.userAgent
		this.mac45 = ua.indexOf('MSIE 4.5; Mac_PowerPC') != -1
		this.mac5  = ua.indexOf('MSIE5.0;Mac_PowerPC')   != -1
		this.macie = ua.indexOf('Mac_PowerPC')  !=-1 && ie
		this.moz   = ua.indexOf('Gecko') !=-1
		this.opr   = !!window.opera
		if(this.ie&&!(this.mac45)){ 
			window.onscroll = window.onresize = startFix 
		}
			if(this.n4)
			window.onresize = function(){ location.reload() }
			window.fixedLAYER[layName] = true
		}

		offSetX = parseInt(offSetX,10)
		offSetY = parseInt(offSetY,10)

		if( posString == 'rightTop' ){
			if(this.ie&&!this.opr) 
				offLeft = document.body.clientWidth   + offSetX
			else
				offLeft = window.innerWidth           + offSetX
			if(this.ie&&!this.opr) 
				offTop  =                               offSetY
			else
				offTop  =                               offSetY

		} else if( posString == 'rightBottom' ){
			if(this.ie&&!this.opr) 
				offLeft = document.body.clientWidth   + offSetX
			else
				offLeft = window.innerWidth           + offSetX
			if(this.ie&&!this.opr) 
				offTop  = document.body.clientHeight  + offSetY
			else
				offTop  = window.innerHeight          + offSetY

		} else if( posString == 'leftBottom' ){
			if(this.ie&&!this.opr) 
				offLeft =                               offSetX
			else
				offLeft =                               offSetX
			if(this.ie&&!this.opr) 
				offTop  = document.body.clientHeight  + offSetY
			else
				offTop  = window.innerHeight          + offSetY

		} else if( posString == 'center' ){
			if(this.ie&&!this.opr){
				if(document.body.clientWidth/2 >= endLeft)
					offLeft = document.body.clientWidth/2 + offSetX
				else
					offLeft = endLeft + offSetX
			}
			else{
					offLeft = window.innerWidth/2         + offSetX
			}
			if(this.ie&&!this.opr){
				offTop  = document.body.clientHeight/2+ offSetY
			}
			else{
				offTop  = window.innerHeight/2        + offSetY
			}

		} else {
			if(this.ie&&!this.opr) 
				offLeft =                               offSetX
			else
				offLeft =                               offSetX
			if(this.ie&&!this.opr) 
				offTop  =                               offSetY
			else
				offTop  =                               offSetY
		}

		offLeft = parseInt(offLeft,10)
		offTop  = parseInt(offTop,10)

		if(document.all&&!this.opr){
			var mx = document.body.scrollLeft + offLeft
			var my = document.body.scrollTop  + offTop
		} else {
			var mx = self.pageXOffset + offLeft
			var my = self.pageYOffset + offTop
		}

		if(document.getElementById){ //e5,e6,n6,n7,m1,o6,o7,s1—p
			document.getElementById(layName).style.left = mx
//			document.getElementById(layName).style.top  = my
		} else if(document.all){     //e4—p
			document.all(layName).style.pixelLeft = mx
//			document.all(layName).style.pixelTop  = my
		} else if(document.layers)   //n4—p
			document.layers[layName].moveTo(mx,my)

			if(!(this.ie&&!this.mac45) || this.opr){
				clearTimeout(fixedLAYER[layName])
				fixedLAYER[layName]=setTimeout("fixedLAYER('"+layName+"','"+posString+"','" +offSetX+"','"+offSetY+"')",100)
		}
}


