﻿$currentImage	=	0;
$showing		=	false;


function	showImage( $imgidx )	{

	if( !$showing )	{
		showdiv('moviebg');
		showdiv('imgctrlarea');
		showdiv('mainimg');
		dim('moviebg', 80);	
	}

	mvdiv	=	document.getElementById( 'mainimg' );
	mvdiv.innerHTML	=	"<img src=\"/resources/images/gpic/" + $garr[$imgidx] + "\">";

	$showing	=	true;
	$currentImage	=	$imgidx;
}

function	hideImage()	{
	hidediv('moviebg');
	hidediv('mainimg');
	hidediv('imgctrlarea');

	$showing	=	false;
	
}

function	nextImage()	{

	if(++$currentImage >= $garr.length)	{
		$currentImage = 0;
	}

	showImage( $currentImage );
}

function	prevImage()	{

	if(--$currentImage < 0)	{
		$currentImage = $garr.length - 1;
	}
	
	showImage( $currentImage );
}


function	lobut( $nm )	{
	mvdiv	=	document.getElementById( $nm ).src="/resources/images/" + $nm + ".png";
}

function	hibut( $nm )	{
	mvdiv	=	document.getElementById( $nm ).src="/resources/images/" + $nm + "-hi.png";
}

function	downbut( $nm )	{
	mvdiv	=	document.getElementById( $nm ).src="/resources/images/" + $nm + "-hi.png";
}
