/*
5digistar株式会社 [ActionBrowserサ?ビス] 
Email： support@5digistar.co.jp 
URL： http://www.5digistar.co.jp/ 

Copyright (C) 2005 5digistar Inc. All Rights Reserved.
*/

function onMainPage()
{
	if(AB.ActivateLink) return;

	if(AB.ViewerStatus==0)
	{
		switch(event.button) 
		{
			case 1:
				switch (AB.FlipDirection) 
				{
					case 0:
						if (this.id == "lyRightCanvas") 
							AB.gotoNext();
						else 
							AB.gotoPrev();
						break;
					case 1: 
						if (this.id == "lyLeftCanvas") 
							AB.gotoNext();
						else 
							AB.gotoPrev();
						break;
				}
				break;
			case 2:
			case 3:				
				if (AB.ZoomRatio<2) 
				{
					AB.ViewerStatus = 0;
					return;
				}
				zoomMainPages(this.id);				
				break;
			case 4:
				repositionBookmark(AB.IndexCurrentPage,checkPageDirection(event.srcElement.parentNode.id));
				break;			
		}
	}
	else
		return;
}

function onZoomMouseWheel()
{
	var LimitTop; 
	var NewPos;
	
	if(event.wheelDelta >= 120)
	{
		NewPos = parseInt(getObj('lyZoom').style.top) + (parseInt(event.wheelDelta) / 2);
		if (NewPos < 0)
		{
			getObj('lyZoom').style.top = NewPos;
			onScrollTop(0);
			onScrollBottom(0);			
		}
		else
		{ 
			getObj('lyZoom').style.top = 0;
			onScrollTop(4);
			onScrollBottom(0);
		}
	
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom').style.top,10)/(20*0.6);
	}
	else if(event.wheelDelta <= -120)
	{
		LimitTop = parseInt(getObj('lyZoomView').style.height) - parseInt(getObj('lyZoom').style.height);
		NewPos = parseInt(getObj('lyZoom').style.top) + ( parseInt(event.wheelDelta) / 2);
		if ( NewPos > LimitTop )
		{
			getObj('lyZoom').style.top = NewPos;
			onScrollTop(0);
			onScrollBottom(0);			
		}
		else
		{
			getObj('lyZoom').style.top = LimitTop;
			onScrollTop(0);
			onScrollBottom(4);			
		}
			
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom').style.top,10)/(20*0.6);
	}	
	else
		return;
}

function onZoomMouseWheel3()
{
	var LimitTop; 
	var NewPos;
	
	if(event.wheelDelta >= 120)
	{
		NewPos = parseInt(getObj('lyZoom3').style.top) + (parseInt(event.wheelDelta) / 2);
		if (NewPos < 0)
		{
			getObj('lyZoom3').style.top = NewPos;
			onScrollTop3(0);
			onScrollBottom3(0);			
		}
		else 
		{
			getObj('lyZoom3').style.top = 0;
			onScrollTop3(4);
			onScrollBottom3(0);			
		}
			
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom3').style.top,10)/20;
	}
	else if(event.wheelDelta <= -120)
	{
		LimitTop = parseInt(getObj('lyZoomView3').style.height) - parseInt(getObj('lyZoom3').style.height);
		NewPos = parseInt(getObj('lyZoom3').style.top) + ( parseInt(event.wheelDelta) / 2);
		if ( NewPos > LimitTop ) 
		{
			getObj('lyZoom3').style.top = NewPos;
			onScrollTop3(0);
			onScrollBottom3(0);				
		}
		else 
		{
			getObj('lyZoom3').style.top = LimitTop;
			onScrollTop3(0);
			onScrollBottom3(4);			
		}
			
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom3').style.top,10)/20;
	}	
	else
		return;
}

function toggleInfoBar()
{
	if (oSlideShow)	SlideShow();
	
	if(parseInt(getObj('lyInfoBar').style.top) < 0)
	{
		Cimage('ImgInfo',43);
		showInfoBar();
	}
	else
	{
		Cimage('ImgInfo',44);
		hideInfoBar();
	}
}

