// JavaScript Document
/*******************************************************************************
	ÆË¾÷Ã¢ °ü·Ã
*******************************************************************************/
function getCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
			offset += search.length // set index of beginning of value
			end = document.cookie.indexOf(";", offset) // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
			if (end == -1)
			end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
}

function openNotice(URL,title,features) {
	if(getCookie(title)!="done"){//ÆË¾÷Ã¢ Å¸ÀÌÆ²ÀÌ ÄíÅ°¿¡ ¾øÀ¸¸é
		var popup = window.open(URL,title,features); //À©µµ¿ÀÇÂ
		if( navigator.appName.substring(0,8) == "Netscape" ) { popup.location = URL; } 
	}
}

/*******************************************************************************
	°øÁö»çÇ× ¸¶¿ì½º ¿À¹ö½Ã ¼±ÅÃº° º¸¿©ÁÖ±â
*******************************************************************************/
function ShowNotice(idx){
	HideNotice();
	noticeImg[idx-1].src = "/images/notice0" + idx + "_ov.gif"
	noticeList[idx-1].style.display ="";
}

function HideNotice(){
	for(i = 1; i <= noticeImg.length; i++) {
		noticeImg[i-1].src = "/images/notice0" + (i) + ".gif"
		noticeList[i-1].style.display = "none"
	}
}

showIdx = 0

function rotationBanner() {
	pshowIdx = showIdx - 1
	if (pshowIdx < 0) pshowIdx = rProfBanner.length - 1
	rProfBanner[pshowIdx].style.display = "none"
	rProfBanner[showIdx].style.display = ""
	showIdx++
	if (showIdx > rProfBanner.length - 1) showIdx = 0
	setTimeout("rotationBanner()", 3000)
}

/*******************************************************************************
	ÃßÃµ»çÀÌÆ®
*******************************************************************************/
function change(sel, targetstr)
{
  var index = sel.selectedIndex;
  if (sel.options[index].value != null) {
     if (targetstr == 'blank') {
       window.open(sel.options[index].value, 'remote');
     } else {
       var frameobj = eval(targetstr);
       frameobj.location = sel.options[index].value;
     }
  }
}

/*******************************************************************************
	ms ¼Ò¼Û ¹®Á¦·Î flash º¸¿©ÁÖ±â
*******************************************************************************/
///ÇÃ·¡½Ã º¸±â
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlash( path , width , height )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name=quality value=high>" ;
	htmlBody = htmlBody + "<param name=wmode value=transparent>" ;
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

///ÇÃ·¡½Ãµ¿È­¿ë º¸±â
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlashTale( path , width , height )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name=quality value=high>" ;
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

///ÇÃ·¡½Ã º¸±â ¹Ì¸®º¸±â¿ë
//path	: ÇÃ·¡½Ã °æ·Î
//wid	: °¡·Î »çÀÌÁî
//hei	: ¼¼·Î »çÀÌÆ®
function ViewFlashParam( path , width , height, flashvars )
{
	var strProtocol = (document.location.protocol.indexOf("https")!=-1)?"https":"http";
	var htmlBody = "";
	htmlBody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+strProtocol+"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "<param name=movie value='" + path + "'>" ;
	htmlBody = htmlBody + "<param name=quality value=high>" ;
	htmlBody = htmlBody + "<param name='flashvars' value='"+flashvars+"'";
	htmlBody = htmlBody + "<param name=wmode value=transparent>" ;
	htmlBody = htmlBody + "<embed src='" + path + "' quality='high' pluginspage='"+strProtocol+"://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'>" ;
	htmlBody = htmlBody + "</embed>" ;
	htmlBody = htmlBody + "</object>" ;

	document.write(htmlBody)	; 
}

