/*
	»ç¿ë¿¹)

  <DIV ID='SwapTextDIV' STYLE='
  filter:
  progid:DXImageTransform.Microsoft.Barn(orientation=vertical, motion=in)
  progid:DXImageTransform.Microsoft.Blinds(bands=4, direction='LEFT')
  progid:DXImageTransform.Microsoft.Blinds(bands=4, direction='LEFT')
  progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion='forward', duration=1)
  progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion='reverse', duration=1)
  ;
  position:relative; top:0; left:0; width:100%; height:115px;'><p id='SwapTextSpan'></p></div>

	<script language='JavaScript'>
		var swaptext = new SwapText();
		swaptext.setContainer(document.getElementById('SwapTextDIV'));
		swaptext.setContentsPlace(document.getElementById('SwapTextSpan'));

		var html = '';
  	html +='<table width='100%' cellpadding='0' cellspacing='0' border='0'>';
    html +='  <tr>';
    html +='    <td align='center' valign='top'><a href='#'><img src='/image/shopping/sample_book75.gif' width='75' height='94' border='1' /></a></td>';
    html +='    <td class='c_txt9_gray1' style='padding:3px' valign='top'><a href=''><b>µ¿¾ÆÅ¥ºê»çÈ¸ 4-1(2007³â) </b></a><br />';
    html +='      <font class='c_txt9_gray'><a href=''>µÎ»êµ¿¾Æ <br />';
    html +='      2007³â ½ÃÇè´ëºñ ÀÔÃ¼ ÇÐ½À ½Ã½ºÅÛ µ¿¾ÆÅ¥ºê»çÈ¸ </a></font></td>';
    html +='  </tr>';
    html +='</table>';
		swaptext.add(html);

		html = '';
  	html +='<table width='100%' cellpadding='0' cellspacing='0' border='0'>';
    html +='  <tr>';
    html +='    <td align='center' valign='top'><a href='#'><img src='/image/shopping/sample_book75.gif' width='75' height='94' border='1' /></a></td>';
    html +='    <td class='c_txt9_gray1' style='padding:3px' valign='top'><a href=''><b>ÀÎ¿µÀÌ ¸¸¼¼ </b></a><br />';
    html +='      <font class='c_txt9_gray'><a href=''>ÀÎ¿µÀÌ ¸¸¼¼ <br />';
    html +='      ¸¸¼¼ ¸¸¼¼ ¸¸¸¸¼¼! </a></font></td>';
    html +='  </tr>';
    html +='</table>';
		swaptext.add(html);


		swaptext.setSwapspeed(4000);
		swaptext.start();
	</script>
*/

function SwapText() {
	this.objname 	= "swaptext";
	this.textlist = new Array();
	this.objid		= new Array();

	this.TIMER = 0;

	this.container = null;
	this.contentsplace = null;
	this.isrun = true;
	this.swapspeed = 1000;
	this.filtercount 	= 0;
	this.currentindex = 0;
	this.filterindex	= 0;

	this.setSwapspeed = function() {
		this.swapspeed = arguments[0];
	}

	this.setContainer = function() {
		this.container = arguments[0];
	}

	this.setContentsPlace = function() {
		this.contentsplace = arguments[0];
	}

	this.add = function() {
		text = arguments[0];
		this.textlist[this.textlist.length++] = text;
	}

	this.start = function() {
		if (this.textlist != null && this.textlist.length > 0) {
			if (this.container.filters != null && this.container.filters.length > 0) {
				this.filtercount = this.container.filters.length;
			}

			this.swap();
		}
		else {
			document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' style='font-weight:normal;'><tr><td>°Ë»ö °á°ú°¡ ¾ø½À´Ï´Ù.</td></tr></table>");
		}
	}

	this.swap = function() {
		if (this.isrun) {
			if (this.textlist != null && this.textlist.length > 0) {

				try {
					if (this.filtercount > 0) {
						this.container.filters[this.filterindex].Apply();
						this.contentsplace.innerHTML = this.textlist[this.currentindex];
						this.container.filters[this.filterindex].Play();

						this.filterindex++;

						if (this.filterindex > this.filtercount-1) this.filterindex = 0;
					}
					else {
						this.contentsplace.innerHTML = this.textlist[this.currentindex];
					}

					this.currentindex++;

					if (this.currentindex >= this.textlist.length) this.currentindex = 0;
				}
				catch(e) {
					alert(e.message);
					clearTimeout(TIMER);
				}
			}
		}
		TIMER = setTimeout(this.objname + ".swap()", this.swapspeed);
	}

	this.swapStart = function() {
		this.isrun = true;
	}

	function swapStop() {
		this.isrun = false;
	}
}