function showInfoBar()
{
	getObj('lyInfoBar').style.top = parseInt(getObj('lyInfoBar').style.top,10) + 3;	
	
	if( 0 <= parseInt(getObj('lyInfoBar').style.top,10) )
		getObj('lyInfoBar').style.top = 0;
	else
		setTimeout(showInfoBar,30);
}

function hideInfoBar()
{   	
	getObj('lyInfoBar').style.top = parseInt(getObj('lyInfoBar').style.top,10) - 5;

	if( -20 >= parseInt(getObj('lyInfoBar').style.top,10) )
		getObj('lyInfoBar').style.top = -20;
	else
		setTimeout(hideInfoBar,30);
}

var movePrint = setTimeout('null',1);
function showPrint()
{
	var oDiv = getObj('lyPrint').style;

	if (oDiv.pixelLeft<0) 
	{
		clearTimeout(movePrint);
		movePrint = setTimeout('showPrint()', 30);
		AB.ViewerStatus = 7;
		slideMenu('lyPrint',25);
	}
	else 
	{
		clearTimeout(movePrint);
		movePrint=setTimeout('null',1);
		oDiv.left = 0;
	}		
}

function hidePrint()
{   	
	clearTimeout(movePrint);
	movePrint = setTimeout('hidePrint1()', 100);
}

function hidePrint1()
{
	var oDiv = getObj('lyPrint').style;
	
	if (oDiv.pixelLeft>(-350)) 
	{
		clearTimeout(movePrint);
		movePrint = setTimeout('hidePrint1()', 30);		
		slideMenu('lyPrint',-25);
	}
	else 
	{
		clearTimeout(movePrint);
		AB.ViewerStatus = 0;
		movePrint=setTimeout('null',1);
	}
}

var moveContent = setTimeout('null',1);
function showContent()
{
	var oDiv = getObj('lyContentList').style;

	if (oDiv.pixelLeft<0) 
	{
		clearTimeout(moveContent);
		moveContent = setTimeout('showContent()', 30);
		AB.ViewerStatus = 8;
		slideMenu('lyContentList',25);
	}
	else 
	{
		clearTimeout(moveContent);
		moveContent=setTimeout('null',1);
		oDiv.left = 0;
	}	
}

function hideContent()
{ 
	clearTimeout(moveContent);
	moveContent = setTimeout('hideContent1()', 100);	
}

function hideContent1()
{
	var oDiv = getObj('lyContentList').style;
	
	if (oDiv.pixelLeft>(-250)) 
	{
		clearTimeout(moveContent);
		moveContent = setTimeout('hideContent1()', 30);		
		slideMenu('lyContentList',-25);
	}
	else 
	{
		clearTimeout(moveContent);
		AB.ViewerStatus = 0;
		moveContent=setTimeout('null',1);
	}
}

function slideMenu(Obj,num)
{
	getObj(Obj).style.pixelLeft += num;	
}

function beforeGoto()
{
	if(event.keyCode==13) GoToPageNum();
}

function winclose()
{
	if (oSlideShow)	SlideShow();
	
	if(confirm(aToolAlt[22]))
		self.close();
	else
		return;	
}

function openhelp()
{
	if (oSlideShow)	SlideShow();
	
	var helpfile = "../data/help/help_d_jp.html#top";
	
	if(initLang=="en_")
		helpfile = "../data/help/help_d_en.html#top";
	
	window.open(helpfile,'help','scrollbars=yes,resizable=yes,width=350,height=340');
}

function toggleCenterBorder()
{
	
	if(AB.IndexCurrentPage==0)return;
	
	if(AB.flagCenterBorder)
	{
		AB.flagCenterBorder = false;		
		getObj('lyLeftGradation').style.visibility = "hidden";
		getObj('lyRightGradation').style.visibility = "hidden";
	}
	else
	{
		AB.flagCenterBorder = true;
		getObj('lyLeftGradation').style.visibility = "visible";
		getObj('lyRightGradation').style.visibility = "visible";	
	}
}