/*******************************************************************************
	Scroll º¸¿©ÁÖ±â
*******************************************************************************/
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenu1From, yMenu1To, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { // ³×Ã÷ÄÉÀÌÇÁ ¿ë ¼³Á¤
                //yButtonFrom = document["divLinkButton"].top;
                //yButtonTo   = top.pageYOffset + top.innerHeight - 55;
                yMenu1From   = document["Menu1"].top;
                yMenu1To     = top.pageYOffset + 150;   // À§ÂÊ À§Ä¡
        }
        else if ( bExplorer4plus ) {  // IE ¿ë ¼³Á¤
                //yButtonFrom = parseInt (divLinkButton.style.top, 10);
                //yButtonTo   = document.body.scrollTop + document.body.clientHeight - 55;
				//yMenu1From   = parseInt (document["Menu1"].style.top, 10);
				
				yMenu1From   = parseInt (Menu1.style.top, 10);				
                yMenu1To     = document.body.scrollTop + 360 // À§ÂÊ À§Ä¡
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenu1To + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenu1From != yMenu1To ) {
                yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
                if ( yMenu1To < yMenu1From )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["Menu1"].top += yOffset;
                else if ( bExplorer4plus )
						//document["Menu1"].style.top = parseInt (document["Menu1"].style.top, 10) + yOffset;
			            
						Menu1.style.top = parseInt (Menu1.style.top, 10) + yOffset;
						

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function MovePosition()
{
        var y;

        // ÇÁ·¹ÀÓ ¿¡¼­ ¹þ¾î³ª°Ô ÇÏ´Â ÇÔ¼öÀÔ´Ï´Ù. ÇÁ·¹ÀÓ¿¡ ³ÖÀ¸·Á¸é »èÁ¦ÇÏ¼¼¿ä
        if ( top.frames.length )
         //       top.location.href = self.location.href;

        // Æä¿¡Áö ·Îµù½Ã Æ÷Áö¼Ç
        if ( bNetscape4plus ) {
                document["Menu1"].top = top.pageYOffset + 410;
                document["Menu1"].visibility = "visible";
                //document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
                //document["divLinkButton"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                //document["Menu1"].style.top = document.body.scrollTop + 268;
                //document["Menu1"].style.visibility = "visible";
				
				Menu1.style.top = document.body.scrollTop + 410;
                Menu1.style.visibility = "visible";
				
                //divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
                //divLinkButton.style.visibility = "visible";
        }

        // initializing UI update timer
        CheckUIElements();
        //if ( bExplorer4plus )
        //        setTimeout ( "FlashTitleStepIt(255)", 10 );
        return true;
}

/*========================================
js_rolling.js

#°£´Ü¼³¸í
<div><img /><img /></div>
¶ó°í ÇßÀ» °æ¿ì div¾ÈÀÇ img¸¦ À§,¿À¸¥ÂÊ,¾Æ·¡,¿ÞÂÊÀ¸·Î ·Ñ¸µ ½ÃÅ²´Ù.




# »ç¿ë¹ý
<script type="text/javascript" charset='utf-8' src="js_rolling.js"></script> 
//JS½ºÅ©¸³Æ® ·Îµå

<div id='div1'><img /><img /><img /><img /><img /></div>
//Ã³·³ ±¸¼ºÈÄ divÀÇ ³Êºñ¿Í ³ôÀÌ´Â ²À Á¤ÇØÁÖ±â ¹Ù¶ø´Ï´Ù.
<div>
	<div>1<img />etc</div>
	<div>2</div>
	<div>3</div>
	<div>4</div>
</div>
ÀÌ·¸°Ô ±¸¼ºÇÒ °æ¿ì ¹æÇâÀº À§,¾Æ·¡·Î¸¸ °¡´ÉÇÕ´Ï´Ù


var roll = new js_rolling('rolling');
or
var roll = new js_rolling(document.getElementById('rolling'));
// idÀÌ¸§À» Àû´øÁö, Á÷Á¢ ´ë»óÀ» Áö¸ñÇØ¼­ ·Ñ¸µ Å¬·¡½º·Î °´Ã¼¸¦ ¸¸µë

roll.set_direction(4); // ¹ÝÇâÀ» ¹Ù²Þ. 1: top, 2:right, 3:bottom 4:left ±×¿ÜÀÇ °æ¿ì µ¿ÀÛ¾ÈÇÔ
roll.move_gap = 1;	//¿òÁ÷ÀÌ´Â ÇÈ¼¿´ÜÀ§
roll.time_dealy = 10; //¿òÁ÷ÀÌ´Â Å¸ÀÓµô·¹ÀÌ
roll.time_dealy_pause = 5000;//ÇÏ³ªÀÇ ´ë»óÀÌ »õ·Î ½ÃÀÛÇÒ ¶§ ¸ØÃß´Â ½Ã°£, 0 ÀÌ¸é Àû¿ë ¾ÈÇÔ
roll.start(); //·Ñ¸µ µ¿ÀÛ

roll.move_up(); //À§·Î ÇÑ¹ø ·Ñ¸µ (¹ÝÇâÀÌ top,bottonÀÏ¶§¸¸ µ¿ÀÛ)
roll.move_right(); //¿À¸¥ÂÊÀ¸·Î ÇÑ¹ø ·Ñ¸µ(¹ÝÇâÀÌ right,leftÀÏ¶§¸¸ µ¿ÀÛ)
roll.move_down(); //¾Æ·¡·Î ÇÑ¹ø ·Ñ¸µ(¹ÝÇâÀÌ top,bottonÀÏ¶§¸¸ µ¿ÀÛ)
roll.move_left(); //¿ÞÂÊÀ¸·Î ÇÑ¹ø ·Ñ¸µ(¹ÝÇâÀÌ right,leftÀÏ¶§¸¸ µ¿ÀÛ)

#ÁÖÀÇ
¹ÝÇâÀÌ top,bottomÀÏ °æ¿ì ³»ºÎ ÅÂ±×´Â block¿ä¼Ò(div)·Î
¹ÝÇâÀÌ left,rightÀÏ °æ¿ì ³»ºÎÅÂ±×´Â inline¿ä¼Ò(a,span)À¸·Î
ÇØ¼ö¼¼¿ä.
FF¿¡¼­ top,bottomÀÇ °æ¿ì inline¿ä¼ÒÀÏ °æ¿ì offsetHeight¸¦ Àß¸ø¾Ë¾Æ¿É´Ï´Ù.


#»ç¿ëÁ¦¾à
»ç¿ë½Ã "°ø´ë¿©ÀÚ´Â ¿¹»Ú´Ù"¸¦ ³ªÅ¸³»¼Å¾ßÇÕ´Ï´Ù.

¸¸µç³¯ : 2007-06-07
¼öÁ¤ÀÏ : 2007-08-11
¸¸µçÀÌ : mins01,mins,°ø´ë¿©ÀÚ
È¨ÆäÀÌÁö : http://www.mins01.com 
NateOn&MSN : mins01(at)lycos.co.kr
========================================*/
var js_rolling = function(this_s){
	// ½Ã°£´ÜÀ§´Â ms·Î 1000ÀÌ 1ÃÊ
	if(this_s.nodeType==1){
		this.this_s = this_s;
	}else{
		this.this_s = document.getElementById(this_s);
	}
	this.is_rolling = false;
	this.direction = 1; //1:top, 2:right, 3:bottom, 4:left (½Ã°è¹æÇâ) // 1¹ø°ú 4¹ø¸¸ µÊ
	this.children =	null;
	this.move_gap = 1;	//¿òÁ÷ÀÌ´Â ÇÈ¼¿´ÜÀ§
	this.time_dealy = 100; //¿òÁ÷ÀÌ´Â Å¸ÀÓµô·¹ÀÌ
	this.time_dealy_pause = 1000;//ÇÏ³ªÀÇ ´ë»óÀÌ »õ·Î ½ÃÀÛÇÒ ¶§ ¸ØÃß´Â ½Ã°£, 0 ÀÌ¸é Àû¿ë ¾ÈÇÔ
	this.time_timer=null;
	this.time_timer_pause=null;
	this.mouseover=false;
	this.init();
	this.set_direction(this.direction);
}
js_rolling.prototype.init = function(){
	this.this_s.style.position='relative';
	this.this_s.style.overflow='hidden';
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
		if(children[i].nodeType==1){
			children[i].style.position='relative';
		}else{
			this.this_s.removeChild(children[i]);
		}
	}
	var this_s=this;
	this.this_s.onmouseover=function(){
		this_s.mouseover=true;
		if(!this_s.time_timer_pause){
			this_s.pause();
		}
	}
	this.this_s.onmouseout=function(){
		this_s.mouseover=false;
		if(!this_s.time_timer_pause){
			this_s.resume();
		}
	}	
}
js_rolling.prototype.set_direction = function(direction){
	this.direction=direction;
	if(this.direction==2 ||this.direction==4){
		this.this_s.style.whiteSpace='nowrap';
	}else{
		this.this_s.style.whiteSpace='normal';
	}
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.display='block';
			}else if(this.direction==2){
				children[i].style.textlign='right';
				children[i].style.display='inline';
			}else if(this.direction==3){
				children[i].style.display='block';
			}else if(this.direction==4){
				children[i].style.display='inline';
			}
	}
	this.init_element_children();	
}
js_rolling.prototype.init_element_children = function(){
	var children = this.this_s.childNodes;
	this.children = children;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.top='0px';
			}else if(this.direction==2){
				children[i].style.left='-'+this.this_s.firstChild.offsetWidth+'px';
			}else if(this.direction==3){
				children[i].style.top='-'+this.this_s.firstChild.offsetHeight+'px';
			}else if(this.direction==4){
				children[i].style.left='0px';
			}
	}
}
js_rolling.prototype.act_move_up = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)-this.move_gap)+'px';
	}
	if((this.children[0].offsetHeight+parseInt(this.children[0].style.top))<=0){
		this.this_s.appendChild(this.children[0]);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_up = function(){
	if(this.direction!=1&&this.direction!=3){return false;}
	this.this_s.appendChild(this.children[0]);
	this.init_element_children();
	this.pause_act();	
}
js_rolling.prototype.act_move_down = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)+this.move_gap)+'px';
	}
	if(parseInt(this.children[0].style.top)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();	
	}
}
js_rolling.prototype.move_down = function(){
	if(this.direction!=1&&this.direction!=3){return false;}	
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.act_move_left = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)-this.move_gap)+'px';
	}
	if((this.children[0].offsetWidth+parseInt(this.children[0].style.left))<=0){
		this.this_s.appendChild(this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_left = function(){
	if(this.direction!=2&&this.direction!=4){return false;}		
	this.this_s.appendChild(this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();		
}
js_rolling.prototype.act_move_right = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)+this.move_gap)+'px';
	}
	
	if(parseInt(this.this_s.lastChild.style.left)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();		
	}
}
js_rolling.prototype.move_right = function(){
	if(this.direction!=2&&this.direction!=4){return false;}			
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.start = function(){ //·Ñ¸µ ½ÃÀÛ
	var this_s = this;
	this.stop();
	this.is_rolling = true;
	var act = function(){
		if(this_s.is_rolling){
			if(this_s.direction==1){this_s.act_move_up();}
			else if(this_s.direction==2){this_s.act_move_right();}
			else if(this_s.direction==3){this_s.act_move_down();}
			else if(this_s.direction==4){this_s.act_move_left();}
		}
	}
	this.time_timer = setInterval(act,this.time_dealy);
}
js_rolling.prototype.pause_act = function(){ //ÀÏ½Ã µ¿ÀÛ
	if(this.time_dealy_pause){
		var this_s = this;
		var act = function(){this_s.resume();this_s.time_timer_pause=null;}
		if(this.time_timer_pause){clearTimeout(this.time_timer_pause);}
		this.time_timer_pause = setTimeout(act,this.time_dealy_pause);
		this.pause();
	}
}
js_rolling.prototype.pause = function(){ //ÀÏ½Ã ¸ØÃã
	this.is_rolling = false;
}
js_rolling.prototype.resume = function(){ //ÀÏ½Ã ¸ØÃã ÇØÁ¦
	if(!this.mouseover){
		this.is_rolling = true;
	}
}
js_rolling.prototype.stop = function(){ //·Ñ¸µÀ» ³¡³¿
	this.is_rolling = false;
	if(!this.time_timer){
		clearInterval(this.time_timer);
	}
	this.time_timer = null
}
