/*
=======================================================================
 ÀÌ¹ÌÁö ½½¶óÀÌµå
-----------------------------------------------------------------------
 »ç¿ë¿¹Á¦ (ÁÖ! [½½¶óÀÌµåID]("SlideTest")¿Í  »ý¼ºÇÏ´Â º¯¼ö¸í(SlideTest)Àº ¹Ýµå½Ã µ¿ÀÏ ÇØ¾ß ÇÔ)
<div class="mod_common03 mod_photoMovie">
	<div class="inner">
		<h2>Æ÷Åä/µ¿¿µ»ó</h2>
			<script>
				SlideTest = new GallerySlide("SlideTest");						// ±âº» °ª : 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 1°³¾¿ ÀÌµ¿ , ¿ÞÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 86x66, 3ÃÊ¸¶´Ù ÀÌµ¿
				// ±âÅ¸ ¿É¼Ç(ÀÌ¹ÌÁö ¼ö, ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö, ÀÌ¹ÌÁö °¡·Î Å©±â, ÀÌ¹ÌÁö ¼¼·Î Å©±â, ½½¶óÀÌµå ¼Óµµ)À» Àû¿ëÇÒ °æ¿ì
				//SlideTest = new GallerySlide("SlideTest", 3);					// 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 1°³¾¿ ÀÌµ¿ , ¿ÞÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 86x66, 3ÃÊ¸¶´Ù ÀÌµ¿
				//SlideTest = new GallerySlide("SlideTest", 3, 1);				// 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 1°³¾¿ ÀÌµ¿ , ¿ÞÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 86x66, 3ÃÊ¸¶´Ù ÀÌµ¿
				//SlideTest = new GallerySlide("SlideTest", 3, 3, 1);			// 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 3°³¾¿ ÀÌµ¿ , ¿À¸¥ÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 86x66, 3ÃÊ¸¶´Ù ÀÌµ¿
				//SlideTest = new GallerySlide("SlideTest", 3, 3, 1, 66, 66);	// 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 3°³¾¿ ÀÌµ¿ , ¿À¸¥ÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 66x66, 3ÃÊ¸¶´Ù ÀÌµ¿
				//SlideTest = new GallerySlide("SlideTest", 3, 3, 1, 66, 66, 5000);		// 3°³ ÀÌ¹ÌÁö°¡ º¸ÀÌ¸é¼­, 3°³¾¿ ÀÌµ¿ , ¿À¸¥ÂÊÀ¸·Î ÀÌµ¿ , ÀÌ¹ÌÁö Å©±â 66x66, 5ÃÊ¸¶´Ù ÀÌµ¿
				SlideTest.Start();
			</script>
		</div>
	</div>
=======================================================================

*/