var selectedNumText = false;
function checkFocus(argBool)
{
	if (argBool)
		selectedNumText = true;
	else
		selectedNumText = false;
}		

function BlockKeyPress(e) 
{
	if(selectedNumText)
	{
		if( (event.keyCode<48 || event.keyCode>57) && (event.keyCode<96 || event.keyCode>105))
		{
			switch(event.keyCode)
			{
			case 46:
			case 8:
			case 13:
				break;
			default:
				window.status = AB.StatusMsg;
				return false;
				break;
			}
		}
	}

	switch(event.keyCode)
	{
	case 8:
	case 13:
	case 46:
		return true;
		break;
	case 37: // <-
	case 38:
		switch (AB.FlipDirection) 
		{
			case 0:
				AB.gotoPrev();
				break;
			case 1: 
				AB.gotoNext();
				break;
		}
		break;
	case 39: // ->
	case 40:
		switch (AB.FlipDirection) 
		{
			case 0:
				AB.gotoNext();
				break;
			case 1: 
				AB.gotoPrev();
				break;
		}	
		break;
	case 36: // Home
		AB.gotoFirst();
		break;
	case 35: // End
		AB.gotoLast();
		break;
	case 80: // print
		beforePrint();
		break;
	case 73: // index
		beforeContent();
		break;
	case 83: // sound
		onToggleBGM();
		break;
	case 76: // layer
		onToggleLayer();
		break;		
	case 65: // auto
		SlideShow();
		break;
	case 72: // help
		openhelp();
		break;
	case 81: // q close
	case 27:
		winclose();
		break;
	case 66: // Toggle center-borders
		toggleCenterBorder();
		break;		
	default:
		if((event.keyCode<48 || event.keyCode>57)&&(event.keyCode<96 || event.keyCode>105))
		{  		
			event.cancelBubble = true; 
			event.returnValue = false; 
			window.status = AB.StatusMsg;
			return; 
		}	
	}
	window.status = AB.StatusMsg;
} 

function BlockContext(){return;}
function BlockDragStart(){return;}

function repositioningToolbar()
{
	getObj('lyInfoBar').style.width = document.body.clientWidth-parseInt(getObj('lyInfo').style.width,10);
	getObj('lyToolBar').style.width = document.body.clientWidth;
	getObj('lyContentList').style.top = parseInt(getObj('lyToolBar').style.top,10) - parseInt(getObj('lyContentList').style.height,10);
	getObj('lyPrint').style.top = parseInt(getObj('lyToolBar').style.top,10) - parseInt(getObj('lyPrint').style.height,10);

	getObj('lyToolBar').style.pixelTop = document.body.clientHeight - parseInt(getObj('lyToolBar').style.height,10);
}

function playBGM()
{
	var MM;
	var MMDiv = document.createElement('DIV');
	var mSrc = AB.BGM;
	var mPath = location.href;

	mPath = unescape(mPath.substring(0,mPath.indexOf('dhtml')-1)+mSrc.substring(mSrc.indexOf('..')+2,mSrc.length));

	MM = "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' width='0' height='0' id='BGM' name='BGM' type='application/x-oleobject'>";
	MM = MM + "<param name='URL' value='"+mPath+"'>";
	MM = MM + "<param name='FileName' value='"+mPath+"'>";
	MM = MM + "<param name='autostart' value='1'>";
	MM = MM + "<param name='showcontrols' value='0'>";
	MM = MM + "<param name='loop' value='1000'>";
	MM = MM + "</object>";
	with(MMDiv.style)
	{
		position="absolute";
		left = "-100px";
		top = "-100px";
	}
	MMDiv.innerHTML = MM;

	getObj('oViewer').appendChild(MMDiv);
}

