/* ----- userAgent Check ----- */
// À§ °æ·Î¸¦ HTML ¾Æ·¡·Î º¯°æ ÇÏÁö ¸»¾ÆÁÖ¼¼¿ä. °³¹ßÁßÀÎ ¸Þ´ºµéÀÌ ¾È¶å´Ï´Ù;
var imageroot = "http://image.youfirst.co.kr";
var crossSizeHelp = "/frame/crossiframe.html"; //ÇÁ·¹ÀÓ »çÀÌÁî µµ¿ÍÁÖ´Â ÆäÀÌÁö
var menuXmlURL = "/common/js/menu.xml"; //¸Þ´º XML
var skinURL = "/frame/skin.jsp"; //ÆäÀÌÁö ½ºÅ²
// À§ °æ·Î¸¦ HTML ¾Æ·¡·Î º¯°æ ÇÏÁö ¸»¾ÆÁÖ¼¼¿ä. °³¹ßÁßÀÎ ¸Þ´ºµéÀÌ ¾È¶å´Ï´Ù;


var user = {
    IE			:!!(window.attachEvent && !window.opera),
    IE6			:((navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("msie 7")<0)),
    IE7			:(navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1),
    FF			:(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf("AppleWebKit/") > -1,
    Gecko:  navigator.userAgent.indexOf("Gecko") > -1 && navigator.userAgent.indexOf("KHTML") == -1,
    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
}
try{ document.execCommand("BackgroundImageCache", false, true); }catch(e){}

var util = {
	$ : function(element) {
		if (arguments.length > 1) {
			for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push(util.$(arguments[i]));
			return elements;
		}
		if (typeof(element) == "string") element = document.getElementById(element);
		return element;
	},
	AddEvent : function(obj, type, fn) { //Event Register
		if(obj.addEventListener) {
			obj.addEventListener(type, fn, false);
		} else if(obj.attachEvent) {
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
			obj.attachEvent("on"+type, obj[type+fn]);
			} else {
			obj["on"+type] = obj["e"+type+fn];
		}
	},
	create : function(opts){ // create element
		var rv=(user.IE)? '' : document.createElement(opts.tagname);
		for(var i in opts){
			if(i!='tagname'){
				if(user.IE) rv+=' '+((i=='classname')? 'class' : i)+'="'+opts[i]+'"';
				else rv.setAttribute((i=='classname')? 'class' : i,opts[i]);
			}
		}
		return (user.IE)? document.createElement('<'+opts.tagname+rv+'>') : rv;
	},
	hover : function(obj){
		obj.onmouseover = function(){ this.src = (this.src.indexOf("_on.gif")>-1) ? this.src:this.src.replace(".gif","_on.gif"); }
		obj.onmouseout = function(){ this.src = this.src.replace("_on.gif",".gif"); }
	},
    reflash : function(containerid, swfid, src, w, h, flashvars, base, wmode,bg){ // flash reWrite.
		var wmode = wmode || "transparent";
		var bg = bg || "none";
		var base = base || "";
		var flashvars = flashvars || "";
		var html="";
		if(user.IE){
			html += "<object id=\""+swfid+"\" width=\""+w+"\" height=\""+h+"\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/_flash/swflash.cab#version=9,0,0,0\">"
					 + "<param name=\"base\" value=\""+base+"\" />"
					 + "<param name=\"movie\" value=\""+src+"\" />"
					 + "<param name=\"wmode\" value=\""+wmode+"\" />"
					 + "<param name=\"bgcolor\" value=\""+bg+"\" />"
					 + "<param name=\"flashvars\" value=\""+flashvars+"\"/>"
					 + "<param name=\"allowScriptAccess\" value=\"always\" />"
					 + "<param name=\"allowFullScreen\" value=\"true\" />"
					 + "<param name=\"quality\" value=\"high\" />"
					 + "</object>";
		}else{
			html += "<embed id=\""+ swfid+"\" src=\""+src+"\" flashvars=\""+flashvars+"\" width=\""+w+"\" height=\""+h+"\" quality=\"high\" base=\""+base+"\" wmode=\""+wmode+"\" bgcolor=\""+bg+"\" allowScriptAccess=\"always\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
		}
        util.$(containerid).innerHTML = html;
	},
	show : function(obj){ util.$(obj).style.display = "block"; },
	hidden : function(obj){ util.$(obj).style.display = "none"; },
	toggle : function(obj){ util.$(obj).style.display = (util.$(obj).style.display=="block") ? "none" : "block" ; },
	cellShow : function (obj,type){
		if(type==2) obj.className = (obj.className.indexOf("hide")<0) ? "hide" : "";
		else obj.className = (type) ? "" : "hide";
	},
	popOpen : function(url,name,W,H,scroll,L,T){
		W = (scroll) ? W+17 : W ;
		L = L || 0;
		T = T || 0;
		scroll = (scroll) ? "yes" : "no" ;
		window.open(url,name,"width="+W+",height="+H+",left="+L+",top="+T+",scrollbars="+scroll+",toolbar=no,location=no,status=no,menubar=no");
	},
	popFull : function(url,name){
		window.open(url,name,"channelmode,scrollbars,scrollbars=no");
	},
	getDoffset : function(obj){ //Offset Position
		var pos=[0,0];
		if(obj.offsetParent){
			do{
				pos[0] += obj.offsetLeft;
				pos[1] += obj.offsetTop;
			}while(obj = obj.offsetParent);
		}
		return pos;
	},
	popResize : function (){
		var target = (document.documentElement.scrollHeight-document.documentElement.clientHeight)
		if(target>0) resizeBy(0,target+15);
	},
	move : function(obj,dir,ms,me,pORm,percent,time,fun){ //( ¿ÀºêÁ§Æ® , ÀÌµ¿property:style.left OR scrollLeftµî , ½ÃÀÛÀ§Ä¡ , ÀÌµ¿ÇÒÀ§Ä¡ , +(1)ÀÎÁö-(0)ÀÎÁö±¸º° )
		clearTimeout(obj.moveact);
		ms = parseFloat(ms);
		me = parseFloat(me);
		if(dir.indexOf("opacity")>-1){
			if(!obj.style.opacity) obj.style.opacity = ms;
			var _me = obj.style.opacity;
			var _mm = (pORm) ? percent : -percent ;
			var pos = parseFloat(_me)+parseFloat(_mm);
			if((pORm==1&&_me>=me)||(pORm==0&&_me<=me)){
				obj.style.opacity = me;
				if(user.IE) obj.style.filter = "alpha(opacity="+(me*100)+")";
				if(fun) eval(fun);
			}else{
				obj.style.opacity = pos;
				if(user.IE) obj.style.filter = "alpha(opacity="+(pos*100)+")";
				if((pORm==1&&_me<me)||(pORm==0&&_me>me)) obj.moveact=setTimeout(function(){util.move(obj,dir,eval("obj."+dir),me,pORm,percent,time,fun)},time);
			}
		}else{
			var pos = Math.ceil((me-ms)*percent);
			var unit = (dir.indexOf("style.")>-1) ? "px" : "";
			if(unit=="px"&&!eval("obj."+dir)) eval("obj."+dir+" = ms+unit");
			if(!eval("obj."+dir)) eval("obj."+dir+" = "+ms+unit);
			if(pos==0) pos = (pORm) ? 1 : -1 ;
			var _me = eval("parseInt(obj."+dir+")");
			if((pORm==1&&_me>=me)||(pORm==0&&_me<=me)){
				eval("obj."+dir+" = me+unit");
				if(fun) eval(fun);
			}else{
				eval("obj."+dir+" = (parseInt(obj."+dir+")+pos)+unit");
				if((pORm==1&&_me<me)||(pORm==0&&_me>me)) obj.moveact=setTimeout(function(){util.move(obj,dir,eval("obj."+dir),me,pORm,percent,time,fun)},time);
			}
		}
	},
	strTwo : function(num){
		return (num<10) ? "0"+num : num;
	},
	addMyMenu : function(div,menusid){ //°³¹ßÃß°¡
		xhttp= (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
		xhttp.open("GET", "/mypage/jsp/addMypage.jsp?DIV=" + div + "&MENUS_ID=" + menusid);
		xhttp.onreadystatechange = function() {
			if (xhttp.readyState == 4) {
				if (xhttp.status == 200) {
					var json = eval('('+ xhttp.responseText + ')');
					alert(json.msg);
				} else {
					alert("MyMenu µî·ÏÀ» È®ÀÎÇØÁÖ¼¼¿ä.")
				}
			}
		}
		xhttp.send("");
	}
}

function layoutInit(){
	//ÆäÀÌÁö ·Îµå½Ã µðÀÚÀÎ sub ·¹ÀÌ¾Æ¿ô º¯°æ script
}

//ÆäÀÌÁö ·Îµå½Ã µðÀÚÀÎ º¯°æÇ×¸ñ script
util.AddEvent(window, "load", function(){
	readStyle();
	tableSet();
	listSet();

	// checkPoint open, close Btn
	var checkPoint=util.$('checkPoint');
	if(checkPoint){
		var checkbtn=util.create({tagname:'img',src:imageroot+'/images/bbs/btn_body_close.gif',classname:'close',alt:'³»¿ë´Ý±â'});
		checkbtn.onclick=function(){
			checkPointClose(this);
		}
		checkPoint.getElementsByTagName("h2")[0].appendChild(checkbtn);
	}
    // checkPoint2 open, close Btn
	var checkPoint2=util.$('checkPoint2');
	if(checkPoint2){
		var checkbtn=util.create({tagname:'img',src:imageroot+'/images/bbs/btn_body_open.gif',classname:'close',alt:'³»¿ë¿­±â'});
		checkbtn.onclick=function(){
			checkPointClose(this);
		}
		checkPoint2.getElementsByTagName("h2")[0].appendChild(checkbtn);
	}
})
//input readOnly BGChange
function readStyle(){
	var inputObj = document.getElementsByTagName("input");
	for(inJ=0;inJ<inputObj.length;inJ++){
		inputObj[inJ].reset = function(){
			if(this.readOnly){
				this.className = (this.className.indexOf("readOnly")>-1) ? this.className : this.className + " readOnly";
			}else{
				this.className = this.className.replace("readOnly", "");
			}
		}
		inputObj[inJ].reset();
	}
}

//PNG ÀÌ¹ÌÁö°ü·Ã -- IE6Àü¿ë
function setPng24(obj){
	if(!user.IE6) return;
	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=imageroot+"/images/common/blank.gif";
	return '';
}

//Å×ÀÌºí ±¸ºÐ BG, over BG °ü·Ã
function tableSet(){
	var obj = document.getElementsByTagName("table");
	if(obj.length<=0) return;
	for(i=0;i<obj.length;i++){
		obj[i].reset = function(){
			if((this.className.indexOf("tOver") > -1 || this.className.indexOf("tEven") > -1)&&(this.getElementsByTagName("tbody").length > 0)){
				this.objTr = this.getElementsByTagName("tbody")[0].rows;
				this.overGroup = (this.className.indexOf("oGroup") > -1) ? this.className.substr(this.className.indexOf("oGroup")+6,1) : 1 ;

				for(j=0,q=0;j<this.objTr.length;j++){
					this.objTr[j].num = j;
					this.objTr[j].overGroup = this.overGroup;
					this.objTr[j].objTr = this.objTr;
					if(this.className.indexOf("tEven") > -1){
						if((Math.ceil((q+1)/this.overGroup)-1)%2 != 0) this.objTr[j].className += " even";
						else this.objTr[j].className = this.objTr[j].className.replace(/even/g,"");
					}
					if(this.className.indexOf("tOver") > -1 && this.objTr[j].className.indexOf("hide") < 0){
						this.objTr[j].onmouseover = function(){
							this.startNum = (Math.ceil((this.num+1)/this.overGroup)-1)*this.overGroup;
							this.endNum = this.startNum+parseInt(this.overGroup);
							for(var a = this.startNum; a<this.endNum; a++){
								this.objTr[a].className += " this";
							}
						}
						this.objTr[j].onmouseout = function(){
							this.startNum = (Math.ceil((this.num+1)/this.overGroup)-1)*this.overGroup;
							this.endNum = this.startNum+parseInt(this.overGroup);
							for(var a = this.startNum; a<this.endNum; a++){
								this.objTr[a].className = this.objTr[a].className.replace("this","");
							}
						}
					}
					if(this.objTr[j].className.indexOf("hide") < 0) q++;
				}
			}
			else if(this.className.indexOf("tdOver") > -1){
				for(tri=0;tri<this.getElementsByTagName("tbody")[0].rows.length;tri++){
					for(tdi=0;tdi<this.getElementsByTagName("tbody")[0].rows[tri].cells.length;tdi++){
						this.getElementsByTagName("tbody")[0].rows[tri].cells[tdi].onmouseover = function(){
							this.className += " this";
						}
						this.getElementsByTagName("tbody")[0].rows[tri].cells[tdi].onmouseout = function(){
							this.className = this.className.replace("this","");
						}
					}
				}
			}
		}
		obj[i].reset();
	}
}
function cellOver(obj,td,tr,cName,type){ //Æ¯Á¤¼¿°ú ÇÔ²² ¿À¹öµÉ°æ¿ì
	obj.rowArea = obj.parentNode.parentNode.rows;
	for(i=0;i<obj.rowArea.length;i++){
		for(j=0;j<obj.rowArea[i].cells.length;j++){
			if(obj.rowArea[i].cells[j]==obj){
				obj.rowArea[i].cells[j].className = (type) ? obj.rowArea[i].cells[j].className+" "+cName : obj.rowArea[i].cells[j].className.replace(cName,'');
				if(td!=0||tr!=0) obj.rowArea[i+tr].cells[j+td].className = (type) ? obj.rowArea[i+tr].cells[j+td].className+" "+cName : obj.rowArea[i+tr].cells[j+td].className.replace(cName,'');
			}
		}
	}
}
function listSet(){ //¸®½ºÆ® UL type over BG°ü·Ã
	var obj = document.getElementsByTagName("ul");
	if(obj.length<=0) return;
	for(i=0;i<obj.length;i++){
		if(obj[i].className.indexOf("tOver") > -1){
			for(j=0;j<obj[i].childNodes.length;j++){
				if(obj[i].childNodes[j].nodeType==1){
					obj[i].childNodes[j].onmouseover = function(){ this.className += " this"; }
					obj[i].childNodes[j].onmouseout = function(){ this.className = this.className.replace("this",""); }
				}
			}
		}
	}
}
//Å×ÀÌºí ¼¿ Å¬¸¯ÇÒ¶§ È¿°ú
function tableClick(v){
	for(i=0;i<v.obj.length;i++){
		v.obj[i].bd = v.obj[i].getElementsByTagName("tbody")[0];
		v.obj[i].tRow = v.obj[i].bd.rows;
		v.obj[i].curent = [null,null,null];
		v.obj[i].group = v.obj;
		for(j=0;j<v.obj[i].tRow.length;j++){
			v.obj[i].tRow[j].tCell = v.obj[i].tRow[j].cells;
			v.obj[i].tRow[j].pTag = v.obj[i];	v.obj[i].tRow[j].thisNum = j;
			v.obj[i].tRow[j].className = v.obj[i].tRow[j].className.replace(/curClick/g,"");
			for(z=0;z<v.obj[i].tRow[j].tCell.length;z++){
				v.obj[i].tRow[j].tCell[z].style.cursor = "pointer";
				v.obj[i].tRow[j].tCell[z].pTag = v.obj[i];	v.obj[i].tRow[j].tCell[z].thisNum = z;
				v.obj[i].tRow[j].tCell[z].className = v.obj[i].tRow[j].tCell[z].className.replace(/curClick/g,"");
			}
		}
	}
}
//Å×ÀÌºí ¼¿ Å¬¸¯ÇÒ¶§ È¿°ú -> TR,TD´ÜÀ§
function cellClick(obj){
	if(obj.nodeName.toLowerCase()=="tr"){
		if(obj.pTag.curent[0]!=null){
			var setONum = (obj.pTag.curent[0].className.indexOf("oGroup")>-1) ? parseInt(obj.pTag.curent[0].className.substr(obj.pTag.curent[0].className.indexOf("oGroup")+6,1)) : 1;
			var startONum = parseInt((Math.ceil((obj.pTag.curent[1]+1)/setONum)-1)*setONum);
			for(d1=startONum;d1<(startONum+setONum);d1++) obj.pTag.curent[0].tRow[d1].className = obj.pTag.curent[0].tRow[d1].className.replace(/curClick/g,"");
		}
		for(obj.i=0;obj.i<obj.pTag.group.length;obj.i++) obj.pTag.group[obj.i].curent = [obj.pTag,obj.thisNum];
		var setNum = (obj.pTag.curent[0].className.indexOf("oGroup")>-1) ? parseInt(obj.pTag.curent[0].className.substr(obj.pTag.curent[0].className.indexOf("oGroup")+6,1)) : 1;
		var startNum = parseInt((Math.ceil((obj.pTag.curent[1]+1)/setNum)-1)*setNum);
		for(d2=startNum;d2<(startNum+setNum);d2++) obj.pTag.curent[0].tRow[d2].className = obj.pTag.curent[0].tRow[d2].className + " curClick";
	}else if(obj.nodeName.toLowerCase()=="td"){
		if(obj.pTag.curent[0]!=null) obj.pTag.curent[0].tRow[obj.pTag.curent[1]].tCell[obj.pTag.curent[2]].className = obj.pTag.curent[0].tRow[obj.pTag.curent[1]].tCell[obj.pTag.curent[2]].className.replace(/curClick/g,"");
		for(obj.i=0;obj.i<obj.pTag.group.length;obj.i++) obj.pTag.group[obj.i].curent = [obj.pTag,obj.parentNode.thisNum,obj.thisNum];
		obj.className = obj.className + " curClick";
	}
}

//ÅÇÀÌ¹ÌÁö º¯°æ
function tabImgChange(v){
	v.tabItem = util.$(v.tabItem).getElementsByTagName("img");
	//framename:'saleFrame'
	for(i=0;i<v.tabItem.length;i++){
		v.tabItem[i].onclick = function(){
			for(iii=0;iii<v.tabItem.length;iii++){
				if(v.tabItem[iii]==this) this.src = (this.src.indexOf(v.onImg)>-1) ? this.src : this.src.replace(v.offImg, v.onImg)
				else v.tabItem[iii].src = (v.tabItem[iii].src.indexOf(v.offImg)>-1 && v.tabItem[iii].src.indexOf(v.onImg) < 0) ? v.tabItem[iii].src : v.tabItem[iii].src.replace(v.onImg, v.offImg)
				if(v.framename) frameResize(v.framename);
			}
		}
	}
}
function tebView(v){
	v.tabItem = util.$(v.tabItem).getElementsByTagName("a");
	for(i=0;i<v.tabItem.length;i++){
		v.tabItem[i].onclick = function(){
			for(iii=0;iii<v.tabItem.length;iii++){
				if(v.tabItem[iii]==this){
					this.getElementsByTagName("img")[0].src = (this.getElementsByTagName("img")[0].src.indexOf(v.onImg)>-1) ? this.getElementsByTagName("img")[0].src : this.getElementsByTagName("img")[0].src.replace(v.offImg, v.onImg);
					util.$(this.href.split("#")[1]).style.display = "block";
				}else{
					v.tabItem[iii].getElementsByTagName("img")[0].src = (v.tabItem[iii].getElementsByTagName("img")[0].src.indexOf(v.offImg)>-1 && v.tabItem[iii].getElementsByTagName("img")[0].src.indexOf(v.onImg) < 0) ? v.tabItem[iii].getElementsByTagName("img")[0].src : v.tabItem[iii].getElementsByTagName("img")[0].src.replace(v.onImg, v.offImg);
					util.$(v.tabItem[iii].href.split("#")[1]).style.display = "none";
				}
			}
			return false;
		}
	}
}

//qna Å¬¸¯½Ã ¹Ù·Î º¸±â
function faqView(name){
	if(util.$(name).nodeName.toLowerCase()=="div") var obj = function(){ for(ii=0;ii<util.$(name).childNodes.length;ii++) if(util.$(name).childNodes[ii].nodeType==1) return util.$(name).childNodes[ii]; }
	else var obj = util.$(name);
	if(obj().nodeName.toLowerCase()=="ul"){
		for(i=0;i<obj().childNodes.length;i++){
			if(obj().childNodes[i].nodeType==1){
				obj().childNodes[i].style.cursor = "pointer";
				obj().childNodes[i].onclick = function(){
					for(this.i=0;this.i<this.parentNode.childNodes.length;this.i++){
						if(this.parentNode.childNodes[this.i].nodeType==1){
							this.parentNode.childNodes[this.i].className = this.parentNode.childNodes[this.i].className.replace(/this/g,"");
							this.className = (this.parentNode.childNodes[this.i]==this) ? this.className+" this" : this.className;
						}
					}
				}
			}
		}
	}else{
		obj().objT = obj().getElementsByTagName("dt");  obj().objD = obj().getElementsByTagName("dd");
		for(i=0;i<obj().objT.length;i++){
			obj().objT[i].onclick=function(){
				for(this.i=0; this.i<this.parentNode.objT.length; this.i++){
					this.parentNode.objT[this.i].className = (this==this.parentNode.objT[this.i]&&this.className.indexOf("on")<0) ? "on" : "";
					this.parentNode.objD[this.i].className = (this.parentNode.objT[this.i].className=="on") ? "on" : "";
				}
			}
		}
	}
}

//Å¬¸¯½Ã ¼û±ä¸Þ´º º¸ÀÌ±â
function testlMenu(obj,e){
	if(!e) e=window.event;
	util.$("hidMenu").style.display = "block";
	util.$("hidMenu").style.top = util.getDoffset(obj)[1];
	util.$("hidMenu").style.left = util.getDoffset(util.$("body"))[0]-util.getDoffset(obj)[0]+obj.offsetWidth+50;
}

//¾Ë·Áµå¸³´Ï´Ù. ¿­±â/´Ý±â °ü·Ã
function checkPointClose(obj){
	if(obj.src.indexOf("btn_body_close.gif")>-1){
		obj.parentNode.parentNode.style.height = "33px";
		obj.src = obj.src.replace("btn_body_close.gif","btn_body_open.gif");
		obj.alt = "³»¿ë¿­±â";
	}else{
		obj.parentNode.parentNode.style.height = "auto";
		obj.src = obj.src.replace("btn_body_open.gif","btn_body_close.gif");
		obj.alt = "³»¿ë´Ý±â";
	}
}

function openClose(v){
	v.infoItem = util.$(v.infoItem);
	firstState = (v.firstState||v.firstState!=0) ? 1 : 0;
	if(v.infoItem.nodeName.toLowerCase()=="dl"){
		v.infoItem.tit = util.$(v.infoItem).getElementsByTagName("dt");
		for(i=0;i<v.infoItem.tit.length;i++){
			if(v.infoItem.tit[i].getElementsByTagName("a")[0]){
				for(ii=0;ii<v.infoItem.tit[i].getElementsByTagName("a").length;ii++){
					if(v.infoItem.tit[i].getElementsByTagName("a")[ii].className==v.onClass||v.infoItem.tit[i].getElementsByTagName("a")[ii].className==v.offClass){
						v.infoItem.tit[i].getElementsByTagName("a")[ii].onMsg = v.onTxt;
						v.infoItem.tit[i].getElementsByTagName("a")[ii].offMsg = v.offTxt;
						v.infoItem.tit[i].getElementsByTagName("a")[ii].onStyle = v.onClass;
						v.infoItem.tit[i].getElementsByTagName("a")[ii].offStyle = v.offClass;
						v.infoItem.tit[i].getElementsByTagName("a")[ii].parentDD = v.infoItem.tit[i];
						v.infoItem.tit[i].getElementsByTagName("a")[ii].thisCont = (v.infoItem.tit[i].nextSibling.nodeType==1) ? v.infoItem.tit[i].nextSibling : v.infoItem.tit[i].nextSibling.nextSibling;
						v.infoItem.tit[i].getElementsByTagName("a")[ii].className = (firstState) ? v.infoItem.tit[i].getElementsByTagName("a")[ii].className.replace(v.onClass,v.offClass) : v.infoItem.tit[i].getElementsByTagName("a")[ii].className.replace(v.offClass,v.onClass); //Ã³À½ ¿­¸°»óÅÂ·Î º¯°æÇÏ±âÀ§ÇÔ.
						v.infoItem.tit[i].getElementsByTagName("a")[ii].innerHTML = (firstState) ? v.offTxt : v.onTxt; //Ã³À½ ¿­¸°»óÅÂ·Î º¯°æÇÏ±âÀ§ÇÔ.
						v.infoItem.tit[i].getElementsByTagName("a")[ii].thisCont.style.display = (firstState) ? "block" : "none";
						v.infoItem.tit[i].getElementsByTagName("a")[ii].onclick = function(){
							if(this.className==this.onStyle){
								this.className = this.offStyle;
								this.innerHTML = this.offMsg;
								this.thisCont.style.display = "block";
								this.parentDD.className = this.offStyle;
							}else{
								this.className = this.onStyle;
								this.innerHTML = this.onMsg;
								this.thisCont.style.display = "none";
								this.parentDD.className = this.onStyle;
							} return false;
						}
					}
				}
			}
		}
	}
}
var popupLayer = {  //·¹ÀÌ¾î ÆË¾÷¹× ·ÎµùÁßÇ¥½Ã
	objBox : "", backImg : "", conTxt : "",
	init : function(){
		try{
		if(popupLayer.objBox==""){
			popupLayer.objBox = util.create({tagname:'div',classname:'layerPop'});
			popupLayer.objBox.style.width = popupLayer.objBox.style.height = "100%";
			document.body.appendChild(popupLayer.objBox);
			popupLayer.conTxt = util.create({tagname:'div',classname:'frame'});
			popupLayer.objBox.appendChild(popupLayer.conTxt);
			popupLayer.backImg = util.create({tagname:'span',classname:'back'});
			popupLayer.objBox.appendChild(popupLayer.backImg);
		}
		popupLayer.conTxt.innerHTML = "";
		var popupLayContain = document.getElementById("wrap") ? document.getElementById("wrap") : document.getElementById("body");
		popupLayer.backImg.style.width = (document.documentElement.clientWidth>popupLayContain.offsetWidth?document.documentElement.clientWidth:popupLayContain.offsetWidth)+"px";
		popupLayer.backImg.style.height = (document.documentElement.clientHeight>popupLayContain.offsetHeight?document.documentElement.clientHeight:popupLayContain.offsetHeight)+"px";
		}catch(e){}
	},
	hide : function(){ if(popupLayer.objBox!="") popupLayer.objBox.style.display = "none"; },
	show : function(){ if(popupLayer.objBox!="") popupLayer.objBox.style.display = "block"; },
	frameSet : function(w,h,objName,sc,url){
		try{
			var topContFrame = "";
			function layoutFrameSrc(obj){
				if(obj.document.getElementById(menu.contFrame)){ topContFrame = obj; return;
				}else{ if(obj.parent.documentElement) layoutFrameSrc(obj.parent); }
			}
			if(parent.document.getElementsByTagName("body")) layoutFrameSrc(parent);
			if(topContFrame!="") topContFrame.popupLayer.frameSet(w,h,objName,sc,url);
			else{
				popupLayer.init();
				if(!util.$(objName)){
					var popIfr = util.create({tagname:'iframe',frameborder:0});
					popupLayer.conTxt.appendChild(popIfr);
					popIfr.id = objName;
					popIfr.scrolling = 'no';
					popIfr.allowtransparency="true"
				}
				util.$(objName).src = url;
				util.$(objName).style.width = w+"px";
				util.$(objName).style.height = h+"px";
				var popupLayContain = document.getElementById("wrap") ? document.getElementById("wrap") : document.getElementById("body");
				popupLayer.conTxt.style.left = (((popupLayContain.offsetWidth<document.documentElement.clientWidth?document.documentElement.clientWidth:popupLayContain.offsetWidth)-w)/2)+"px";
				popupLayer.conTxt.style.top = ( ((document.documentElement.clientHeight-h)/2) < 0 ? 0 : ((document.documentElement.clientHeight-h)/2) )+"px";
				document.documentElement.scrollTop=0;
				document.body.scrollTop=0;
				popupLayer.show();
			}
		}catch(e){}
	},
	loading : function(){
		try{
			popupLayer.init();
			var ldbar = util.create({tagname:'img',src:imageroot+'/images/common/loading.gif',alt:'·ÎµùÁß...'});
			popupLayer.conTxt.appendChild(ldbar);
			popupLayer.conTxt.style.left = ((document.getElementById("wrap").offsetWidth-ldbar.offsetWidth)/2)+"px";
			popupLayer.conTxt.style.top = ( ((document.documentElement.clientHeight-ldbar.offsetHeight)/2) < 0 ? 0 : ((document.documentElement.clientHeight-ldbar.offsetHeight)/2) )+"px";
			popupLayer.show();
		}catch(e){}
	}
}

function gallery(obj,pos){ //°Ö·¯¸® ¸®½ºÆ®
	var speedMov=0.6, speedRepeat=40, objAddName="Repeat", prevAddName="Prev", nextddName="Next", stopTime=null, galleryItem=[],count=0, galleryW=0,onItemWidth=0,onStepWidth=0,maxScroll=0,thisPos=0;
	if(!(util.$(obj+objAddName))) return;
	var galleryContain = util.$(obj+objAddName);
	var galleryObj = galleryContain.getElementsByTagName("ul")[0];
	for(i=0;i<galleryObj.childNodes.length;i++){
		if(galleryObj.childNodes[i].nodeType==1){
			galleryItem[count] = (galleryObj.childNodes[i]);
			galleryW += parseInt(galleryObj.childNodes[i].offsetWidth);
			onItemWidth = galleryObj.childNodes[i].offsetWidth;
			addmargin = (galleryObj.childNodes[i].offsetWidth-galleryObj.childNodes[i].getElementsByTagName("a")[0].offsetWidth)
			if(galleryObj.childNodes[i].getElementsByTagName("a")[0].className.indexOf("this")>-1) thisPos = count;
			count++
		}
	}
	onStepWidth = ( galleryContain.offsetWidth+addmargin );

	var addWidth = (galleryW%onStepWidth!=0) ? (onStepWidth-(galleryW%onStepWidth)) : 0 ;
	galleryObj.style.width = galleryW+addWidth+"px";
	maxSize = galleryW;
	maxSizeScr = parseInt(galleryObj.style.width)-onStepWidth;
	function init(){
		if(stopTime!=null) clearTimeout(stopTime);
		var typeP = util.$(obj+prevAddName).style.cursor = ( galleryContain.scrollLeft>0 && maxSize >= onStepWidth ) ? "pointer" : "default";
		var typeN = util.$(obj+nextddName).style.cursor = (galleryContain.scrollLeft < maxSizeScr && maxSize >= onStepWidth) ? "pointer" : "default";
		util.$(obj+prevAddName).onclick = (typeP=="pointer") ? function(){ move(galleryContain.scrollLeft,false) } : "" ;
		util.$(obj+nextddName).onclick = (typeN=="pointer") ? function(){ move(galleryContain.scrollLeft,true) } : "" ;
		util.$(obj+prevAddName).src = (typeP=="pointer") ? util.$(obj+prevAddName).src.match(/_on/) ? util.$(obj+prevAddName).src : util.$(obj+prevAddName).src.replace(".gif","_on.gif"):util.$(obj+prevAddName).src.replace("_on.gif",".gif");
		util.$(obj+nextddName).src = (typeN=="pointer") ? util.$(obj+nextddName).src.match(/_on/) ? util.$(obj+nextddName).src : util.$(obj+nextddName).src.replace(".gif","_on.gif") : util.$(obj+nextddName).src.replace("_on.gif",".gif");
	}
	init();
	move(0,true,(Math.ceil(((thisPos+1)*onItemWidth)/onStepWidth)-1)*onStepWidth);
	if((pos||pos==0)&&!(galleryContain.scrollLeft==pos)){
		var type = (galleryContain.scrollLeft>pos) ? false:true;
		move(galleryContain.scrollLeft,type,pos);
	}
	function move(oldPos,type,pos2){
		if(stopTime!=null) clearTimeout(stopTime);
		var oldPosMg = (oldPos%onStepWidth!=0) ? onStepWidth-(oldPos%onStepWidth) : 0;
		oldPos = oldPos+oldPosMg;
		var target = (type) ? oldPos+onStepWidth :  oldPos-onStepWidth ;
		if(pos2||pos2==0) target = pos2;
		target = (target<0) ? 0 : target ;
		target = (target>maxSizeScr) ? maxSizeScr : target ;
		var stopPos = (type) ? ((target-2)<=galleryContain.scrollLeft) : ((target+2)>=galleryContain.scrollLeft);
		if((galleryContain.scrollLeft==pos2)||(galleryContain.scrollLeft<0)||(galleryContain.scrollLeft>maxSizeScr)||(target==galleryContain.scrollLeft)||stopPos){
			galleryContain.scrollLeft = target;
			init();
		}else{
			galleryContain.scrollLeft += Math.ceil(parseInt(target - galleryContain.scrollLeft) * speedMov);
			stopTime = (pos2||pos2==0) ? setTimeout(function(){move(oldPos,type,pos2)},speedRepeat) : setTimeout(function(){move(oldPos,type)},speedRepeat);
		}
	}
}
function playerMovie(){ //µ¿¿µ»ó »ó¼¼º¸±â
	var galleryName = "thumList";
	gallery(galleryName);
	var movieContain=util.$("thumListRepeat"), movieName="movie";

	var movieList = movieContain.getElementsByTagName("a");
	for(i=0;i<movieList.length;i++){
		movieList[i].contain = movieList;
		movieList[i].onclick = function(){
			for(this.viewi=0;this.viewi<this.contain.length;this.viewi++){
				this.htmlText = this.parentNode.innerHTML;
				if(this.contain[this.viewi]==this){
					this.contain[this.viewi].className += " this";
					if(util.$("playerInfo")) util.$("playerInfo").innerHTML = this.htmlText;
				}else{
					this.contain[this.viewi].className = this.contain[this.viewi].className.replace(/this/g,"");
				}
			}
		}
	}
}






/*  ######## Frame Layout Change script Start ########  */
//frame Resize
function frameLayoutResize(frameId,type,scClick){
	try{
		if(type!=1) popupLayer.hide();

		if(document.getElementById(frameId).contentWindow.document.getElementsByTagName("iframe").length==0){

			document.getElementById(frameId).height = document.getElementById(frameId).contentWindow.document.getElementById("body").offsetHeight+30;

		}else{

			document.getElementById(frameId).acTime = setTimeout( function(){try{document.getElementById(frameId).height = document.getElementById(frameId).contentWindow.document.getElementById("body").offsetHeight+30;}catch(e){}}, 900);

		}

		document.getElementById(frameId).contentWindow.document.documentElement.frameId = frameId+30;
		if(!scClick) document.documentElement.scrollTop=0;
		if(!scClick) document.body.scrollTop=0;
		document.getElementById(frameId).contentWindow.document.documentElement.onclick = function(){ setTimeout(function(){frameLayoutResize(frameId,1,1);},300) }

	}catch(e){}
}
function frameResize(frameId){
	try{
		var docH = document.getElementById(frameId).contentWindow.document.body.offsetHeight;
		try{if(document.getElementById(frameId).contentWindow.document.getElementById("body").offsetHeight) docH = document.getElementById(frameId).contentWindow.document.getElementById("body").offsetHeight;}catch(e){}
		document.getElementById(frameId).height = docH;
		document.getElementById(frameId).contentWindow.resizeOverlap(frameId);
		document.getElementById(frameId).contentWindow.document.documentElement.frameId = frameId;
		document.getElementById(frameId).contentWindow.document.documentElement.onclick = function(){
		setTimeout(function(){resizeOverlap(frameId);},300) }
	}catch(e){}
}

function resizeOverlap(frameId) {
    try{
    	var h = (util.$("body")) ? util.$("body").offsetHeight : document.documentElement.scrollHeight;
    	var p = "", topContFrame="";
    	var plusMargin = 0;
    	for(chbody = 0;chbody<document.body.childNodes.length;chbody++){
    		if(document.body.childNodes[i].nodeType==1){
    			plusMargin = util.getDoffset(document.body.childNodes[i])[1];
    			break;
    		}
    	}
    	p = crossSizeHelp +"?iId="+frameId+"&ih=" + (h+plusMargin); // ÃßÈÄ URL º¯°æ¿¹Á¤

    	if(!util.$("resizeHandlerFrame")){
    		if(!!(window.attachEvent && !window.opera)){
    			var ifrmObj = document.createElement("<iframe frameborder='0' scrolling='no'>")
    		}else{
    			var ifrmObj = document.createElement('iframe');
    			ifrmObj.frameborder = 0; ifrmObj.scrolling = 'no';
    		}
    		ifrmObj.id = "resizeHandlerFrame";
    		with(ifrmObj.style){
    			width = "0"; height = "0"; border = "0";
    		}
    		document.body.appendChild(ifrmObj);
    	}
    	function layoutFrameSrc(obj){
    		if(obj.document.getElementsByTagName("body")){
    			if(obj.document.getElementById(menu.contFrame)){ topContFrame = obj; return; }
    			else{ if(obj.document.getElementsByTagName("body")) layoutFrameSrc(obj.parent); }
    		}
    	}
    	try{
    		if(parent.document.getElementsByTagName("body")){
    			layoutFrameSrc(parent);
    			topContFrame.util.$(menu.contFrame).height = topContFrame.util.$(menu.contFrame).contentWindow.document.getElementById("body").offsetHeight;
    		}
    	}catch(e){}
    	ifrmObj.src = p;
    }catch(e){}
}

//menu XML ¿¬µ¿
var menu = {
	xmlDoc : null, category : null, depth : [0,0,0,0], oldDepth : [0,0,0,0], oldDepth2 : [0,0,0,0], mapDepth : [], contFrame : "contentsLayoutFrame", contBtn : "pageEasyBtn", hMenuId:"",
	init : function(){
		xhttp= (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
		xhttp.open("GET",menuXmlURL,false);
		xhttp.send("");
		menu.xmlDoc=xhttp.responseXML;
		menu.category = menu.xmlDoc.getElementsByTagName("CATEGORY")[0];
		menu.quickCategory = menu.xmlDoc.getElementsByTagName("CATEGORY")[0].getElementsByTagName("quickmenu")[0].getElementsByTagName("item");
	},
	pageChange : function(depNum,chUrl){
		document.documentElement.scrollTop=0;
        document.body.scrollTop = 0;
		var first = true;
		if(util.$(menu.contFrame)) first = (util.$(menu.contFrame).src=="about:blank")?true:false; //Ã³À½ ·ÎµåÇÏ´Â°ÇÁö ¿©ºÎ Ã¼Å©.
		if(!menu.category) menu.init();
		// ÇÏ¾é°Ô ³ª¿À´Â ºÎºÐ Á¦°Å
        // popupLayer.loading();
		depNum = depNum.replace(/'/g,""); //'//
        //alert(depNum);
        menu.hMenuId =  depNum;
		menu.oldDepth2 = menu.depth; //ÀÌÀü ÆäÀÌÁö °ª

		menu.depth = [0,0,0,0]; //°ª ÃÊ±âÈ­
		menu.mapDepth = []; //°ª ÃÊ±âÈ­
		for(a=0,b=0;a < depNum.length;a=a+2,b++) menu.depth[b] = (eval(depNum.substr(a, 2)));

		if(menu.depth[0]>0) menu.mapDepth[0] = menu.nodeInfo(menu.category,menu.depth[0],0);
		else menu.mapDepth[0] = [menu.category,menu.category.getAttribute("url"),menu.category.getAttribute("name"),util.strTwo(b),menu.category.getAttribute("target"),menu.category.getAttribute("menuPrint"),menu.category.getAttribute("menuFile"),menu.category.getAttribute("menuReg")]
		if(menu.depth[1]>0&&menu.mapDepth[0][0].childNodes.length>0){
			menu.mapDepth[1] = menu.nodeInfo(menu.mapDepth[0][0],menu.depth[1],1);
			menu.mapDepth[1][3] = menu.mapDepth[0][3]+menu.mapDepth[1][3];
		}
		if(menu.depth[2]>0&&menu.mapDepth[1][0].childNodes.length>0){
			menu.mapDepth[2] = menu.nodeInfo(menu.mapDepth[1][0],menu.depth[2],2);
			menu.mapDepth[2][3] = menu.mapDepth[1][3]+menu.mapDepth[2][3];
		}
		if(menu.depth[3]>0&&menu.mapDepth[2][0].childNodes.length>0){
			menu.mapDepth[3] = menu.nodeInfo(menu.mapDepth[2][0],menu.depth[3],3);
			menu.mapDepth[3][3] = menu.mapDepth[2][3]+menu.mapDepth[3][3];
		}

		var redepNum='';
		for(z=0;z < menu.depth.length;z++) if(menu.depth[z]!=0) redepNum += util.strTwo(menu.depth[z]);
		if(menu.mapDepth[menu.mapDepth.length-1][1]=="about:blank"){
			popupLayer.hide();
			alert("ÁØºñÁßÀÔ´Ï´Ù.");
			menu.depth = menu.oldDepth2;
		}else if(menu.mapDepth[menu.mapDepth.length-1][1].toLowerCase().indexOf("javascript")>-1){
			popupLayer.hide();
			eval(menu.mapDepth[menu.mapDepth.length-1][1].replace(/javascript:/i,""));
			menu.depth = menu.oldDepth2;
		}else{
			menu.oldDepth = menu.oldDepth2; //ÀÌÀü ÆäÀÌÁö °ª
			menu.mapDepth[menu.mapDepth.length-1][1] = menu.mapDepth[menu.mapDepth.length-1][1].replace(/&amp/g,"&");
			if(menu.mapDepth[menu.mapDepth.length-1][4]=="_self"){
				location.href = (chUrl) ? chUrl : menu.mapDepth[menu.mapDepth.length-1][1]; //frame urlº¯°æÀÏ°æ¿ì
			}else{
				if(util.$(menu.contFrame) && ((menu.mapDepth[0][0].getAttribute("menuId")=="util" && menu.depth[1] == menu.oldDepth[1]) || (menu.mapDepth[0][0].getAttribute("menuId")!="util" && menu.depth[0] == menu.oldDepth[0]) || menu.oldDepth[0]==0)){
					if(menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("menuId")=="040202"){
						if(util.$(menu.contFrame).acTime) clearTimeout(util.$(menu.contFrame).acTime);
						util.$(menu.contFrame).onload = null;
						popupLayer.hide();
						util.$(menu.contFrame).height = 600;
					}else{
						util.$(menu.contFrame).onload = function(){ frameLayoutResize(this.id); }
					}
                    util.$(menu.contFrame).src = (chUrl&&chUrl!="") ? chUrl : menu.mapDepth[menu.mapDepth.length-1][1];
					if(menu.mapDepth[0][0].getAttribute("layoutType")||menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("layoutType")||(menu.mapDepth[0][0].getAttribute("menuId")=="util"&&menu.mapDepth[1][0].getAttribute("layoutType"))) document.documentElement.className = menu.mapDepth[0][0].getAttribute("layoutType")||menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("layoutType")||menu.mapDepth[1][0].getAttribute("layoutType");
					else document.documentElement.className = "";
                }else{
					location.href = skinURL+"?menuId="+menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("menuId")+((chUrl&&chUrl!="") ? "&url="+escape(chUrl) : ""); //iframeÀÌ ¾øÀ» °æ¿ì skinÆäÀÌÁö·Î °ª ³Ñ±è.
				}
			}

			menu.lineMap();
			if(util.$(menu.contBtn)) util.$(menu.contBtn).innerHTML = ""; //¹öÆ°¿µ¿ª ÃÊ±âÈ­
			if(menu.mapDepth[menu.mapDepth.length-1][5]=="true") menu.screenPrint(menu.mapDepth[menu.mapDepth.length-1][1],menu.mapDepth[menu.mapDepth.length-1][2]) //È­¸éÀÎ¼â
			if(menu.mapDepth[menu.mapDepth.length-1][6]=="true") menu.fileSave(menu.mapDepth[menu.mapDepth.length-1][1],menu.mapDepth[menu.mapDepth.length-1][2]) //ÆÄÀÏÀúÀå
			if(menu.mapDepth[menu.mapDepth.length-1][7]=="true") menu.myMenu(menu.mapDepth[menu.mapDepth.length-1][1],menu.mapDepth[menu.mapDepth.length-1][2],menu.mapDepth[menu.mapDepth.length-1][3]) //¸¶ÀÌ¸Þ´ºµî·Ï
//			if(menu.mapDepth[menu.mapDepth.length-1][7]=="true") menu.myMenu(menu.mapDepth[menu.mapDepth.length-1][1],menu.mapDepth[menu.mapDepth.length-1][2]) //¸¶ÀÌ¸Þ´ºµî·Ï
			if(!first){ //Ã³À½ ·ÎµåÇÒ°æ¿ì´Â ÇÃ·¡½Ã¸Þ´º¿¡ °ª¾È´øÁü.
				menu.gnbChange(menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("menuId"));
				if(menu.mapDepth[menu.mapDepth.length-1][4]!="_frame2") menu.lnbChange(menu.mapDepth[menu.mapDepth.length-1][0].getAttribute("menuId"));
/*
				menu.gnbChange(menu.mapDepth[0][0].getAttribute("menuId")=="util"?"00"+redepNum.substr(2,redepNum.length):redepNum);
				menu.lnbChange(menu.mapDepth[0][0].getAttribute("menuId")=="util"?"00"+redepNum.substr(2,redepNum.length):redepNum);
*/
			}
		}
	},
	lineMap : function(){ //ÆäÀÌÁö³»°æ·Îº¯°æ
		if(!util.$("location")) return;
		var mapHTML = "";
		mapHTML += "<a href='"+menu.category.getAttribute("url")+"'>"+menu.category.getAttribute("name")+"</a>";
		for(i=0;i<menu.mapDepth.length;i++){
			if(menu.mapDepth[i][0].getAttribute("menuId")!="util"){ // menuId°¡ utilÀÏ°æ¿ì utilÀº ÆäÀÌÁö °æ·Î¿¡¼­ Á¦¿Ü.
				if(i==menu.mapDepth.length-1) mapHTML += " > <strong>"+menu.mapDepth[i][2]+"</strong>";
				else mapHTML += " > <a href=\"javascript:menu.pageChange('"+menu.mapDepth[i][3]+"')\">"+menu.mapDepth[i][2]+"</a>";
			}
		}
		util.$("location").innerHTML = mapHTML;
	},
	gnbChange : function(menuId){ //»ó´Ü¸Þ´ºº¯°æ
		if(!util.$("mainMenuSwf")) return;
		if(util.$("mainMenuSwf").refreshActiveCode){
			util.$("mainMenuSwf").refreshActiveCode(menuId);
		}else{
			setTimeout(function(){menu.gnbChange(menuId);},100);
		}
	},
	lnbChange : function(menuId){ //ÁÂÃø¸Þ´ºº¯°æ
		if(!util.$("subMenuswf")) return;
		if(util.$("subMenuswf").refreshActiveCode){
			util.$("subMenuswf").refreshActiveCode(menuId);
		}else{
			setTimeout(function(){menu.lnbChange(menuId);},100);
		}
	},
	myMenu : function(url,name,menuid){ //¸¶ÀÌ¸Þ´º µî·Ï¸µÅ© º¯°æ
		if(!util.$(menu.contBtn)) return;
		var mybtn=util.create({tagname:'img',src:imageroot+'/images/common/btn_mymenu.gif',alt:'¸¶ÀÌ¸Þ´º µî·Ï'});
		util.$(menu.contBtn).appendChild(mybtn);
        mybtn.onclick = function() {
            util.addMyMenu("APPEND",menuid+","+name+"}") ;
        }
	},
	screenPrint : function(url,name){ //È­¸éÀÎ¼â
		if(!util.$(menu.contBtn)) return;
		var printbtn=util.create({tagname:'img',src:imageroot+'/images/common/btn_screenprint.gif',alt:'È­¸éÀÎ¼â'});
		printbtn.onclick=function(){ frames[menu.contFrame].focus(); frames[menu.contFrame].print(); }
		util.$(menu.contBtn).appendChild(printbtn);
	},
	fileSave : function(url){ //ÆÄÀÏÀúÀå
		if(!util.$(menu.contBtn)) return;
		var savebtn=util.create({tagname:'img',src:imageroot+'/images/common/btn_filesave.gif',alt:'ÆÄÀÏÀúÀå'});
		savebtn.onclick=function(){ window.open(url) }
		util.$(menu.contBtn).appendChild(savebtn);
	},
	resizeH : function(type){ //»ó´Ü¸Þ´º ¸®»çÀÌÁî //type == 0 -> ´ÝÈ÷°í³­ ÈÄ, type == 1 -> ¿­¸®±âÀü
		util.$('mainMenu').className = (type) ? 'open':'close';
	},
	nodeInfo : function(obj,num,subNum){
		var returnNode = "";
		for (a=0,b=0;a<obj.childNodes.length;a++){
			if(obj.childNodes[a].nodeType==1){
				b++;
				if(b==num){
					returnNode = new Array();
					if(menu.depth[subNum]==0) menu.depth[subNum] = b;
					if(obj.childNodes[a].getAttribute("url")=="none") childSrc(obj.childNodes[a],subNum);
					returnNode = [obj.childNodes[a],obj.childNodes[a].getAttribute("url"),obj.childNodes[a].getAttribute("name"),util.strTwo(b),obj.childNodes[a].getAttribute("target"),obj.childNodes[a].getAttribute("menuPrint"),obj.childNodes[a].getAttribute("menuFile"),obj.childNodes[a].getAttribute("menuReg")];
				}
			}
		}
		return returnNode;
		function childSrc(cObj,subNumSub){
			var srcChildDepth = [];
			for(v=0,c=0;c<cObj.childNodes.length;c++){
				if(cObj.childNodes[c].nodeType==1&&v==0){
					v++; subNumSub++;
					if(menu.depth[subNumSub]==0) menu.depth[subNumSub] = v;
					if(cObj.childNodes[c].getAttribute("url")!='none') break;
					else childSrc(cObj.childNodes[c],subNumSub);
				}
			}
		}
	},
	link : function(depNum,chUrl){
		chUrl = chUrl||false;
		var topContFrame = "";
		function layoutFrameSrc(obj){
			if(obj.document.getElementById(menu.contFrame)){ topContFrame = obj; return;
			}else{ if(obj.parent.documentElement) layoutFrameSrc(obj.parent); }
		}
		if(parent.document.getElementsByTagName("body")) layoutFrameSrc(parent);
		if(topContFrame!="") topContFrame.menu.bodyLink(depNum,chUrl)
		else menu.bodyLink(depNum,chUrl);
	},
	bodyLink : function(depNum,chUrl){
		if(!menu.category) menu.init();
		depNum = depNum.replace(/'/g,"");//'//
		var xmlDepth = menu.xmlSrc(depNum);
		chUrl = chUrl || false;
		menu.pageChange(xmlDepth[0],chUrl);
	},
	nameLink : function(depNum,type){ //type -> ÅØ½ºÆ®¸¸ return ÇÒ²¨¸é 1 ¾Æ´Ï¸é »ý·«
		var xmlDepth = menu.xmlSrc(depNum);
		var writeHtml = "<a href=\"javascript:menu.pageChange('"+xmlDepth[0]+"')\">"+xmlDepth[1]+"</a>";
		if(type) return writeHtml;
		else document.write(writeHtml);
	},
	quick : function(num){ //type -> ÅØ½ºÆ®¸¸ return ÇÒ²¨¸é 1 ¾Æ´Ï¸é »ý·«
		var func = "";
		for(i=0;i<menu.quickCategory.length;i++){
			if(menu.quickCategory[i].getAttribute("quickId")){
				if(menu.quickCategory[i].getAttribute("quickId")==num&&menu.quickCategory[i].getAttribute("url").toLowerCase().indexOf("javascript")>-1){
					func = menu.quickCategory[i].getAttribute("url").replace(/javascript:/i,"");
				}
			}
		}
		if(func!="") eval(func);
	},
	xmlSrc : function(depNum){
		depNum = depNum.replace(/'/g,"");//'//
		var changeDepNum = "";
		if(depNum=='00') return ['00',menu.category.getAttribute("name")];
		for (a=0,b=0;a<menu.category.childNodes.length;a++){
			if(menu.category.childNodes[a].nodeType==1){
				b++;
				if(menu.category.childNodes[a].getAttribute("menuId")==depNum) {
					changeDepNum = [(util.strTwo(b)),menu.category.childNodes[a].getAttribute("name")];
					break;
				}else if(menu.category.childNodes[a].getAttribute("menuId")&&menu.category.childNodes[a].childNodes.length>0){
					for (c=0,d=0;c<menu.category.childNodes[a].childNodes.length;c++){
						if(menu.category.childNodes[a].childNodes[c].nodeType==1){
							d++;
							if(menu.category.childNodes[a].childNodes[c].getAttribute("menuId")==depNum) {
								changeDepNum = [(util.strTwo(b)+util.strTwo(d)),menu.category.childNodes[a].childNodes[c].getAttribute("name")];
								break;
							}else if(menu.category.childNodes[a].childNodes[c].getAttribute("menuId")&&menu.category.childNodes[a].childNodes[c].childNodes.length>0){
								for (e=0,f=0;e<menu.category.childNodes[a].childNodes[c].childNodes.length;e++){
									if(menu.category.childNodes[a].childNodes[c].childNodes[e].nodeType==1){
										f++;
										if(menu.category.childNodes[a].childNodes[c].childNodes[e].getAttribute("menuId")==depNum) {
											changeDepNum = [(util.strTwo(b)+util.strTwo(d)+util.strTwo(f)),menu.category.childNodes[a].childNodes[c].childNodes[e].getAttribute("name")];
											break;

										}else if(menu.category.childNodes[a].childNodes[c].childNodes[e].getAttribute("menuId")&&menu.category.childNodes[a].childNodes[c].childNodes[e].childNodes.length>0){
											for (g=0,h=0;g<menu.category.childNodes[a].childNodes[c].childNodes[e].childNodes.length;g++){
												if(menu.category.childNodes[a].childNodes[c].childNodes[e].childNodes[g].nodeType==1){
													h++;
													if(menu.category.childNodes[a].childNodes[c].childNodes[e].childNodes[g].getAttribute("menuId")==depNum){
														changeDepNum = [(util.strTwo(b)+util.strTwo(d)+util.strTwo(f)+util.strTwo(h)),menu.category.childNodes[a].childNodes[c].childNodes[e].childNodes[g].getAttribute("name")];
														break;
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		return changeDepNum;
	}
}

//quick menu XML ¿¬µ¿
function quickMenu(){
	var quickHTML = "";
	quickHTML += "<div id=\"quickMenu\">";
	quickHTML += "	<span class=\"btn\"><a href=\"#quickMenu\" onclick=\"quickOpen(this);return false;\">open/close</a></span>";
	quickHTML += "	<dl>";
	quickHTML += "		<dt><img src=\""+imageroot+"/images/common/quick.gif\" alt=\"Quick menu\" /></dt>";
	quickHTML += "		<dd>"+menu.nameLink('0002',1)+"</dd>";
	quickHTML += "		<dd>"+menu.nameLink('030103',1)+"</dd>";
	quickHTML += "		<dd>"+menu.nameLink('0208',1)+"</dd>";
	quickHTML += "		<dd>"+menu.nameLink('030104',1)+"</dd>";
	quickHTML += "		<dd><a href=\"javascript:menu.link(\'000402\')\">QnAÀÚ»ê°ü¸®</a></dd>";
	quickHTML += "		<dd>"+menu.nameLink('050602',1)+"</dd>";
	quickHTML += "		<dd>"+menu.nameLink('050102',1)+"</dd>";
	quickHTML += "		<dd><a href=\"/etc/AUF_100514_newpop001.html\" onclick=\"util.popOpen(this.href,'AUF_100514_newpop001', 652,555,0); return false;\">¿ø°ÝÁö¿ø¼­ºñ½º</a></dd>";
	quickHTML += "		<dd><a href=\"javascript:util.popOpen('/etc/youfirst_guide.html','youfirst_guide', 805,540,0);\">ÃÊº¸ÀÚ °¡ÀÌµå</a></dd>";
	quickHTML += "	</dl>";
	quickHTML += "</div>";
	document.write(quickHTML);
}
function quickOpen(obj){
	var min = 22;
	var max = 148;
	var quickObj = obj.parentNode.parentNode;
	obj.blur();
	quickObj.className=(quickObj.className=='open')?'close':'open';
	quickObj.style.width = (quickObj.style.width) ? quickObj.style.width : min+"px";

	if(quickObj.className=='open') util.move(quickObj,"style.width",quickObj.style.width,max,1,0.3,20);
	else util.move(quickObj,"style.width",quickObj.style.width,min,0,0.3,20);
}
//  ½ºÅ©·ÑÀÇ ÀÌµ¿¿¡ µû¸£´Â ºü¸¥¸Þ´º°¡±â ÀÌµ¿
function quickScroll()
{
  try
  {
    var div_quickMenu ;
    var quickMenu_Top ;
    div_quickMenu = document.getElementById("quickMenu") ;
    if (div_quickMenu)
    {
      //quickMenu_Top = document.getElementById("quickMenu").clientHeight ;
      //alert("before = [" + quickMenu_Top + "]") ;
      quickMenu_Top = 161 ; // quickMenuÀÇ ÃÖÃÊ TOP À§Ä¡°ª
      if (document.documentElement.scrollTop > 0)
      {
        //quickMenu_Top = document.documentElement.scrollTop ;
        //quickMenu_Top += (document.documentElement.scrollTop + 20) ;
        //quickMenu_Top = (document.documentElement.clientHeight - (div_quickMenu.offsetHeight + 100) ) + document.documentElement.scrollTop ;
        quickMenu_Top = div_quickMenu.offsetHeight + document.documentElement.scrollTop ;
      }
      div_quickMenu.style.top = quickMenu_Top ;
    }
  }
  catch (e)
  {
    alert("quickScroll() Exception = [" + e + "]") ;
  }
}
function quickScrollStart()
{
  setTimeout('quickScroll()', 300) ;
}
window.attachEvent("onscroll", quickScrollStart) ;
window.attachEvent("onresize", quickScrollStart) ;


//Åø¹Ù ¿µ¿ª
var toolbar = {
	objId : "toolbar", swfId : "toolbarSwf", tbURL : "" , sH : "" , sW : "" ,
	init : function(tbURL,sH,sW){
		toolbar.tbURL = tbURL; toolbar.sH = sH; toolbar.sW = sW;
		util.reflash(toolbar.objId,toolbar.swfId,toolbar.tbURL,toolbar.sH,toolbar.sW,'','.');
		if(user.IE6) toolbar.topPos();
		window.onresize = window.onscroll = function(){ if(user.IE6) toolbar.topPos(); }
	},
	resizeH : function(type){ util.$(toolbar.objId).className = (type) ? 'open':'close'; if(user.IE6) toolbar.topPos(); }, //»ó´Ü¸Þ´º ¸®»çÀÌÁî //type == 0 -> ´ÝÈ÷°í³­ ÈÄ, type == 1 -> ¿­¸®±âÀü
	topPos : function(){ util.$(toolbar.objId).style.top = (document.documentElement.clientHeight-util.$(toolbar.objId).offsetHeight+document.documentElement.scrollTop)+"px"; }
}
function directStock(stockId){ //Åø¹Ù °ü½ÉÁ¾¸ñ>¹Ù·Î°¡±â
	menu.link('040201','/trading/market/jsp/present.jsp?stockcode='+stockId);
}
function saleStock(stockId){ //Åø¹Ù °ü½ÉÁ¾¸ñ>¸Å¸Å
	util.popOpen('/trading/deal/jsp/pop_salebarogo01.jsp?txtItmCd='+stockId,'pop_minibalance',600,578,0);
}

//ÆäÀÌÁö ÇÏ´Ü
function footerTab(obj,cName){
	var tabList = obj.parentNode.parentNode.parentNode.childNodes
	for(i=0;i<tabList.length;i++){
		if(tabList[i].nodeType==1) tabList[i].style.display = (tabList[i].className==cName) ? "block" : "none" ;
	}
}
var family = {
	contain : null, obj : null,min : 0, max : null, repeat : false, familyAct : null, familySetAct : null, blankImg : null,
	set : function(){
		family.contain = util.$("familySite");
		family.obj = family.contain.getElementsByTagName("ul")[0];
		//family.min = util.$("familySite").getElementsByTagName("strong")[0].offsetHeight;
		family.max = family.obj.scrollHeight+5;
		family.obj.style.height = family.min+"px";
		family.blankImg=util.create({tagname:'img',src:imageroot+'/images/common/blank.gif',classname:'blank'});
		family.obj.appendChild(family.blankImg);
		family.contain.onmouseover = function(){ family.repeat = true;
			clearTimeout(family.familyAct);
			clearTimeout(family.familySetAct);
			this.className="on";
			util.move(family.obj,"style.height",parseInt(family.obj.style.height),family.max,1,0.2,20,"family.blankImg.style.display='none'");
			family.familySetAct = setTimeout(out,2000);
		}
		family.contain.onmouseout = function(){ family.repeat = false; family.familyAct = setTimeout(out,300); }
		family.obj.style.height = family.min+"px";

		function out(){
			clearTimeout(family.familyAct);
			if(family.repeat) return;
			family.blankImg.style.display='block';
			util.move(family.obj,"style.height",parseInt(family.obj.style.height),family.min,0,0.2,20,"family.contain.className='';");
		}
	}
}
function pageFooter(){
	var menuAll = util.$("allMenu");
	menuAll.menuItem = ['','','','','',''];
	for (var a=0, b=0;a<menu.category.getElementsByTagName("main").length;a++){
		b++;
		for (var c=0,z=0;c<menu.category.getElementsByTagName("main")[a].childNodes.length;c++){
			if(menu.category.getElementsByTagName("main")[a].childNodes[c].nodeType==1){
				z++;
				if (menu.category.getElementsByTagName("main")[a].childNodes[c].getAttribute("url") == "none")
				{
					menuAll.menuItem[a] += "<li><a style=\"cursor:pointer;\" onClick=\"menu.link('"+(util.strTwo(b)+util.strTwo(z))+"'); return false;\">"+menu.category.getElementsByTagName("main")[a].childNodes[c].getAttribute("name")+"</a></li>";
				}
				else
				{
					menuAll.menuItem[a] += "<li><a href=\""+menu.category.getElementsByTagName("main")[a].childNodes[c].getAttribute("url")+"\" onclick=\"menu.link('"+(util.strTwo(b)+util.strTwo(z))+"'); return false;\">"+menu.category.getElementsByTagName("main")[a].childNodes[c].getAttribute("name")+"</a></li>";
				}
			}
		}
	}

	menuAll.menuText = "<ul><li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all1.gif\" onclick=\"menu.link('01')\" alt=\"ÀÎÅÍ³Ý¹ðÅ·\" /></strong><ul>" +
								 menuAll.menuItem[0] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/fileroot/media/8/8247/media/default1.html\" onclick=\"util.popOpen(this.href,'webGuide',935,1214,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_01.gif\" alt=\"ÀÎÅÍ³Ý¹ðÅ· ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_01_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_01.gif';\"/></a></p></li>" +
								 "<li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all2.gif\" onclick=\"menu.link('02')\" alt=\"±ÝÀ¶»óÇ°\" /></strong><ul>" +
								 menuAll.menuItem[1] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/flbook/upload/7/4/010d9b74-04b5-4814-bbe3-c3632ee8cbb8/guide.html\" onclick=\"util.popOpen(this.href,'webGuide',1280,960,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_02.gif\" alt=\"±ÝÀ¶»óÇ° ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_02_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_02.gif';\"/></a></p></li>" +
								 "<li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all3.gif\" onclick=\"menu.link('03')\" alt=\"ÅõÀÚÁ¤º¸\" /></strong><ul>" +
								 menuAll.menuItem[2] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/fileroot/media/8/8250/media/default1.html\" onclick=\"util.popOpen(this.href,'webGuide',935,1214,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_03.gif\" alt=\"ÅõÀÚÁ¤º¸ ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_03_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_03.gif';\"/></a></p></li>" +
								 "<li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all4.gif\" onclick=\"menu.link('04')\" alt=\"Æ®·¹ÀÌµù\" /></strong><ul>" +
								 menuAll.menuItem[3] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/fileroot/media/8/8249/media/default1.html\" onclick=\"util.popOpen(this.href,'webGuide',935,1214,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_04.gif\" alt=\"Æ®·¹ÀÌµù ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_04_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_04.gif';\"/></a></p></li>" +
								 "<li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all5.gif\" onclick=\"menu.link('05')\" alt=\"°í°´¼­ºñ½º\" /></strong><ul>" +
								 menuAll.menuItem[4] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/fileroot/media/8/8251/media/default1.html\" onclick=\"util.popOpen(this.href,'webGuide',935,1214,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_05.gif\" alt=\"°í°´¼­ºñ½º ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_05_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_05.gif';\"/></a></p></li>" +
								 "<li class=\"item\"><strong class=\"tit\"><img src=\""+imageroot+"/images/common/menu_all6.gif\" onclick=\"menu.link('06')\" alt=\"ÆÛ½ºÆ®¼­ºñ½º\" /></strong><ul>" +
								 menuAll.menuItem[5] +
								 "</ul><p><a href=\"http://view.youfirst.co.kr/fileroot/media/8/8246/media/default1.html\" onclick=\"util.popOpen(this.href,'webGuide',935,1214,1); return false;\"><img src=\""+imageroot+"/images/button/btn_guide_06.gif\" alt=\"ÆÛ½ºÆ®¼­ºñ½º ÀÌ¿ë°¡ÀÌµå\" border=0 onmouseover=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_06_o.gif';\" onmouseout=\"javascript:this.src='"+imageroot+"/images/button/btn_guide_06.gif';\"/></a></p></li></ul>";
	menuAll.innerHTML = menuAll.menuText;
	if(util.$("familySite")) family.set();
}
