/*------------------------------------------------------------------------------
¨Ï Copyright 2005, Flyfox All right reserved.
@ÆÄÀÏ³»¿ë: Scroll Layer Appoint Javascript Function
@¼öÁ¤³»¿ë/¼öÁ¤ÀÚ/¼öÁ¤ÀÏ:

* function °£ÀÇ °£°Ý : 3 line
* ³»ºÎºí·°( ÇÇÁ¦¾îºÎ ) µé¿©¾²±â : 2 column
------------------------------------------------------------------------------*/



if ( typeof( scrollLayerAppoint ) == 'undefined' ){



	/*-------------------------------------
	 Scroll Layer Original
	-------------------------------------*/
	var scrollLayerAppoint = function ( divid, appointid, Objnm, term_top, term_side ){

		this.getBrowser();

		this.timerID;


		{ // ½ºÅ©·Ñ ·¹ÀÌ¾î ÀÌ¸§

			if ( this.isNS4 ) {
				this.scrollingBanner = document[ divid ];
			}
			else if ( this.isDOM ) {
				this.scrollingBanner = this.getRef( divid );
			}
		}


		{  // ÁöÁ¤À§Ä¡

			if ( appointid != '' ){

				if ( this.isNS4 ) {
					this.appointid = document[appointid];
				}
				else if ( this.isDOM ) {
					this.appointid = this.getRef( appointid );
				}
			}
		}


		this.Objnm = Objnm; // ½ºÅ©·Ñ ½ÇÇàº¯¼ö ÀÌ¸§

		this.term_top = term_top; // ½ºÅ©·Ñ ·¹ÀÌ¾î »ó´Ü °£°Ý

		this.term_side = term_side; // ½ºÅ©·Ñ ·¹ÀÌ¾î Ãø¸é °£°Ý
	}



	/*-------------------------------------
	 Scroll Layer Property - get Browser
	-------------------------------------*/
	scrollLayerAppoint.prototype.getBrowser = function (){

		this.isDOM = ( document.getElementById ? 1 : 0 );
		this.isIE4 = ( ( document.all && !this.isDOM ) ? 1 : 0 );
		this.isNS4 = ( document.layers ? 1 : 0 );
		this.isNS = navigator.appName == "Netscape";
	}



	/*-------------------------------------
	 Scroll Layer Property - get Document Obj
	-------------------------------------*/
	scrollLayerAppoint.prototype.getRef = function ( id ){

		if ( this.isDOM ) return document.getElementById( id );
		if ( this.isIE4 ) return document.all[id];
		if ( this.isNS4 ) return document.layers[id];
	}



	/*-------------------------------------
	 Scroll Layer Property - reset position
	-------------------------------------*/
	scrollLayerAppoint.prototype.resetPosition = function (){

		if ( this.appointid != null ){

			if ( this.isNS4 ) {

				this.MaxtopQuantity = this.appointid.top;
				this.MaxleftQuantity = this.appointid.style.left;
			}
			else if ( this.isDOM ) {

				this.MaxtopQuantity = this.appointid.offsetTop;
				this.MaxleftQuantity = this.appointid.offsetLeft;
			}

		}

		this.appoint_top = this.MaxtopQuantity;

		this.MaxtopQuantity += this.term_top;
		this.MaxleftQuantity += this.term_side;


		if ( this.scrollingBanner != null ){

			if ( this.isNS4 ) {

				this.scrollingBanner.top = this.MaxtopQuantity;
				this.scrollingBanner.style.left = this.MaxleftQuantity;
			}
			else if ( this.isDOM ) {

				this.scrollingBanner.style.top = this.MaxtopQuantity;
				this.scrollingBanner.style.left = this.MaxleftQuantity;
			}
		}
	}



	/*-------------------------------------
	 Scroll Layer Property - action start
	-------------------------------------*/
	scrollLayerAppoint.prototype.start = function (){

		{ // ·¹ÀÌ¾î, ÁöÁ¤À§Ä¡ Á¸Àç¿©ºÎ Ã¼Å©

			if ( this.scrollingBanner == null ){
				return;
			}

			if ( this.appointid == null ){
				return;
			}
		}


		this.resetPosition(); // reset position ½ÇÇà


		{ // Ãâ·Â

			if ( this.isNS4 ) {
				this.scrollingBanner.visibility = "visible";
			}
			else if ( this.isDOM ) {
				this.scrollingBanner.style.visibility = "visible";
			}
		}


		this.movingSlide();
	}



	/*-------------------------------------
	 Scroll Layer Property - action stop
	-------------------------------------*/
	scrollLayerAppoint.prototype.stop = function (){

		clearTimeout( this.timerID );

		this.resetPosition(); // reset position ½ÇÇà
	}



	/*-------------------------------------
	 Scroll Layer Property - moving
	-------------------------------------*/
	scrollLayerAppoint.prototype.movingSlide = function (){

		var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;


		{ // yMenuFrom, yMenuTo °è»ê

			if ( this.isNS4 ) {

				yMenuFrom	 = this.scrollingBanner.top;
				yMenuTo		 = window.pageYOffset;
			}
			else if ( this.isDOM ) {

				yMenuFrom	 = parseInt ( this.scrollingBanner.style.top, 10 );
				yMenuTo		 = ( this.isNS ? window.pageYOffset : document.body.scrollTop );
			}

			if ( yMenuTo < ( this.MaxtopQuantity  ) ) yMenuTo = this.MaxtopQuantity;
			else yMenuTo -= this.appoint_top - this.term_top;

			//window.status = 'yMenuTo=' + yMenuTo + ', yMenuFrom=' + yMenuFrom + ',MaxleftQuantity=' + this.MaxleftQuantity;
		}


		timeoutNextCheck = 500;

		if ( yMenuFrom != yMenuTo ) {

			yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 10 );
			if ( yMenuTo < yMenuFrom ) yOffset = -yOffset;
			if ( this.isNS4 ) this.scrollingBanner.top += yOffset;
			else if ( this.isDOM ) this.scrollingBanner.style.top = parseInt ( this.scrollingBanner.style.top, 10 ) + yOffset;
			timeoutNextCheck = 10;
		}

		this.timerID = setTimeout ( this.Objnm + ".movingSlide();", timeoutNextCheck );
	}



}