function turnonBGM()
{
	Cimage('ImgSound',39);
	AB.BGMOnOff = true;
	document.BGM.Play();
}
function turnoffBGM()
{
	Cimage('ImgSound',40);
	AB.BGMOnOff = false;
	document.BGM.Pause();
}

var x,y;
document.onmousemove = HandleMouse;
function HandleMouse(e)
{
	x = event.clientX+document.body.scrollLeft;
	y = event.clientY+document.body.scrollTop;
}

function onToggleBGM(aChk)
{
	if (oSlideShow)	SlideShow();
	
	var chkOnOff = getObj('ImgSound').src;
	chkOnOff = chkOnOff.toLowerCase();
	
	try{	
		if(aChk == null)
		{
			if(chkOnOff.indexOf('off.gif')>0)
			{
				turnonBGM();
				return;		
			}
			else
			{
				turnoffBGM();
				return;
			}
		}
		else
		{		
			if(aChk)
			{
				turnonBGM();
				return;
			}
			else
			{
				turnoffBGM();
				return;
			}
		}
	}
	catch(err)
	{
		//alert(err.message);
	}
}

function onToggleLayer()
{
	if (oSlideShow)	SlideShow();
	
	var chkOnOff = getObj('ImgLayer').src;
	chkOnOff = chkOnOff.toLowerCase();
	
	if(chkOnOff.indexOf('on.gif')>0)
	{
		Cimage('ImgLayer',42);
		AB.LinkOnOff = false;
		
		switch(AB.ViewerStatus)
		{
		case 0:
			delLinks();
			break;
		case 60:
		case 61:
			delZoomLinks();
			break;
		case 600:
		case 610:
			delZoomLinks3();
			break;
		}
	}
	else
	{
		Cimage('ImgLayer',41);
		AB.LinkOnOff = true;
		
		switch(AB.ViewerStatus)
		{
		case 0:
			showLinks();
			break;
		case 60:
		case 61:
			showZoomLinks();
			break;
		case 600:
		case 610:
			showZoomLinks3();
			break;			
		}
	}
}

function onTogglePlayer(st, no, aID)
{
	switch(parseInt(no,10))
	{
	case 0:
		getObj('lyCM_'+aID).innerHTML="<img name='btnPlay_"+aID+"' id='btnPlay_"+aID+"' src='"+AB.TImageTool+"movie_play_out.gif' onmousedown=\"Cimage('btnPlay_"+aID+"',45)\" onmouseout=\"Cimage('btnPlay_"+aID+"',46)\" onmouseover=\"Cimage('btnPlay_"+aID+"',47)\" onmouseup=\"Cimage('btnPlay_"+aID+"',47)\" onclick=\"onTogglePlayer("+st+",1,'"+aID+"')\">";
		
		if(st==0)
		{
			getObj(aID).Pause();
		}
		else
		{
			getObj(aID).Stop();
		}
		break;		
	case 1:		
		getObj('lyCM_'+aID).innerHTML="<img name='btnStop_"+aID+"' id='btnStop_"+aID+"' src='"+AB.TImageTool+"movie_stop_out.gif' onmousedown=\"Cimage('btnStop_"+aID+"',48)\" onmouseout=\"Cimage('btnStop_"+aID+"',49)\" onmouseover=\"Cimage('btnStop_"+aID+"',50)\" onmouseup=\"Cimage('btnStop_"+aID+"',50)\" onclick=\"onTogglePlayer("+st+",0,'"+aID+"')\">";
		getObj(aID).Play();
		break;
	}	
}

function onScrollTop()
{
	var ST = document.getElementsByName('ImgScrollTop')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=80)";
		break;
	case 2:
		Cimage(ST.name,58);
		ST.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollTop();
		break;
	case 3:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;
	case 4:		
		ST.parentNode.style.filter = "alpha(Opacity=5)";
		break;		
	}
	
	if(parseInt(getObj('lyZoom').style.top,10)>=0)
		ST.parentNode.style.filter = "alpha(Opacity=5)";
}

