function initForm(){
	var wheelConf = new SlideLayerConf();
	wheelConf.viewLayerName		= "wheelViewLayer";
	wheelConf.slideLayerNameBody = "wheelContentLayer";
	wheelConf.viewSlideCnt		= 1;
	wheelConf.slideLayerCnt		= main.wheelLayerCnt.value;
//	wheelConf.slideLayerCnt		= 8;
	wheelConf.slideLayerWidth	= 158;
	wheelConf.slideLayerHeight	= 58;
	wheelConf.viewLayerWidth	= wheelConf.slideLayerWidth;
	wheelConf.viewLayerHeight	= wheelConf.slideLayerHeight * wheelConf.viewSlideCnt;
	wheelConf.slideMoveInterval	= 20;
	wheelConf.slideHoldInterval	= 5000;		// ´ÙÀ½ °Ô½Ã¹° ÀÌµ¿½ÃÄÑ º¸¿©ÁÙ ÀÎÅÍ¹ú
	wheelConf.slideMoveAmt		= 1;
	wheelConf.slideHoldMoveAmt	= wheelConf.slideLayerHeight;
	confArray[0]				= wheelConf;
	initSlide(0);
	startSlide(0);
}


var confArray = new Array();
function SlideLayerConf()
{
	// ·¹ÀÌ¾î ÀÌ¸§
	this.viewLayerName		= "viewLayer";
	this.slideLayerNameBody = "contentLayer";
	// ·¹ÀÌ¾î °³¼ö
	this.viewSlideCnt		= 1;
	this.slideLayerCnt		= 2;
	// ·¹ÀÌ¾î Å©±â
	this.slideLayerWidth	= 160;
	this.slideLayerHeight	= 60;
	this.viewLayerWidth		= this.slideLayerWidth;
	this.viewLayerHeight	= this.slideLayerHeight * this.viewSlideCnt;
	// ·¹ÀÌ¾î ½½¶óÀÌµå °ü·Ã º¯¼ö
	this.slideMoveInterval	= 20;		// ½½¶óÀÌµå ¼Óµµ (ÀÛÀ»¼ö·Ï ºü¸§)
	this.slideHoldInterval	= 10000;		// ÇÏ³ªÀÇ ·¹ÀÌ¾î°¡ Áö³ª°¡¸é ±â´Ù¸± ½Ã°£
	this.slideMoveAmt		= 1;		// ÇÑ¹ø¿¡ ÀÌµ¿ÇÒ °Å¸®(pixel)
	this.slideHoldMoveAmt	= this.slideLayerHeight;
	// Å¸ÀÌ¸Ó °ü·Ã º¯¼ö
	this.timer;
	this.moveCnt	= 0;
	this.holdCnt	= 0;
	// true ÀÌ¸é ¸ØÃã false ÀÌ¸é ½½¶óÀÌµå ÁøÇà
	this.pause		= false;
}

// ½½¶óÀÌµå ÃÊ±âÈ­ ÇÔ¼ö
function initSlide(idx)
{
	var i = 0;
	var curLayer;
	var conf = confArray[idx];

	// ½½¶óÀÌµù µÇ¾îÁö´Â ·¹ÀÌ¾î À§Ä¡/Å©±â ¼³Á¤
	for(i = 0 ; i < conf.slideLayerCnt ; i++)
	{
		curLayer = eval(conf.slideLayerNameBody + i);
		curLayer.style.width	= conf.slideLayerWidth;
		curLayer.style.height	= conf.slideLayerHeight;
		curLayer.style.top		= (i * conf.slideLayerHeight);
	}
	
	// º¸¿©Áö´Â ¿µ¿ª ·¹ÀÌ¾î À§Ä¡/Å©±â ¼³Á¤
	curLayer = eval(conf.viewLayerName);
	curLayer.style.width	= conf.viewLayerWidth;
	curLayer.style.height	= conf.viewLayerHeight;
	curLayer.style.visibility = "";	
}

