function Gallery()
{
	// ¸Å°³º¯¼ö ÀÔ·Â
	this.SlideID	= arguments[0];
	this.ShowCount	= arguments[1];
	this.ShowGroup	= arguments[2];
	this.ShowDirec	= arguments[3];
	this.ImgWidth	= arguments[4];
	this.ImgHeight	= arguments[5];
	this.SlideSpeed	= arguments[6];
	
	if( this.ShowCount == null ) this.ShowCount = 5;
	if( this.ShowGroup == null ) this.ShowGroup = 1;			
	if( this.ShowDirec == null ) this.ShowDirec = 0;
	if( this.ImgWidth	== null || this.ImgHeight == null)
	{
		this.ImgWidth  = 80;
		this.ImgHeight = 80;
	}
	if( this.SlideSpeed == null ) this.SlideSpeed = 0;
	this.Item		= new Array();
	this.ItemCount	= 0;
	this.CurShow	= 0;
	this.Stop		= false;

	this.add = function(){
		SlideLink  = arguments[0];
		SlideImage = arguments[1];
		SlideTitle = arguments[2];
		(new Image).src = SlideImage;
		SlideHtml = "";
		if( SlideTitle=="" ) {
			SlideHtml += "&nbsp;<a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" border=\"0\" width=\"" + this.ImgWidth + "\" height=\"" + this.ImgHeight + "\"/></a>&nbsp;";
		} else {
			SlideHtml += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
			SlideHtml += "<tr><td align=\"center\"><a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" border=\"0\" width=\"" + this.ImgWidth + "\" height=\"" + this.ImgHeight + "\"/></a></td></tr>";
			SlideHtml += "<tr><td style=\"padding:15 0 0 0;\">" + SlideTitle + "</td></tr>";
			SlideHtml += "</table>";
		}
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;			
	}

	this.add2 = function(){
		SlideLink  = arguments[0];
		SlideImage = arguments[1];
		SlideTitle = arguments[2];
		(new Image).src = SlideImage;
		SlideHtml = "";
		if( SlideTitle=="" ) {
			SlideHtml += "&nbsp;<a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" border=\"0\" width=\"" + this.ImgWidth + "\" height=\"" + this.ImgHeight + "\"/></a>&nbsp;";
		} else {
			SlideHtml += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
			SlideHtml += "<tr><td align=\"center\"><div style=\"width:80;height:80;overflow-y:hidden;overflow-x:hidden;\"><center><a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\" border=\"0\"/></a></center></div>";
			SlideHtml += "</td></tr>";
			SlideHtml += "<tr><td style=\"padding:15 0 0 0;\">" + SlideTitle + "</td></tr>";
			SlideHtml += "</table>";
		}
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;			
	}
	
	this.add3 = function(){
		SlideLink  = arguments[0];
		SlideImage = arguments[1];
		SlideTitle = arguments[2];
		SlideEnd   = arguments[3];
		(new Image).src = SlideImage;
		SlideHtml = "";
		if( SlideEnd=="" ) {
			SlideHtml += "<dl><dd><a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\"></a></dd><dt><a href=\"" + SlideLink + "\">" + SlideTitle + "</a></dt></dl>";
		} else {
			SlideHtml += "<dl class=\"end\"><dd><a href=\"" + SlideLink + "\"><img src=\""+ SlideImage + "\"></a></dd><dt><a href=\"" + SlideLink + "\">" + SlideTitle + "</a></dt></dl>";
		}
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;
	}

	this.Start = function(){
		SlideBase = "";
		SlideBase += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		SlideBase += "<tr onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\">";
		SlideBase += "<td width=0 align=\"center\">";
		SlideBase += "	<a href=\"javascript:" + this.SlideID + ".Prev();\"><img src=\"http://newsimg.nate.com/img/2007/btn/btn_02_left_arrow.gif\" border=\"0\"/></a>";
		SlideBase += "</td>";
		SlideBase += "<td align=\"center\">";
		SlideBase += "	<div id=\"" + this.SlideID + "\"></div>";
		SlideBase += "</td>";
		SlideBase += "<td width=20 align=\"center\">";
		SlideBase += "	<a href=\"javascript:" + this.SlideID + ".Next();\"><img src=\"http://newsimg.nate.com/img/2007/btn/btn_02_right_arrow.gif\" border=\"0\"/></a>";
		SlideBase += "</td>";
		SlideBase += "</tr>";
		SlideBase += "</table>";
		document.write(SlideBase);
		this.ChangeImage();
		if( this.SlideSpeed!=0 )
			setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);
	}

	this.Start2 = function(){
		SlideBase = "";
		SlideBase += "			<div id=\"main_shopping\">";
		SlideBase += "				<ul>";
		SlideBase += "					<li class=\"main_shopping_title\">";
		SlideBase += "					<span class=\"main_shopping_title_margin\"><a href=\"javascript:" + this.SlideID + ".Prev();\" onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\"><img src=\"http://www.promcs.co.kr/images/main_shopping_left.gif\"\></a><a href=\"javascript:" + this.SlideID + ".Next();\" onMouseOver=\""+this.SlideID+".MouseOver();\" onMouseOut=\""+this.SlideID+".MouseOut();\"><img src=\"http://www.promcs.co.kr/images/main_shopping_right.gif\"></a></span></li>";
		SlideBase += "				</ul>";
		SlideBase += "				<ul>";
		SlideBase += "					<li>";
		SlideBase += "						<div class=\"PhotoModulebox\">";
		SlideBase += "							<div class=\"Photosheaf\" id=\"" + this.SlideID + "\">";

		SlideBase += "							</div>";
		SlideBase += "						</div>";
		SlideBase += "					</li>";
		SlideBase += "				</ul>";
		SlideBase += "			</div>";
		document.write(SlideBase);
		this.ChangeImage();
		if( this.SlideSpeed!=0 )
			setTimeout(this.SlideID + '.Rolling()',this.SlideSpeed);
	}

	this.Rolling = function(){
		if( !this.Stop ){
			this.MoveImage(this.ShowDirec);
			this.ChangeImage();
		}
		if( this.SlideSpeed!=0 )
			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];
		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;
	}
	
	this.MouseOver = function(){
		this.Stop = true;
	}
	
	this.MouseOut = function(){
		this.Stop = false;
	}
}

function TextRolling()
{
	// ¸Å°³º¯¼ö ÀÔ·Â
	this.SlideID	= arguments[0];
	this.ShowCount	= arguments[1];
	this.ShowGroup	= arguments[2];
	this.ShowDirec	= arguments[3];
	this.SlideSpeed	= arguments[4];
	
	if (this.ShowCount == null) this.ShowCount = 1;		
	if (this.ShowGroup == null) this.ShowGroup = 1;			
	if (this.ShowDirec == null) this.ShowDirec = 0;		
	if (this.SlideSpeed == null) this.SlideSpeed = 3000;
		
	this.Item		= new Array();
	this.ItemCount	= 0;
	this.CurShow	= 0;
	this.Stop		= false;

	this.add = function(){
		SlideLink	= arguments[0];
		SlideTitle	= arguments[1];
		SlideHtml = "";
		SlideHtml += "<img src='http://www.promcs.co.kr/images/icon_text_ad.gif'> <a href=\"" + SlideLink + "\">" + SlideTitle + "</a>";			
		this.Item[this.ItemCount] = SlideHtml;
		this.ItemCount++;
	}

	this.Start = function(){
		
		SlideBase = "";			
		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;
	}
	
	this.MouseOver = function(){
		this.Stop = true;
	}
	
	this.MouseOut = function(){
		this.Stop = false;
	}
}