function GallerySlide()
{
	// ¸Å°³º¯¼ö ÀÔ·Â
	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];	// ½½¶óÀÌµå ¼Óµµ
	
	// º¸¿©Áú ÀÌ¹ÌÁö ¼ö (±âº»°ª : 3°³)
	if (this.ShowCount == null) this.ShowCount = 3;		
	// ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö (±âº»°ª : 1°³)
	if (this.ShowGroup == null) this.ShowGroup = 1;			
	// ÀÌ¹ÌÁö ÀÌµ¿ ¹æÇâ (±âº»:¿ÞÂÊ = 0)
	if (this.ShowDirec == null) this.ShowDirec = 0;		
	// ÀÌ¹ÌÁö Å©±â	(±âº»°ª : 86x66)
	if ( this.ImgWidth	== null || this.ImgHeight == null)
	{
		// ¸Å°³º¯¼ö °ª ÀÔ·Â½Ã ÀÌ¹ÌÁö Å©±â 86x66À¸·Î °íÁ¤
		this.ImgWidth = 86;
		this.ImgHeight = 66;
	}
	// ½½¶óÀÌµå ¼Óµµ (±âº»°ª : 3ÃÊ = 3,000ms) 
	if (this.SlideSpeed == null) this.SlideSpeed	= 3000;

	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 += "									<div class=\"imgMdlBox\">";
		SlideHtml += "										<p class=\"imgBox\">";
		SlideHtml += "											<a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" alt=\"\" border=\"0\" width=\"" + this.ImgWidth + "\" height=\"" + this.ImgHeight + "\"/></a>";
		SlideHtml += "										</p>";
		SlideHtml += "										<p class=\"descBox\">";
		SlideHtml += "											<a href=\"" + SlideLink + "\">" + SlideTitle + "</a>";
		SlideHtml += "										</p>";
		SlideHtml += "									</div>";
		// HTML¼Ò½º Item µî·Ï
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;			
	}

	// ÃÊ±â ¼ÂÆÃ
	// ÀÌ¹ÌÁö ½½¶óÀÌµå°¡ µé¾î°¥ DIV¿Í ´ÙÀ½ ¹× ÀÌÀü ¹öÆ° ÀÌ¹ÌÁö
	this.Start = function () {
		SlideBase = "";			
		// ÆÄ¶ó¹ÌÅÍ °ª È®ÀÎ¿ë
		// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		// SlideBase += "<center>" + this.SlideID + " : " + this.ShowCount + "," + this.ShowGroup + "," + this.ShowDirec + "," + this.ImgWidth + "," + this.ImgHeight + "," + this.SlideSpeed + "</center>";
		// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		SlideBase += "						<div class=\"listBox\" onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\">";
		SlideBase += "							<a href=\"javascript:" + this.SlideID + ".Prev();\"><img src=\"http://newsimg.nate.com/img/2007/btn/btn_02_left_arrow.gif\"  alt=\"\" border=\"0\" class=\"lbtn\" /></a>";
		SlideBase += "							<a href=\"javascript:" + this.SlideID + ".Next();\"><img src=\"http://newsimg.nate.com/img/2007/btn/btn_02_right_arrow.gif\"   alt=\"\" border=\"0\" class=\"rbtn\" /></a>";
		SlideBase += "							<div class=\"innerBox\" 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 = "";			
		for( i = this.CurShow; i < (this.CurShow + this.ShowCount); i++ )
		{
			tmpHTML += this.Item[(i % this.ItemCount)];
		}
		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; }
}


