function scleft() {  
window.scrollBy(-10,0); 
}

function scright() {  
window.scrollBy(10,0); 
}

function first_position(){ 
	 window.scroll(10000,0);    
}

function handle(delta) { 
    if (delta < 0) {
	// 下方向にまわした場合の処理 
	//window.scrollBy(-500,0); 
	window.scrollBy(-250,0); 
    }else{
	// 上方向にまわした場合の処理
 	//window.scrollBy(500,0);
	window.scrollBy(250,0);
    }
}

/** Event handler for mouse wheel event. */
function wheel(event){
	var delta = 0;
	if (!event)
		/* For IE. */
		event = window.event;
	if (event.wheelDelta) {
		/* IE/Opera. */
		delta = event.wheelDelta/120;
	if (window.opera) 
		delta = -delta;
	} else if (event.detail) {
		/** Mozilla case. */
		delta = -event.detail/3;
	}
	/** If delta is nonzero, handle it. 
	 * Basically, delta is now positive if wheel was scrolled up,
	 * and negative, if wheel was scrolled down.
	 */
	 if (delta)
		 handle(delta);
	 
	 /*
	 if (event.preventDefault) {
		 event.preventDefault();
	 } 
	 event.returnValue = false;
	 */
}
 /** Initialization code. 
 * If you use your own event management code, change it as required. 
 */if (window.addEventListener) 
 window.addEventListener('DOMMouseScroll', wheel, false);
 window.onmousewheel = document.onmousewheel = wheel;



/*//////////////// レイヤ－位置固定用指定用関数  UseFree
========================================================
スクロールしてもレイヤ－の位置が動かないように固定する
--------------------------------------------------------
Win  n4 n6 moz e4 e5 e6,
Mac  n4 n6 moz e4.5 e5,
Linux n4 n6 moz
========================================================

◎使用例
fixedLAYER('レイヤ－名',位置,offSetX,offSetY) 

◎引数解説
レイヤ－名: 固定するレイヤー名 
位置      : (固定するレイヤーの位置をあらわす文字)
		  rightTop   右上    rightBottom  右下
		  leftBottom 左下    leftTop      左上
		  center     中央    * デフォルトはleftTop
offSetX   : 最寄りの辺(または中心)からのpx距離 水平方向
offSetY   : 最寄りの辺(または中心)からのpx距離 垂直方向

======================================================*/

function startFixed(){

/*このstartFixed()関数内へ固定したいレイヤー名などを
  引数へ書いたfixedLAYER()関数をならべてください。  */

  fixedLAYER('sidebar','leftTop',10,10)

}

/* -- ここから下はさわらなくてもOK -- */

var ie= !!document.all
var n4= !!document.layers
var w3c=!!document.getElementById
var mac45 
= navigator.userAgent.indexOf('MSIE 4.5; Mac_PowerPC')

if(document.layers)window.onresize=resizeFunc
function resizeFunc(e){location.reload()}

function iniFunc(){
if(ie&&!(mac45!=-1))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) offLeft = document.body.clientWidth   + offSetX
  else   offLeft = window.innerWidth           + offSetX
  if(ie) offTop  =                               offSetY
  else   offTop  =                               offSetY

}
else if( posString == 'rightBottom' ){

  if(ie) offLeft = document.body.clientWidth   + offSetX
  else   offLeft = window.innerWidth           + offSetX
  if(ie) offTop  = document.body.clientHeight  + offSetY
  else   offTop  = window.innerHeight          + offSetY

}
else if( posString == 'leftBottom' ){

  if(ie) offLeft =                               offSetX
  else   offLeft =                               offSetX
  if(ie) offTop  = document.body.clientHeight  + offSetY
  else   offTop  = window.innerHeight          + offSetY

}
else if( posString == 'center' ){

  if(ie) offLeft = document.body.clientWidth/2 + offSetX
  else   offLeft = window.innerWidth/2         + offSetX
  if(ie) offTop  = document.body.clientHeight/2+ offSetY
  else   offTop  = window.innerHeight/2        + offSetY

}
else {

  if(ie) offLeft =                               offSetX
  else   offLeft =                               offSetX
  if(ie) offTop  =                               offSetY
  else   offTop  =                               offSetY

}

offLeft = parseInt(offLeft)
offTop  = parseInt(offTop)

if(document.all){
  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用
}

/*////////////// レイヤ－位置固定用指定用関数ここまで */

