function startFixed(){

/*このstartFixed()関数内へ固定したいレイヤー名などを
引数へ書いたfixedLAYER()関数をならべてください。  */

	fixedLAYER('fixedLay0','rightTop',-115,10)
 fixedLAYER('fixedLay1','rightBottom',-115,-30)

	// 例
	// fixedLAYER('fixedLay0','leftTop',10,10)
	// fixedLAYER('fixedLay0','leftBottom',10,-30)
	// fixedLAYER('fixedLay0','rightBottom',-140,-30)

}

/* -- ここから下はさわらなくてもOK -- */

var ie = !!document.all
var n4 = !!document.layers
var w3c= !!document.getElementById
var ua = navigator.userAgent
var mac45= ua.indexOf('MSIE 4.5; Mac_PowerPC')!=-1
var mac5 = ua.indexOf('MSIE5.0;Mac_PowerPC')!=-1
var macie = ua.indexOf('Mac_PowerPC')!=-1&&ie
var moz = ( ua.indexOf('Gecko')!=-1 )
var opr = ( ua.indexOf('Opera')!=-1 )


if(document.layers)window.onresize=resizeFunc
function resizeFunc(e){location.reload()}
function iniFunc(){
	if(ie&&!(mac45))window.onscroll = startFixed
	startFixed()
}
var tid=new Array()

function fixedLAYER(layName,posString,offSetX,offSetY){

	offSetX = parseInt(offSetX,10)
	offSetY = parseInt(offSetY,10)

	if( posString == 'rightTop' ){
		
		if(ie&&!opr) offLeft = document.body.clientWidth   + offSetX
		else         offLeft = window.innerWidth           + offSetX
		if(ie&&!opr) offTop  =                               offSetY
		else         offTop  =                               offSetY
	}
	else if( posString == 'rightBottom' ){
		if(ie&&!opr) offLeft = document.body.clientWidth   + offSetX
		else         offLeft = window.innerWidth           + offSetX
		if(ie&&!opr) offTop  = document.body.clientHeight  + offSetY
		else         offTop  = window.innerHeight          + offSetY
	}
	else if( posString == 'leftBottom' ){
		if(ie&&!opr) offLeft =                               offSetX
		else         offLeft =                               offSetX
		if(ie&&!opr) offTop  = document.body.clientHeight  + offSetY
		else         offTop  = window.innerHeight          + offSetY
 }
	else if( posString == 'center' ){
		if(ie&&!opr) offLeft = document.body.clientWidth/2 + offSetX
		else         offLeft = window.innerWidth/2         + offSetX
		if(ie&&!opr) offTop  = document.body.clientHeight/2+ offSetY
		else         offTop  = window.innerHeight/2        + offSetY
	}
 
	else {

		if(ie&&!opr) offLeft = offSetX
		else         offLeft = offSetX
		if(ie&&!opr) offTop  = offSetY
		else         offTop  = offSetY

	}

	offLeft = parseInt(offLeft)
	offTop  = parseInt(offTop)

	if(document.all&&!opr){
		var mx = parseInt(document.body.scrollLeft +offLeft)
		var my = parseInt(document.body.scrollTop  +offTop)
	} else {
		var mx = parseInt(self.pageXOffset+offLeft)
		var my = parseInt(self.pageYOffset+offTop)
	}

 moveLAYER(layName,mx,my)

		//WinIE以外 opera n4用
	if(!(ie&&!mac45) || opr){
		clearTimeout(fixedLAYER[layName])
		fixedLAYER[layName]=setTimeout("fixedLAYER('"+layName+"','"+posString+"','" +offSetX+"','"+offSetY+"')",100)
	}
}

function moveLAYER(layName,x,y){
	
	if(document.getElementById){ //Moz,NN6,IE5用
	 document.getElementById(layName).style.left=x
		document.getElementById(layName).style.top=y
	}
	else if(document.all){
		document.all(layName).style.pixelLeft=x //IE4用
		document.all(layName).style.pixelTop=y
	}
	else if(document.layers){
		document.layers[layName].moveTo(x,y)	//NN4用
	}
}