// ½½¶óÀÌµå ½ÃÀÛ ÇÔ¼ö
function startSlide(idx)
{
	var holdTime = 0;
	var conf = confArray[idx];

	// ¸ØÃã »óÅÂ°¡ ¾Æ´Ï¸é ½½¶óÀÌµå ÀÌµ¿
	if(!conf.pause)
	{
		// Timeout ½Ã°£ °è»ê
		// ½½¶óÀÌµå°¡ ÀÌµ¿ÇØ¼­ ÇÏ³ªÀÇ ·¹ÀÌ¾î°¡ ¿ÏÀüÈ÷ »ç¶óÁö¸é
		// slideHoldInterval ¸¸Å­ ´ë±âÇÑ´Ù.

		// Ã¹ È£Ãâ½Ã³ª ÇÏ³ªÀÇ ·¹ÀÌ¾î°¡ ½½¶óÀÌµå µÇ¾î »ç¶óÁ³À» °æ¿ì
		if(conf.holdCnt == 0 || (conf.slideMoveAmt * conf.moveCnt >= conf.slideHoldMoveAmt - 1))
		{
			holdTime		= conf.slideHoldInterval;
			conf.moveCnt	= 0;
			conf.holdCnt++;
		}
		// ½½¶óÀÌµå ÀÌµ¿
		else
		{
			holdTime		= conf.slideMoveInterval;	// Timeout Interval
			conf.moveCnt++;								// ÀÌµ¿È¸¼ö Áõ°¡
		}

		// ½½¶óÀÌµå µÇ¾îÁö´Â ·¹ÀÌ¾îÀÇ °³¼ö°¡
		// ÇÑ¹ø¿¡ º¸¿©Áö´Â ·¹ÀÌ¾îÀÇ °³¼öº¸´Ù ¸¹À» °æ¿ì¸¸ ½½¶óÀÌµå¸¦ ÇÑ´Ù.
		if(conf.slideLayerCnt > conf.viewSlideCnt)
			vertSlide(idx);		// ·¹ÀÌ¾î¸¦ slideMoveAmt ¸¸Å­ ÀÌµ¿½ÃÅ²´Ù
	}

	// Timer ¸¦ ÀÌ¿ëÇØ startSlide() ¸¦ holdTime °£°ÝÀ¸·Î È£ÃâÇÑ´Ù.
	conf.timer = setTimeout("startSlide(" + idx + ")", holdTime);
}

function vertSlide(idx)
{
	var i = 0;
	var curLayer;
	var conf = confArray[idx];

	for(i = 0 ; i < conf.slideLayerCnt ; i++)
	{
		// ·¹ÀÌ¾î Object reference ±¸ÇÏ±â
		curLayer = eval(conf.slideLayerNameBody + i);
		// ·¹ÀÌ¾î À§Ä¡ Á¶Á¤
		curLayer.style.top = parseInt(curLayer.style.top) - conf.slideMoveAmt;
		
		// contentLayerN ÀÌ ½ºÅ©·ÑµÇ¾î viewLayer À§·Î »ç¶óÁö¸é top °ªÀ» Á¶ÀýÇØ
		// ¾Æ·¡¿¡¼­ ¿Ã¶ó¿Àµµ·ÏÇÑ´Ù.
		if(conf.slideLayerHeight + parseInt(curLayer.style.top) < 0)
			curLayer.style.top = (conf.slideLayerCnt - 1) * conf.slideLayerHeight - 1;
	}

	// timer clear
	clearTimeout(conf.timer);
}

// Àá½Ã ¸ØÃã
function stopSlide(idx)
{
	var conf = confArray[idx];
	if(conf)
		conf.pause = true;
}

// ´Ù½Ã ½½¶óÀÌµå ½ÃÀÛ
function resumeSlide(idx)
{
	var conf = confArray[idx];
	if(conf)
		conf.pause = false;
}
