
function NImgSlide()
	{
		// ¸Å°³º¯¼ö ÀÔ·Â
		this.SlideID		= arguments[0];	// ½½¶óÀÌµåID
		this.ShowCount	= arguments[1];	// º¸¿©Áú ÀÌ¹ÌÁö ¼ö
		this.ShowGroup	= arguments[2];	// ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö
		this.ShowDirec	= arguments[3];	// ÀÌ¹ÌÁö ÀÌµ¿ ¹æÇâ 
		this.ImgWidth		= arguments[4];	// ½½¶óÀÌµå ÀÌ¹ÌÁö °¡·Î Å©±â
		this.ImgHeight	= arguments[5];	// ½½¶óÀÌµå ÀÌ¹ÌÁö ¼¼·Î Å©±â
		this.SlideSpeed	= arguments[6];	// ½½¶óÀÌµå ¼Óµµ
		
		// Start ------------------------------ ÀÔ·ÂÇÏÁö ¾Ê´Â °æ¿ì ±âº»°ª ¼³Á¤
		
		// º¸¿©Áú ÀÌ¹ÌÁö ¼ö (±âº»°ª : 3°³)
		if (this.ShowCount == null)
			this.ShowCount = 4;
		
		// ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö (±âº»°ª : 1°³)
		if (this.ShowGroup == null)
			this.ShowGroup = 1;
			
		// ÀÌ¹ÌÁö ÀÌµ¿ ¹æÇâ (±âº»:¿ÞÂÊ = 0)
		if (this.ShowDirec == null)
			this.ShowDirec = 0;
		
		// ÀÌ¹ÌÁö Å©±â	(±âº»°ª : 110x90)
		if ( this.ImgWidth	== null || this.ImgHeight == null)
		{
			// ¸Å°³º¯¼ö °ª ÀÔ·Â½Ã ÀÌ¹ÌÁö Å©±â 86x66À¸·Î °íÁ¤
			this.ImgWidth	= 89;
			this.ImgHeight	= 67;
		}

		// ½½¶óÀÌµå ¼Óµµ (±âº»°ª : 3ÃÊ = 3,000ms)
		if (this.SlideSpeed == null)
			this.SlideSpeed	= 6000;
			
		// End ------------------------------ ÀÔ·ÂÇÏÁö ¾Ê´Â °æ¿ì ±âº»°ª ¼³Á¤
		
		this.Item		= new Array();	// ÀÌ¹ÌÁö Á¤º¸¸¦ ´ãÀ» ¹è¿­
		this.ItemCount	= 0;						// ÀÌ¹ÌÁö Á¤º¸ ¹è¿­ Å©±â
		this.CurShow	= 0;						// ÇöÀç º¸¿©Áö´Â Ã¹¹øÂ° ÀÌ¹ÌÁö ¹øÈ£
		this.Stop		= false;				// ÁßÁö¿©ºÎ (ÀÌ¹ÌÁö ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Over½Ã ÁßÁö¸¦ À§ÇØ)

			// ½½¶óÀÌµå ÀÌ¹ÌÁö Á¤º¸ Ãß°¡
			// »ç¿ë½Ã ¸Å°³º¯¼ö·Î XXX.add(¸µÅ©URL, ÀÌ¹ÌÁöURL, ÀÌ¹ÌÁö Á¦¸ñ)À» ÀÔ·Â
			this.add = function () {
				SlideLink	= arguments[0];		// ¸µÅ© URL
				SlideImage	= arguments[1];		// ÀÌ¹ÌÁö URL
				SlideTitle	= arguments[2];		// ÀÌ¹ÌÁö Á¦¸ñ

				// ÀÌ¹ÌÁö ±ôºýÀÓÀ» ¾ø¿¡±â À§ÇØ ¹Ì¸® ÀÌ¹ÌÁö ·Îµù
				(new Image).src = SlideImage;
				
				SlideHtml = "";

				SlideHtml += "								<li class=\"liImg\"><a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" alt=\"\" border=\"0\" width=\"" + this.ImgWidth + "\" height=\"" + this.ImgHeight + "\"/></a><BR><div style=\"width:89px; float:left; padding-top:7px;\">";
				SlideHtml += "								<a href=\"" + SlideLink + "\">" + SlideTitle + "</a></li>";
				
				// HTML¼Ò½º Item µî·Ï
				this.Item[this.ItemCount] = SlideHtml;
				this.ItemCount++;
				
			}
		
			// ÃÊ±â ¼ÂÆÃ
			// ÀÌ¹ÌÁö ½½¶óÀÌµå°¡ µé¾î°¥ DIV¿Í ´ÙÀ½ ¹× ÀÌÀü ¹öÆ° ÀÌ¹ÌÁö
			this.Start = function () {				
				SlideBase = "";
				SlideBase += "						<div onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\">";
				SlideBase += "						<ul id=\"hotChal1\">";
				SlideBase += "							<li class=\"floatL\"><a href='/Chalkadak/main.html'><img src=\"http://i.jjang0u.com/Nimages/main2/titleChal.jpg\" width=\"78\" border='0'></a></li>";
				SlideBase += "							<li class=\"liL\"><a href=\"javascript:" + this.SlideID + ".Prev();\"><img src=\"http://i.jjang0u.com/Nimages/main2/RollBtnL.jpg\"></a></li>";
				SlideBase += "							<li class=\"liR\"><a href=\"javascript:" + this.SlideID + ".Next();\"><img src=\"http://i.jjang0u.com/Nimages/main2/RollBtnR.jpg\"></a></li>";
				SlideBase += "						</ul>";
				SlideBase += "							<div class='hotChal2' id=\"" + this.SlideID + "\">";
				SlideBase += "							</div>"
				SlideBase += "						</div>"

				document.write(SlideBase);

				this.ChangeImage();
				
				setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);

			}
			
			// ÀÚµ¿ ·Ñ¸µ
			this.Rolling = function(){
				if(!this.Stop)
				{
					this.MoveImage(this.ShowDirec);
					this.ChangeImage();
				}
				setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);
			}
			
			// ´ÙÀ½ ¹öÆ° ±â´É
			this.Next = function(){	
				
				this.MoveImage(0);
				this.ChangeImage();
				
			}
			
			// ÀÌÀü ¹öÆ° ±â´É
			this.Prev = function(){	

				this.MoveImage(1);
				this.ChangeImage();
				
			}

			// ½½¶óÀÌµå ÀÌ¹ÌÁö ÀÌµ¿ ±â´É
			this.MoveImage = function() {
				ShowDirec		= arguments[0];		// ÀÌµ¿ ¹æÇâ (0:¿ÞÂÊ, 1:¿À¸¥ÂÊ)
				
				if(ShowDirec == 0){
	
					this.CurShow = this.CurShow + this.ShowGroup;
					
					if(this.CurShow >= this.ItemCount)
						this.CurShow = 0;
				}
				else
				{
					this.CurShow = this.CurShow - this.ShowGroup;
					
					if(this.CurShow < 0)
						this.CurShow = this.ItemCount - 1;
				}
				
			}
			
			// ½½¶óÀÌµå ÀÌ¹ÌÁö º¯°æ ±â´É
			this.ChangeImage = function() {
				tmpHTML = "";
				tmpHTML += "							<ul>";
				
				for( i = this.CurShow; i < (this.CurShow + this.ShowCount); i++ )
				{
					tmpHTML += this.Item[(i % this.ItemCount)];
					if(i<(this.CurShow + this.ShowCount - 1))
					tmpHTML += "								<li class=\"liL\">.</li>";
				}
				
				tmpHTML += "							</ul>";

				//tmpHTML += "\n								<br class=\"clear\" />";
				
				Obj = document.getElementById(this.SlideID);
				Obj.innerHTML= tmpHTML;
			}
			
			// ÀÌ¹ÌÁö ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Over ½Ã Á¤Áö ¼³Á¤
			this.MouseOver = function(){
				this.Stop = true;
			}
			
			// ÀÌ¹ÌÁö ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Out ½Ã Á¤Áö ÇØÁ¦
			this.MouseOut = function(){
				this.Stop = false;
			}
	}
	