function onScrollBottom()
{
	var LimitTop; 
	var NewPos;
		
	var SB = document.getElementsByName('ImgScrollBottom')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=80)";
		break;
	case 2:
		Cimage(SB.name,60);
		SB.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollBottom();
		break;
	case 3:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;				
	case 4:
		SB.parentNode.style.filter = "alpha(Opacity=5)";
		break;	
	}
	
	if(parseInt(getObj('lyZoom').style.top,10)<=(parseInt(getObj('lyZoomView').style.height) - parseInt(getObj('lyZoom').style.height)) )
		SB.parentNode.style.filter = "alpha(Opacity=5)";
}

function onScrollTop3()
{
	var ST = document.getElementsByName('ImgScrollTop3')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=80)";		
		break;
	case 2:
		Cimage(ST.name,58);
		ST.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollTop3();
		break;
	case 3:
		Cimage(ST.name,57);
		ST.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;
	case 4:
		ST.parentNode.style.filter = "alpha(Opacity=5)";
		break;	
	}
	
	if(parseInt(getObj('lyZoom3').style.top,10)>=0)
		ST.parentNode.style.filter = "alpha(Opacity=5)";	
}

function onScrollBottom3()
{
	var LimitTop; 
	var NewPos;
		
	var SB = document.getElementsByName('ImgScrollBottom3')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=80)";		
		break;
	case 2:
		Cimage(SB.name,60);
		SB.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollBottom3();
		break;
	case 3:
		Cimage(SB.name,59);
		SB.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;		
	case 4:
		SB.parentNode.style.filter = "alpha(Opacity=5)";
		break;					
	}
	
	if(parseInt(getObj('lyZoom3').style.top,10)<=(parseInt(getObj('lyZoomView3').style.height) - parseInt(getObj('lyZoom3').style.height)) )
		SB.parentNode.style.filter = "alpha(Opacity=5)";	
}

function onScrollLeft3()
{
	var SL = document.getElementsByName('ImgScrollLeft3')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(SL.name,61);
		SL.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(SL.name,61);
		SL.parentNode.style.filter = "alpha(Opacity=80)";
		break;
	case 2:
		Cimage(SL.name,62);
		SL.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollLeft3();
		break;		
	case 3:
		Cimage(SL.name,61);
		SL.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;		
	case 4:
		SL.parentNode.style.filter = "alpha(Opacity=5)";
		break;	
	}
	
	if( parseInt(getObj('lyZoom3').style.left,10) >= 0 )
		SL.parentNode.style.filter = "alpha(Opacity=5)";
}

function onScrollRight3()
{
	var LimitTop; 
	var NewPos;
		
	var SR = document.getElementsByName('ImgScrollRight3')[0];
	
	switch(arguments[0])
	{
	case 0:
		Cimage(SR.name,63);
		SR.parentNode.style.filter = "alpha(Opacity=40)";
		stopScroll();
		break;
	case 1:
		Cimage(SR.name,63);
		SR.parentNode.style.filter = "alpha(Opacity=80)";
		break;
	case 2:
		Cimage(SR.name,64);
		SR.parentNode.style.filter = "alpha(Opacity=80)";
		doScrollRight3();
		break;
	case 3:
		Cimage(SR.name,63);
		SR.parentNode.style.filter = "alpha(Opacity=80)";
		stopScroll();
		break;		
	case 4:
		SR.parentNode.style.filter = "alpha(Opacity=5)";
		break;	
	}
	
	if( parseInt(getObj('lyZoom3').style.left,10) <= (-parseInt(getObj('lyZoom3').style.width)+parseInt(getObj('lyZoomView3').style.width)) )
		SR.parentNode.style.filter = "alpha(Opacity=5)";	
}

