//<![CDATA[

// ÅÇ ¸Þ´º
var currentTab;
var isBack = false;

// JavaScript Document
function fnTabMenu_Type1() {
	this.CurrentMenu = 0;
	currentTab = 0;	
	this.Start = function() {
		this.MenuBox = document.getElementById(this.MenuName).getElementsByTagName("ul");
		this.MenuLength = this.MenuBox.length;
		this.MenuLayer = document.getElementById(this.MenuName).getElementsByTagName("div");
		
		for ( var i=0; i<this.MenuLength; i++ ) {
			this.MenuLink = this.MenuLayer.item(i).getElementsByTagName("a")[0];
			this.MenuLinkBtn = this.MenuLink.getElementsByTagName("img")[0];
			if ( i == this.CurrentMenu ) {
				document.getElementById(this.DivName + i).style.display = "block";
				document.getElementById(this.DivName + i + "More").style.display = "block";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_off.", "_on.");
			} else {
				document.getElementById(this.DivName + i).style.display = "none";
				document.getElementById(this.DivName + i + "More").style.display = "none";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_on.", "_off.");
			}
			this.MenuLink.i = i;
			this.MenuLink.fnName = this.fnName;

			this.MenuLink.onmouseover = this.MenuLink.onfocus = function() { 
				eval( this.fnName +".fnMouseOver(" + this.i + ")") 
			}
		}
	}
	
	this.fnMouseOver = function(val) {
		isBack = false;
		if(currentTab > val){
			isBack = true;
		}
		currentTab = val;		
		for ( var i=0; i<this.MenuLength; i++) {
			this.MenuLink = this.MenuLayer.item(i).getElementsByTagName("a")[0];
			this.MenuLinkBtn = this.MenuLink.getElementsByTagName("img")[0];
			if ( i == val ) {
				document.getElementById(this.DivName + i).style.display = "block";
				document.getElementById(this.DivName + i + "More").style.display = "block";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_off.", "_on.");
			} else {
				document.getElementById(this.DivName + i).style.display = "none";
				document.getElementById(this.DivName + i + "More").style.display = "none";
				this.MenuLinkBtn.src = this.MenuLinkBtn.src.replace("_on.", "_off.");
			}
			
			// ÇÏÀ§ ¸Þ´ºÀÇ Á© ¸¶Áö¸·ºÎÅÍ Â÷·Ê·Î ÀÌµ¿ÇÏ´Â ºÎºÐ
			// ´ÙÀ½ÀÇ 3ÁÙÀ» »©¸é ¸ÞÀÎ ¸Þ´º·Î¸¸ ÀÌµ¿ÇÕ´Ï´Ù.
			if(isBack && i== val){
				this.MenuLayer.item(i).getElementsByTagName("a")[this.MenuLayer.item(i).getElementsByTagName("a").length-2].focus();				
			}
		}
	}
}

// È­¸é È®´ë Ãà¼Ò
var zoomRate = 10;
var curRate = 100;
var minRate = 100;
var maxRate = 200;

