//ÆË¾÷
function openPop( filesrc, filename ,mywidth, myheight){
	
	var popWidth = mywidth;
	var popHeight = myheight;
	window.open( filesrc, filename,'width='+popWidth+',height='+popHeight+',top=0,left=0,toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0, resizable=0');
}

//Ç®½ºÅ©¸° ÆË¾÷
function fullpop(){
	window.open( 'main.php', 'buttoncom' , 'fullscreen=yes' );
}

// ÇÃ·¡½Ã
function flash_contents(file,width,height){
document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' tabindex='-1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+width+"' HEIGHT='"+height+"' id='contents' ALIGN=''>");
document.writeln("<PARAM NAME=allowScriptAccess VALUE=always />");
document.writeln("<PARAM NAME=movie VALUE='"+file+"' />");
document.writeln("<PARAM NAME=quality VALUE=high />");
document.writeln("<PARAM NAME=bgcolor VALUE=#FFFFFF />");
document.writeln("<PARAM NAME=wmode VALUE=opaque /> ");
document.writeln("<PARAM NAME=base VALUE=. /> ");
document.writeln("<embed base='.' src='"+file+"' quality='high' wmode='opaque' bgcolor='#FFFFFF' tabindex='-1' width='"+width+"' height='"+height+"' name='contents' align='middle' allowScriptAccess='always' swLiveConnect='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.writeln("</OBJECT>");
}


//Åõ¸í ¾ÆÀÌÇÁ·¹ÀÓ
function ifmView(ifrLeft,ifrTop,ifrWidth,ifrHeight,myUrl) {  
document.all.contentFrames.style.left = ifrLeft;
document.all.contentFrames.style.top = ifrTop;
document.all.contentFrames.style.width = ifrWidth;
document.all.contentFrames.style.height = ifrHeight;
contentFrames.location.href = myUrl;
document.all.contentFrames.style.display = 'block';
}

function ifmHide(){
 document.all.contentFrames.style.display = 'none';
 contentFrames.location.href = "about:blank";
}

//ÄÁÅÙÃ÷ °Ë»ö
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

//ÅØ½ºÆ®¸µÅ©
function cont_view(a, b)
{
	for(var i=1;i<=a;i++){
		if(i == b){
			document.getElementById("cont"+i).style.display = 'block';
		}else{
			document.getElementById("cont"+i).style.display = 'none';
		}
	}
	myHeight(b); //³ôÀÌ°è»ê
}

function myHeight(a){
	var hit = document.getElementById("cont"+a).offsetHeight;
	document.all.tb.height = hit;
}


//top¹öÆ°
function back_top()
{
        var x = document.body.scrollLeft;
        var y = document.body.scrollTop;
        var step = 2;

        while ((x != 0) || (y != 0)) {
                scroll (x, y);
                step += (step * step / 300);
                x -= step;
                y -= step;
                if (x < 0) x = 0;
                if (y < 0) y = 0;
        } 
        scroll (0, 0);
}

// ie6Àü¿ë pngÀÌ¹ÌÁö Åõ¸íÃ³¸®
function setPng24(obj) {
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	obj.src='';  
	return ''; 
}

var nav;
function initNavigation(seq) {
	nav = document.getElementById("mainmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	var navLen = nav.childNodes.length;


	
	var allA = nav.getElementsByTagName("a")
	for(var k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
			imgOver(this);
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			imgOut(this);
			nav.isOver = false;			
		}
	}

	for (var i = 0; i < navLen; i++) {
		var navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		var navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ol").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {			
			if (nav.current) {
				var menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_on", "_off");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				var menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_off", "_on");
				if (this.submenu)
					this.submenu.style.display = "block";					
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq]){
		nav.menu[seq].onmouseover();
	}
	
	

}

function lnb() {
	var nav = document.getElementById("lnb");	
	var allA = nav.getElementsByTagName("a");
	for(var k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			imgOver(this);
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			imgOut(this);
		}
	}
}

function imgOver(imgName) {
	imgName.getElementsByTagName("img")[0].src = imgName.getElementsByTagName("img")[0].src.replace("_off","_on");
}
function imgOut(imgName) {
	imgName.getElementsByTagName("img")[0].src = imgName.getElementsByTagName("img")[0].src.replace("_on","_off");
}



