/*************************************************************
  
  Å¬·¡½º ÇüÅÂÀÇ ¶óÀÌºê·¯¸®¼º ÇÔ¼ö¸¦ Á¦°ø
   
 **************************************************************/
 
// ¹è³Ê ·ÎÅ×ÀÌ¼Ç
function cls_bannerRotation(){
	this.n =- 1; // ¹æ ¹øÈ£ (ÁÙ)
	this.delay = 5000; // µô·¹ÀÌ
	this.active = true;		
	this.rotationObj;
	this.instance;

	this.rotation = function(){
		if(!this.active){
			setTimeout(this.instance + ".rotation()",this.delay);
			return;
		}
		this.n++;
		if(this.n>=this.rotationObj.length){
			this.n =0;
		}		
		this.display();
		setTimeout(this.instance + ".rotation()",this.delay);
	}
	
	// ·¹ÀÌ¾î Ç¥½Ã 
	this.display = function() {
		for(var i=0 ;i< this.rotationObj.length;i++){
			this.rotationObj[i].style.display="none";
		}					
		this.rotationObj[this.n].style.display="block";		
	}
	
	// ÀÌÀüÀ¸·Î °¡±â
	this.prev = function(){
		this.n--;
		if(this.n < 0){
			this.n =  this.rotationObj.length - 1;
		}
		this.display();
	}

	// ÀÌÈÄ·Î  °¡±â
	this.next = function(){
		this.n++;
		if(this.n >= this.rotationObj.length){
			this.n = 0;
		}
		this.display();
	}

	// ½ÃÀÛ
	this.start = function(){
		this.rotation();
	}

	// Àç½ÃÀÛ
	this.play = function(){
		this.active = true;
	}

	// ¸ØÃã
	this.stop = function(){
		this.active = false;
	}
}
	 
// ÀÌ¹ÌÁö ·ÎÅ×ÀÌ¼Ç °´Ã¼
function cls_imageRotation(){
	this.n=0; // ÀÌ¹ÌÁö ¹æ¹øÈ£
	this.imageHolder = new Array; // ·ÎÅ×ÀÌ¼ÇµÉ ÀÌ¹ÌÁö °æ·Î°¡ µé¾î°¥ ¹è¿­
	this.delay=3000; // µô·¹ÀÌ
	this.imageObj; // ÀÌ¹ÌÁö °´Ã¼ ¾ÆÀÌµð
	this.active = true;;
	this.instance = ""; //ÀÎ½ºÅÏ½º ÀÌ¸§

	this.rotation = function(){
		if(!this.active){
			setTimeout(this.instance + ".rotation()",this.delay);
			return;
		}
		if(this.n>=this.imageHolder.length){
			this.n =0;
		}
		document.all[this.imageObj].src = this.imageHolder[this.n];
		this.n++;
		setTimeout(this.instance + ".rotation()",this.delay);

	}

	// ½ÃÀÛ
	this.start = function(){
		this.rotation();
	}

	// Àç½ÃÀÛ
	this.play = function(){
		this.active = true;
	}

	// ¸ØÃã
	this.stop = function(){
		this.active = false;
	}

}
	 