function zoomInOut(value) {
	var browserEl = navigator.userAgent.toLowerCase();
	if(browserEl.indexOf('firefox')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\nº¸±â¸Þ´º > Å©±âÁ¶Á¤ > È®´ë/Ãà¼Ò¸¦ ÀÌ¿ëÇÏ¼¼¿ä."); }
	else if(browserEl.indexOf('opera')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\nº¸±â¸Þ´º > zoomÀ» ÀÌ¿ëÇÏ¼¼¿ä."); }
	else if(browserEl.indexOf('safari')!=-1) { alert("ÀÍ½ºÇÃ·Î¾î Àü¿ë ±â´ÉÀÔ´Ï´Ù.\n\n º¸±â¸Þ´º > ÅØ½ºÆ®Å©°Ô/ÀÛ°Ô¸¦ ÀÌ¿ëÇÏ¼¼¿ä."); }
	if (((value == "plus")&&(curRate >= maxRate))||((value == "minus") && (curRate <= minRate))) {
	    return;
	}  
	if (value == "plus") {
		curRate = parseInt(curRate) + parseInt(zoomRate);
	} else if (value == "minus") {
		curRate = parseInt(curRate) - parseInt(zoomRate);
	} else {
		curRate = 100;
	}
	document.body.style.zoom = curRate + '%';	
	try
	{
		var obj = document.getElementById('flash_visual').getElementsByTagName('object')[0];

		if (curRate==100)
		{
			obj.style.display	= 'block';
		}
		else
		{
			obj.style.display	= 'none';
		}
	}
	catch (e)
	{
	}
}

var pop_rolling = function(popContainer) {
	// ½Ã°£´ÜÀ§´Â ms·Î 1000ÀÌ 1ÃÊ
	if (popContainer.nodeType == 1) {
		this.popContainer = popContainer;
	} else {
		this.popContainer = document.getElementById(popContainer);
	}
	this.is_rolling = false;
	this.counter = 0;
	this.pop_children = null;
	this.time_dealy = 3000; //¿òÁ÷ÀÌ´Â Å¸ÀÓµô·¹ÀÌ
	this.time_timer = null;
	this.time_timer_pause = null;
	this.mouseover = false;
	this.init();
}

pop_rolling.prototype.init = function() {
	var pop_children = this.popContainer.childNodes;
	for (var i=(pop_children.length-1); 0<=i; i--) {
		if (pop_children[i].nodeType != 1) {
			this.popContainer.removeChild(pop_children[i]);
		}
	}

	this.pop_children = this.popContainer.childNodes;
	var oRoll = this;

	for (var i=0; i<this.pop_children.length; i++) {
		for (var k=0; k<this.pop_children[i].childNodes.length; k++) {
			if (this.pop_children[i].childNodes[k].nodeType == 1) {
				this.pop_children[i].childNodes[k].onclick = function() {
					oRoll.moveAt(this.firstChild);
					return false;
				}
				this.pop_children[i].childNodes[k].onfocus = function() {
					oRoll.moveAt(this.firstChild);
					return false;
				}
				break;	// Ã¹¹øÂ° ¸µÅ©(A)¿¡¸¸ ÀÌº¥Æ® ÇÒ´ç
			}
		}
	}
}

pop_rolling.prototype.moveAt = function(oBtn) {
	var i = oBtn.id.substring(12);
	this.mouseover = true;
	if (!this.time_timer_pause) {
		this.counter = (i-1);
		this.move_right();
		this.pause();
	}
}

pop_rolling.prototype.move_right = function() {
	var oRoll = this;
	var nTemp = 0;
	for (var i=0, m=oRoll.pop_children.length; i<m; i++) {
		nTemp = 0;
		for (var k=0; k<this.pop_children[i].childNodes.length; k++) {
			if (this.pop_children[i].childNodes[k].nodeType == 1) {
				nTemp++;
				if (nTemp == 1) {
					var child_1 = oRoll.pop_children[i].childNodes[k].childNodes[0];	//¹öÆ°ÀÌ¹ÌÁö
					child_1.src = child_1.src.replace(/_on.gif/gi,".gif");

					if (i == oRoll.counter) {
						child_1.src = child_1.src.replace(/.gif/gi,"_on.gif");
					}
				} else {
					var child_2 = oRoll.pop_children[i].childNodes[k].childNodes[0];	//¹è³ÊÀÌ¹ÌÁö
					child_2.style.display = "none";
					if (i == oRoll.counter) {
						child_2.style.display = "block";
					}
				}

			}
		}
	}

	oRoll.counter++;
	if (oRoll.counter >= oRoll.pop_children.length) {
		oRoll.counter = 0;
	}
}

pop_rolling.prototype.start = function() { //·Ñ¸µ ½ÃÀÛ
	var oRoll = this;
	this.stop();
	this.is_rolling = true;

	var act = function() {
		if(oRoll.is_rolling){
			oRoll.move_right();
		}
	}
	if (!this.time_timer) {
		act();	// Ã³À½ ·Îµù½Ã Ã¹¹øÂ° ¹öÆ°ÀÌ Áï½Ã ¼±ÅÃµÇµµ·Ï
	}
	this.time_timer = setInterval(act,this.time_dealy);
}

pop_rolling.prototype.pause = function() { //ÀÏ½Ã ¸ØÃã
	this.is_rolling = false;
}

pop_rolling.prototype.resume = function() { //ÀÏ½Ã ¸ØÃã ÇØÁ¦
	this.is_rolling = true;
}

pop_rolling.prototype.stop = function() { //·Ñ¸µÀ» ³¡³¿
	this.is_rolling = false;
	if (!this.time_timer) {
		clearInterval(this.time_timer);
	}
	this.time_timer = null;
}

var roll = null;
window.onload = function() {
	roll = new pop_rolling("popupZone");
	roll.time_dealy = 3000;
	roll.start();

	//initmTicker(document.getElementById("bannerZone"), document.getElementById("bannerZone-content"), 3000);
}

//]]>