function doScrollTop() 
{	
	clearInterval(AB.ScrollTimer); 
	var cHeight = (parseInt(getObj('lyZoomView').style.height,10) * parseFloat(getObj('lyNavigation').style.height))/parseFloat(getObj('lyZoom').style.height);
	var NewPos = parseInt(getObj('lyZoom').style.top) + 30;
	onScrollBottom(0);
	if (NewPos < 0)
	{
		getObj('lyZoom').style.top = NewPos;
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom').style.top,10)/(parseInt(getObj('lyZoomView').style.height,10)/cHeight);

		AB.ScrollTimer = setInterval(doScrollTop, 30);				
	}
	else
	{ 
		getObj('lyZoom').style.top = 0;
		getObj('lyNaviRect').style.top = 0;
		onScrollTop(4);
	}
}

function doScrollBottom() 
{
	clearInterval(AB.ScrollTimer);
	var cHeight = (parseInt(getObj('lyZoomView').style.height,10) * parseFloat(getObj('lyNavigation').style.height))/parseFloat(getObj('lyZoom').style.height);
	var LimitTop = parseInt(getObj('lyZoomView').style.height) - parseInt(getObj('lyZoom').style.height);
	var NewPos = parseInt(getObj('lyZoom').style.top) - 30;
	onScrollTop(0);
	if ( NewPos > LimitTop ) 
	{
		getObj('lyZoom').style.top = NewPos;
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom').style.top,10)/(parseInt(getObj('lyZoomView').style.height,10)/cHeight);

		AB.ScrollTimer = setInterval(doScrollBottom, 30);
	}
	else 
	{
		getObj('lyZoom').style.top = LimitTop;
		getObj('lyNaviRect').style.top = parseInt(getObj('lyNavi').style.height,10)-parseInt(getObj('lyNaviRect').style.height,10);
		onScrollBottom(4);
	}
}

function doScrollTop3() 
{	
	clearInterval(AB.ScrollTimer); 
	var cHeight = (parseInt(getObj('lyZoomView3').style.height,10) * parseFloat(getObj('lyNavigation').style.height))/parseFloat(getObj('lyZoom3').style.height);
	var NewPos = parseInt(getObj('lyZoom3').style.top) + 30;
	onScrollBottom3(0);
	if (NewPos < 0)
	{
		getObj('lyZoom3').style.top = NewPos;
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom3').style.top,10)/(parseInt(getObj('lyZoomView3').style.height,10)/cHeight);
		AB.ScrollTimer = setInterval(doScrollTop3, 30);		
	}
	else
	{
		getObj('lyZoom3').style.top = 0;
		getObj('lyNaviRect').style.top = 0;
		onScrollTop3(4);
	}
}

function doScrollBottom3() 
{
	clearInterval(AB.ScrollTimer);

	var LimitTop = parseInt(getObj('lyZoomView3').style.height) - parseInt(getObj('lyZoom3').style.height);
	var cHeight = (parseInt(getObj('lyZoomView3').style.height,10) * parseFloat(getObj('lyNavigation').style.height))/parseFloat(getObj('lyZoom3').style.height);
	var NewPos = parseInt(getObj('lyZoom3').style.top) - 30;
	onScrollTop3(0);
	if ( NewPos > LimitTop ) 
	{
		getObj('lyZoom3').style.top = NewPos;
		getObj('lyNaviRect').style.top = -parseInt(getObj('lyZoom3').style.top,10)/(parseInt(getObj('lyZoomView3').style.height,10)/cHeight);
		AB.ScrollTimer = setInterval(doScrollBottom3, 30);		
	}
	else
	{
		getObj('lyZoom3').style.top = LimitTop;
		getObj('lyNaviRect').style.top = parseInt(getObj('lyNavi').style.height,10)-parseInt(getObj('lyNaviRect').style.height,10);
		onScrollBottom3(4);
	}
}

