

// ÆË¾÷
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no,status=1'); } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pop2(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=0,status=1'); } 
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes'); }
//Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)

function newwin(url){ window.open(url,'new','location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)

// ÀÌ¹ÌÁö ·Ñ¿À¹ö
function over(obj,type){
    if(type) obj.src = obj.src.replace(".gif","_on.gif");
    else  obj.src = obj.src.replace("_on.gif",".gif");
}

//ºü¸¥¼­ºñ½º
QuickMenu = function(element, startPoint, endPoint) {
	var STATICMENU = element;
	var stmnScrollSpeed = 1;
	var stmnTimer;
	
	RefreshStaticMenu = function ()
	{
		var stmnStartPoint = parseInt(STATICMENU.style.top, 10);
		var stmnEndPoint = parseInt(document.documentElement.scrollTop, 10)+endPoint;
		var stmnRefreshTimer = 1;
		
		if ( stmnStartPoint != stmnEndPoint ) {
				stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 17 );
				STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + "px";
				stmnRefreshTimer = stmnScrollSpeed;
		}
		stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
	}
	
	this.InitializeStaticMenu = function ()
	{
			STATICMENU.style.top = startPoint + "px";
			RefreshStaticMenu();
	}
}

// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		thismenu.onfocus = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

// Tab Content_Click
function initTabMenu02(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onclick = function () {
				//this.onclick();
			}
		}
		thismenu.onclick = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onclick();
}

function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace("", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

// ÆË¾÷
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no,status=1'); } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1'); } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function newwin(url){ window.open(url,'new','location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)

// ÀÌ¹ÌÁö ·Ñ¿À¹ö
function over(obj,type){
    if(type) obj.src = obj.src.replace(".gif","_on.gif");
    else  obj.src = obj.src.replace("_on.gif",".gif");
}

// ·¹ÀÌ¾î ³ëÃâ
function stdShow(id) {
	document.getElementById(id).style.display = "block";
}
function stdHidden(id) {
	document.getElementById(id).style.display = "none";
}

// ·¹ÀÌ¾î ³ëÃâ2
function selshow(tar, obj){
	var tarid = document.getElementById(tar);
	var objid = document.getElementById(obj);
	objid.style.display = "block";
	tarid.onmouseout = objid.onmouseout = function(){
		objid.style.display = 'none';
	}
}

/* °Ô½ÃÆÇ ¸®½ºÆ® ÆîÄ¡±â */
var prevNum=0;
function boardView(num){
	if(document.getElementById("tr"+num).style.display=="none") bOpen(num);
	else bClose(num);

	if(prevNum!=num){
		if(prevNum!=0){
			if(document.getElementById("tr"+prevNum).style.display=="none") bOpen(num);
			else bClose(prevNum);
		}
	}
	prevNum=num;
}

function bOpen(num){
		tr = document.getElementById("tr"+num);
		trParent = document.getElementById("trParent"+num);
		tr.style.display="block";
		tr.className="trBg";
		trParent.className="bdNone trBg";
}

function bClose(num){
		tr = document.getElementById("tr"+num);
		trParent = document.getElementById("trParent"+num);
		tr.style.display="none";
		tr.className="";
		trParent.className="";
}


// ¹îÁö ·¹ÀÌ¾î ¿­±â ´Ý±â
function badgeLayer(){
	var id = document.getElementById('badgeLayer');

	if( id.style.display  == "block"){
		id.style.display  = "none";
		flag = true;
	}else{
		id.style.display  = "block";
	}
	
	img = document.getElementById("badgeBtn")
	if(img.getAttribute("src").indexOf("_on")==-1) img.setAttribute("src",img.getAttribute("src").replace(".gif","_on.gif"))
	else if(img.getAttribute("src").indexOf("_on")!=-1) img.setAttribute("src",img.getAttribute("src").replace("_on.gif",".gif"))

}
// ¹îÁö ·¹ÀÌ¾î ´Ý±â
function badgeLayerClose(){
	var id = document.getElementById('badgeLayer');

	if( id.style.display  == "none"){
		id.style.display  = "block";
		flag = true;
	}else{
		id.style.display  = "none";
	}
}