/*------------------------------------------------------------------------------
È£Ãâ¿¹Á¦


<div id=scrollingLeft style="VISIBILITY:hidden;POSITION:absolute;z-index=2">
<table width="90" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" valign="top" bgcolor=ffffff>¿©±â°¡ ½ºÅ©·Ñ ÁÂÃø º£³Ê</td>
  </tr>
</table>
</div>

<div id=scrollingRight style="VISIBILITY:hidden;POSITION:absolute;z-index=2">
<table width="90" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" valign="top" bgcolor=ffffff>¿©±â°¡ ½ºÅ©·Ñ ¿ìÃø º£³Ê</td>
  </tr>
</table>
</div>


<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var scrLayerLeft;
var scrLayerRight;

function scrollBegin(){

	scrLayerLeft = new scrollLayerAppoint( divid='scrollingLeft', appointid='standard_table', Objnm='scrLayerLeft', term_top=80, term_side=-90  );
	scrLayerLeft.start();

	scrLayerRight = new scrollLayerAppoint( divid='scrollingRight', appointid='standard_table', Objnm='scrLayerRight', term_top=80, term_side=900 );
	scrLayerRight.start();
}

function scrollResize(){
	scrLayerLeft.resetPosition();
	scrLayerRight.resetPosition();
}


window.onload = scrollBegin;
window.onresize = scrollResize;
//-->
</SCRIPT>


<table width="900" align="center" border="0" cellpadding="0" cellspacing="0" id="standard_table">
  <tr>
    <td bgcolor="#eeeeee" align="center"><font color="#000000"> ³ª ¹ÙµðºÎºÐ! </font></td>
  </tr>
</table>
------------------------------------------------------------------------------*/