/*
=======================================================================
 ÅØ½ºÆ® ·Ñ¸µ
-----------------------------------------------------------------------
 »ç¿ë¿¹Á¦ (ÁÖ! [½½¶óÀÌµåID]("RollingTest")¿Í »ý¼ºÇÏ´Â º¯¼ö¸í(RollingTest)Àº ¹Ýµå½Ã µ¿ÀÏ ÇØ¾ß ÇÔ)
<div class="hotIssueBox">
	<dl>
		<dt><span>ÇÃ·¯½º ÅäÇÈ</span></dt>
		<dd><script>		
			RollingTest = new TextRolling("RollingTest");// ±âº» °ª : 1°³ ÅØ½ºÆ®°¡ º¸ÀÌ¸é¼­, 1°³¾¿ ÀÌµ¿ , À§·Î ÀÌµ¿, 3ÃÊ¸¶´Ù ÀÌµ¿
			RollingTest.add("http://","11111111111111111111111");
			RollingTest.add("http://","22222222222222222222222");
			RollingTest.add("http://","33333333333333333333333");			
			RollingTest.Start();
		</script></dd>
	</dl>
</div>
-----------------------------------------------------------------------
 º¯°æ³¯Â¥		º¯°æÀÚ	º¯°æ³»¿ë
=======================================================================

*/	
function TextRolling()
{
	// ¸Å°³º¯¼ö ÀÔ·Â
	this.SlideID	= arguments[0];	// ½½¶óÀÌµåID
	this.ShowCount	= arguments[1];	// º¸¿©Áú ÅØ½ºÆ® ¼ö
	this.ShowGroup	= arguments[2];	// ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö
	this.ShowDirec	=	arguments[3];	// ÅØ½ºÆ® ÀÌµ¿ ¹æÇâ 
	this.SlideSpeed	= arguments[4];	// ½½¶óÀÌµå ¼Óµµ
	
	// º¸¿©Áú ÅØ½ºÆ® ¼ö (±âº»°ª : 1°³)
	if (this.ShowCount == null) this.ShowCount = 1;		
	// ´ÙÀ½ º¸¿©Áú ¹­À½ ¼ö (±âº»°ª : 1°³)
	if (this.ShowGroup == null) this.ShowGroup = 1;			
	// ÅØ½ºÆ® ÀÌµ¿ ¹æÇâ (±âº»:À§ = 0) 
	if (this.ShowDirec == null) this.ShowDirec = 0;		
	// ½½¶óÀÌµå ¼Óµµ (±âº»°ª : 3ÃÊ = 3,000ms)
	if (this.SlideSpeed == null) this.SlideSpeed = 3000;
		
	this.Item		= new Array();	// ÅØ½ºÆ® Á¤º¸¸¦ ´ãÀ» ¹è¿­
	this.ItemCount	= 0;			// ÅØ½ºÆ® Á¤º¸ ¹è¿­ Å©±â
	this.CurShow	= 0;			// ÇöÀç º¸¿©Áö´Â Ã¹¹øÂ° ÅØ½ºÆ® ¹øÈ£
	this.Stop		= false;		// ÁßÁö¿©ºÎ (ÅØ½ºÆ® ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Over½Ã ÁßÁö¸¦ À§ÇØ)

	// ½½¶óÀÌµå ÅØ½ºÆ® Á¤º¸ Ãß°¡
	// »ç¿ë½Ã ¸Å°³º¯¼ö·Î XXX.add(¸µÅ©URL, Á¦¸ñ)À» ÀÔ·Â
	this.add = function () {
		SlideLink = arguments[0];		// ¸µÅ© URL
		SlideTitle = arguments[1];		// Á¦¸ñ
		SlideHtml = "";
		SlideHtml += "<a href=\"" + SlideLink + "\">" + SlideTitle + "</a>";			
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;			
	}

	// ÃÊ±â ¼ÂÆÃ
	// ÅØ½ºÆ® ½½¶óÀÌµå°¡ µé¾î°¥ DIV
	this.Start = function () {			
		SlideBase = "";
		// ÆÄ¶ó¹ÌÅÍ °ª È®ÀÎ¿ë
		// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		// SlideBase += this.SlideID + " : " + this.ShowCount + "," + this.ShowGroup + "," + this.ShowDirec + "," + this.SlideSpeed;
		// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------			
		SlideBase += "<div onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\"><div id=\"" + this.SlideID + "\"></div>";
		document.write(SlideBase);
		this.ChangeText();
		setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);
	}
	
	// ÀÚµ¿ ·Ñ¸µ
	this.Rolling = function(){
		if(!this.Stop) {
			this.MoveText(this.ShowDirec);
			this.ChangeText();
		}
		setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);
	}
	
	// ´ÙÀ½ ¹öÆ° ±â´É
	this.Next = function(){			
		this.MoveText(0);
		this.ChangeText();
	}
	
	// ÀÌÀü ¹öÆ° ±â´É
	this.Prev = function(){
		this.MoveText(1);
		this.ChangeText();
	}

	// ÅØ½ºÆ® ÀÌµ¿ ±â´É
	this.MoveText = 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.ChangeText = function() {
		tmpHTML = "";			
		for( i=this.CurShow; i<(this.CurShow+this.ShowCount); i++ ) {
			tmpHTML += this.Item[(i % this.ItemCount)];
			if( this.ShowCount > 1) tmpHTML += "\n<br>";
		}
		Obj = document.getElementById(this.SlideID);
		Obj.innerHTML= tmpHTML;
	}
	
	// ÅØ½ºÆ® ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Over ½Ã Á¤Áö ¼³Á¤
	this.MouseOver = function(){ this.Stop = true; }		
	// ÅØ½ºÆ® ½½¶óÀÌµå ºÎºÐ ¸¶¿ì½º Out ½Ã Á¤Áö ÇØÁ¦
	this.MouseOut = function(){ this.Stop = false; }
}