function doScrollLeft3() 
{	
	clearInterval(AB.ScrollTimer); 
	var cWidth = (parseInt(getObj('lyZoomView3').style.width,10) * parseFloat(getObj('lyNavigation').style.width))/parseFloat(getObj('lyZoom3').style.width);
	var NewPos = parseInt(getObj('lyZoom3').style.left) + 30;
	onScrollRight3(0);
	if (NewPos < 0)
	{
		getObj('lyZoom3').style.left = NewPos;
		getObj('lyNaviRect').style.left = -parseInt(getObj('lyZoom3').style.left,10)/(parseInt(getObj('lyZoomView3').style.width,10)/cWidth);
		AB.ScrollTimer = setInterval(doScrollLeft3, 10);		
	}
	else
	{ 
		getObj('lyZoom3').style.left = 0;
		onScrollLeft3(4);
	}
}

function doScrollRight3() 
{
	clearInterval(AB.ScrollTimer);
	var cWidth = (parseInt(getObj('lyZoomView3').style.width,10) * parseFloat(getObj('lyNavigation').style.width))/parseFloat(getObj('lyZoom3').style.width);
	var LimitLeft = -parseInt(getObj('lyZoom3').style.width)+parseInt(getObj('lyZoomView3').style.width);
	var NewPos = parseInt(getObj('lyZoom3').style.left) - 30;
	onScrollLeft3(0);
	if ( NewPos > LimitLeft ) 
	{
		getObj('lyZoom3').style.left = NewPos;
		getObj('lyNaviRect').style.left = -parseInt(getObj('lyZoom3').style.left,10)/(parseInt(getObj('lyZoomView3').style.width,10)/cWidth);
		AB.ScrollTimer = setInterval(doScrollRight3, 10);		
	}
	else
	{
		getObj('lyZoom3').style.left = LimitLeft;
		getObj('lyNaviRect').style.left = parseInt(getObj('lyNavi').style.width,10)-parseInt(getObj('lyNaviRect').style.width,10);
		onScrollRight3(4);
	}
}

function stopScroll() 
{
	clearInterval(AB.ScrollTimer);
}

function checkScroll()
{
	var ST = document.getElementsByName('ImgScrollTop')[0];
	var SB = document.getElementsByName('ImgScrollBottom')[0];

	if(parseInt(getObj('lyZoom').style.top,10)>=0)
		ST.parentNode.style.filter = "alpha(Opacity=5)";
	else
		ST.parentNode.style.filter = "alpha(Opacity=40)";
	
	if(parseInt(getObj('lyZoom').style.top,10)<=(parseInt(getObj('lyZoomView').style.height) - parseInt(getObj('lyZoom').style.height)) )
		SB.parentNode.style.filter = "alpha(Opacity=5)";
	else
		SB.parentNode.style.filter = "alpha(Opacity=40)";
}

function checkScroll3()
{
	var ST = document.getElementsByName('ImgScrollTop3')[0];
	var SB = document.getElementsByName('ImgScrollBottom3')[0];
	var SL = document.getElementsByName('ImgScrollLeft3')[0];
	var SR = document.getElementsByName('ImgScrollRight3')[0];	
	
	if(parseInt(getObj('lyZoom3').style.top,10)>=0)
		ST.parentNode.style.filter = "alpha(Opacity=5)";
	else
		ST.parentNode.style.filter = "alpha(Opacity=40)";

	if(parseInt(getObj('lyZoom3').style.top,10)<=(parseInt(getObj('lyZoomView3').style.height) - parseInt(getObj('lyZoom3').style.height)) )
		SB.parentNode.style.filter = "alpha(Opacity=5)";
	else
		SB.parentNode.style.filter = "alpha(Opacity=40)";
		
	if( parseInt(getObj('lyZoom3').style.left,10) >= 0 )
		SL.parentNode.style.filter = "alpha(Opacity=5)";
	else
		SL.parentNode.style.filter = "alpha(Opacity=40)";

	if( parseInt(getObj('lyZoom3').style.left,10) <= (-parseInt(getObj('lyZoom3').style.width)+parseInt(getObj('lyZoomView3').style.width)) )
		SR.parentNode.style.filter = "alpha(Opacity=5)";
	else
		SR.parentNode.style.filter = "alpha(Opacity=40)";
}
