function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function createBodyId() {
	var currenturl = window.location.href;
	var bodyId = currenturl.substring(currenturl.lastIndexOf('/')+1,currenturl.lastIndexOf('.'));
	bodyId = document.body.setAttribute("id",bodyId);
	//alert(document.body.getAttribute("id"));
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='true' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}


// Show-Hide Layer
function showLayer(tgtEl) {document.getElementById(tgtEl).style.display = "block"; }
function hideLayer(tgtEl) {document.getElementById(tgtEl).style.display = "none"; }

//Åõ¸íÀÌ¹ÌÁö
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 '';
}

// Select Links
function linkAct()	{
	var tgtList = document.getElementById('family_urls');
	if(tgtList.style.display)	{
		hideLayer('family_urls');
		tgtList.style.display = "";
		if (navigator.userAgent.indexOf("MSIE")!=-1&&document.getElementById('container')) document.getElementById('container').style.zIndex = "0";
	} else	{
		showLayer('family_urls');
		if (navigator.userAgent.indexOf("MSIE")!=-1&&document.getElementById('container')) document.getElementById('container').style.zIndex = "-1";
	}
}

function onchangeUrl(linkstr) {
	var v_url = linkstr;
	if(v_url) {
	window.location = v_url;
	}
}



// 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);
		thismenu.onclick = function tabMenuClick() {  // onmouseover»óÅÂ
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_ov.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" ov", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_ov.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		}

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick(); // onmouseover»óÅÂ·Î º¯°æÇØÁÜ
}

/* label checkbox*/
function labelEvent(labelFor) {
	if(navigator.appVersion.indexOf("MSIE") != -1) {
		var check_name = document.getElementById(labelFor);
    //check_name.focus();
		check_name.click();
	}
}
/* label focus ÇÊ¿ä*/
function labelFocus(labelFor) {
	if(navigator.appVersion.indexOf("MSIE") != -1) {
		var check_name = document.getElementById(labelFor);
    check_name.focus();
	}
}
/* popup */
function openwindow(url,target,option) {
	window.open(url,target,option);
}

/* alert(msg) */
function message(msg) {
	alert(msg);
}

//½ºÅ©·Ñ¹Ù¸¦ µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
function initMoving() {
	var topPosition = 71;
	var topLimit = 71;
	var btmLimit = 541;
	var obj = document.getElementById("wingmenu");
	if(!obj) return false;

	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)

}

function showSection(id, elem) {
  var divs = document.getElementsByTagName("div");
  for (var i=0; i<divs.length; i++ ) {
    if (divs[i].className != elem) continue;
    if (divs[i].getAttribute("id") != id) {
      divs[i].style.display = "none";
    } else {
      divs[i].style.display = "block";
    }
  }
}
function tabStyle(elemId) {
  var elem = document.getElementById(elemId);
  var parentElem = elem.parentNode;
  var elems = parentElem.getElementsByTagName(elem.nodeName);

// alert( parentElem.id + ":" + elemId );
  for (var i=0; i<elems.length;i++) {
    if(elems[i].getAttribute("id") != elemId) {
		elems[i].className = "";
	} else {
		var tabColor = elems[i].getAttribute("tabColor");
		if (tabColor==null)
			elems[i].className = "here";
		else
			elems[i].className = tabColor;
	}
  }
}

function arsTab(myelem) {
  var src = myelem.getAttribute("href");
  //alert(src);
  var showId = src.split("#")[1];
  var parentElem = myelem.parentNode.parentNode;
  var links = parentElem.getElementsByTagName("a");
  for(i=0; i<links.length; i++) {
    if(src == links[i].getAttribute("href")) {
      var childNode = links[i].childNodes;
      var tmp_src = childNode[0].getAttribute("src");
      var change_src = tmp_src.replace("_off.gif","_on.gif");
      childNode[0].setAttribute("src",change_src);
    } else {
      var childNode = links[i].childNodes;
      var tmp_src = childNode[0].getAttribute("src");
      var change_src = tmp_src.replace("_on.gif","_off.gif");
      childNode[0].setAttribute("src",change_src);
    }
  }
}
function sectionTabNav(elem) {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById(elem)) return false;
  var nav = document.getElementById(elem);
  var links = nav.getElementsByTagName("a");
  for (var i=0; i<links.length; i++ ) {
    var sectionId = links[i].getAttribute("href").split("#")[1];
    if (!document.getElementById(sectionId)) continue;
    if(i>0) {
      document.getElementById(sectionId).style.display = "none";
    }
    links[i].destination = sectionId;
    links[i].onclick = function() {
      showSection(this.destination, nav.getAttribute("id"));
      return false;
    }
  }
}

function mouseTab() {
  if (!document.getElementById("mouseTab")) return false;
  elem = document.getElementById("mouseTab");
  var elem = document.getElementById("mouseTab");
  var lis = elem.getElementsByTagName("li");
  for (var i=0; i<lis.length; i++) {
    if((lis[i].className == "here") || (!lis[i].className)) {
      //alert(lis[i].getAttribute("id"));
      var lisId = lis[i].getAttribute("id");
      if(!document.getElementById(lisId)) continue;
      lis[i].destination = lisId;
      lis[i].onmouseover = function() {
        createClass(this.destination);
      }
      lis[i].onmouseout = function() {
        deleteClass(this.destination);
      }
    }
  }
}
function createClass(elemId) {
  var elem = document.getElementById(elemId);
  var img_tag = elem.getElementsByTagName("img");
  var img_src = img_tag[0].getAttribute("src");
  img_src = img_src.replace("_off.gif", "_on.gif");
  img_tag[0].setAttribute("src", img_src);
  elem.className = "here";
}
function deleteClass(elemId) {
  var elem = document.getElementById(elemId);
  var img_tag = elem.getElementsByTagName("img");
  var img_src = img_tag[0].getAttribute("src");
  img_src = img_src.replace("_on.gif", "_off.gif");
  img_tag[0].setAttribute("src", img_src);
  elem.className = "";
}

//window.document.oncontextmenu = new Function("return false");
function hideRankuppop() {
  if(!document.getElementById("rankuppop")) return false;
  var elem = document.getElementById("rankuppop");
  elem.style.display = "none";
  elem.onmouseover = function() {
  elem.style.display = "block";
  }
  elem.onmouseout = function() {
    elem.style.display = "none";
  }
}

function imgOver() {
  var aImages = document.getElementsByTagName('img');
  for(i=0; i<aImages.length; i++) {
    if (aImages[i].className == 'imgover') {
      aImages[i].onmouseover = function() {
        var img_src =  this.getAttribute('src');
        img_src = img_src.replace("_off.gif", "_on.gif");
        this.setAttribute('src', img_src);
        }
       aImages[i].onmouseout = function() {
          var img_src =  this.getAttribute('src');
          img_src = img_src.replace("_on.gif", "_off.gif");
          this.setAttribute('src', img_src);
       }
    }
  }
}
/* Å¬¸¯ ÅÇ ÀÌ¹ÌÁö ¹Ù²Ù±â */
function imgClick(id) {
  var aImages = document.getElementsByTagName("img");
  for(i=0; i<aImages.length; i++) {
    if (aImages[i].className.indexOf("imgclick") == -1) continue;
    if (aImages[i].getAttribute("id") != id) {
      var img_src =  aImages[i].getAttribute('src');
      img_src = img_src.replace("_on.gif", "_off.gif");
      aImages[i].setAttribute('src', img_src);
    } else {
      var img_src =  aImages[i].getAttribute('src');
      img_src = img_src.replace("_off.gif", "_on.gif");
      aImages[i].setAttribute('src', img_src);
    }
  }
}

function prepareImgClick(elem) {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById(elem)) return false;
  var tabs = document.getElementById(elem);
  var imgs = tabs.getElementsByTagName("img");
  for (var i=0; i<imgs.length; i++ ) {
    var tabId = imgs[i].getAttribute("id");
    if (!tabId) continue;
    imgs[i].destination = tabId;
    imgs[i].onclick = function() {
      imgClick(this.destination);
    }
  }
}
/* //Å¬¸¯ ÅÇ ÀÌ¹ÌÁö ¹Ù²Ù±â */

function favoritesHighlight() {
  if(!document.getElementById("favorites")) return false;
  var elem = document.getElementById("favorites");
  var links = elem.getElementsByTagName("a");
  for(i=0; i<links.length; i++) {
    links[i].onclick = function() {
    var elemId = this.getAttribute("id");
    if (elemId.indexOf("depth2") != -1) {
        var childelem = this.nextSibling.nextSibling;
        if(!childelem) return false;
        var childstyle = childelem.style.display;
        if(childstyle == "none") {
          childelem.style.display="block";
          this.className = "";
        } else {
          childelem.style.display="none";
          this.className = "trans_color";
        }
        return false;
      }
    }
  }
}

function favoritesCheck() {
  if(!document.getElementById("favorites")) return false;
  var elem = document.getElementById("favorites");
  var checks = elem.getElementsByTagName("input");
  for(i=0; i<checks.length; i++) {
    checks[i].onclick = function() {
      if(this.type == "checkbox") {
        var prevelem = this.previousSibling;
        if(this.checked == true) {
          prevelem.style.fontWeight = "bold";
          prevelem.style.letterSpacing = "-1px"
        } else {
          prevelem.style.fontWeight = "normal";
          prevelem.style.letterSpacing = "normal"
        }
      }
    }
  }
}
// ÆäÀÌÁöº°·Î °³º° »ðÀÔÇÑ´Ù
function wtsTab() {
  sectionTabNav("sectionTab");
  sectionTabNav("sectionTab2");
	sectionTabNav("orderTab");
}

/* °Ë»ö ÆäÀÌÁö¿¡¼­ »ç¿ëÇÏÁö ¾Ê´Â´Ù 5/13ÀÏ open½Ã »èÁ¦¿ä */
function searchToggle(showelem,hiddenelem) {
  var showelem = document.getElementById(showelem);
  var hiddenelem = document.getElementById(hiddenelem);
  var chimg1 = document.getElementById("chimg1");
  var chimg2 = document.getElementById("chimg2");
  var chimg1src = chimg1.getAttribute("src");
  var chimg2src = chimg2.getAttribute("src");
  showelem.className = "show";
  hiddenelem.className = "hidden";
  chimg1.setAttribute("src",chimg2src);
  chimg2.setAttribute("src",chimg1src)
}

/* ¸¶¿ì½º Ã¼Å©½Ã ÀÌ¹ÌÁö º¯°æ_____ÅõÀÚÁ¤º¸-Á¾¸ñÃ£±â (pop_itemfind.html)*/
function img_chan(num){
	var elem = document.getElementById("tmpImg");
	var leng = elem.getElementsByTagName("img");

	for(i=0; i<leng.length; i++) {
		if (i == num){
			leng[i].src = leng[i].src.replace("_off.gif", "_on.gif");
		}
		else {
			leng[i].src = leng[i].src.replace("_on.gif", "_off.gif");
		}
	}
}

/**********************************************************************************************************************/
/* wingmenu */
function favoritesView() {
  if(!document.getElementById("btnFavori")) return false;
  var elem = document.getElementById("btnFavori");
  elem.onclick = function() {
      var bookmark = document.getElementById("bookmark");
      if(bookmark){
          Favorites.favoritesClose();
      }else{
          Favorites.favoritesView();

      }
  }
}


/**
  * Áñ°Ü Ã£±â (Áñ°Ü Ã£±â´Â 100 °³ ÀÌ»óÀº ¼±ÅÃÇÒ¼ö ¾ø´Ù.)
  * {string} menuList  ==> ÀüÃ¼ ¸Þ´ºÀÇ °ªÀ» ´ã±â À§ÇØ¼­ »ç¿ë ÇÏ´Â º¯¼ö
  * {string} cookieMenu ==> cookie ¿¡ ÀúÀåµÈ Áñ°ÜÃ£±â ¼±ÅÃµÈ ¸Þ´º ¿¹) [{"c":"50","s":[{"c":"225","s":[{"c":"239"},{"c":"254"}]}]},{"c":"250","s":[{"c":"251"}]}]
  *                                                                      c : ¸Þ´º ÄÚµå
  *                                                                      s : ÇÏÀ§¸Þ´º
  * {string} headerHTML ==> Áñ°ÜÃ£±â »ó´ÜÀÇ html
  * {string} footerSaveHTML ==> Áñ°ÜÃ£±â ¼±ÅÃ ÇÏ´Ü html
  * {string} footerViewHTML ==> Áñ°ÜÃ£±â º¸±â ÇÏ´Ü html
  *
  * {function} createObj ==> object »ý¼º ÇÔ¼ö
  * {function} favoritesCreate ==> Áñ°ÜÃ£±â ¼±ÅÃÈ­¸é »ý¼º
  * {function} allCheckBox ==> Áñ°Ü Ã£±â ¸ðµÎ ¼±ÅÃ
  * {function} favoritesClose ==> Áñ°ÜÃ£±â ´Ý±â
  * {function} searchCheckMenu ==> Æ¯Á¤ object ÇÏÀ§ÀÇ checkbox ¿¡ ¼±ÅÃµÈ°ÍÀÌ ÀÖ´ÂÁö Ã¼Å©
  * {function} favoriteSaveCheckedCount ==> Áñ°Ü Ã£±â ¼±ÅÃÇÑ °¹¼ö ¹ÝÈ¯
  * {function} setCookie ==> ÄíÅ°¿¡ ÀúÀå
  * {function} getCookie ==> ÄíÅ°¿¡ ÀúÀåµÈ °ª °¡Á® ¿À±â
  * {function} favoritesSave ==> Áñ°ÜÃ£±â ¼±ÅÃµÈ°Í cookie ¿¡ ÀúÀåÇÏ±â
  * {function} favoritesView ==> Áñ°ÜÃ£±â º¸±â
  */
var Favorites = {
    menuList : null,
    cookieMenu : null,
    headerHTML : "<p class='tit'><img src='http://img.ibks.com/img/mypage/txt_tit_bookmark.gif' alt='Favorites Áñ°ÜÃ£±â °í°´´ÔÀÇ Áñ°ÜÃ£±â¸¦ ¼³Á¤ÇØº¸¼¼¿ä.' title='' /></p>",
    footerSaveHTML : "<p><a href='javascript:Favorites.favoritesSave();' class='btn_config'><img src='http://img.ibks.com/img/common/button/btn_favor_save.gif' alt='ÀúÀå' title='' /></a>"+
                 "<a href='javascript:Favorites.favoritesClose();' class='btn_close'><img src='http://img.ibks.com/img/common/button/btn_favor_close.gif' alt='close' title='' /></a></p>",
    footerViewHTML : "<p><a href='javascript:Favorites.favoritesCreate();' class='btn_config'><img src='http://img.ibks.com/img/common/button/btn_favor_conf.gif' alt='¼³Á¤' title='' /></a>"+
                 "<a href='javascript:Favorites.favoritesClose();' class='btn_close'><img src='http://img.ibks.com/img/common/button/btn_favor_close.gif' alt='close' title='' /></a></p>",

    /** object »ý¼º
      * @param {String} »ý¼ºÇÒ tagName
      * @param {String} »ý¼ºÇÒ tag ÀÇ id
      * @param {String} »ý¼ºÇÒ tag ÀÇ class ¸í
      * @return »ý¼ºµÈ object
      **/
    createObj : function(){
        var tag;
        try{
            tag = document.createElement(arguments[0]);
            if(arguments[1]) tag.id = arguments[1];
            if(arguments[2]) tag.className = arguments[2];
        }catch(e){}
        return tag;
    },

    /** Áñ°Ü Ã£±â ¼±ÅÃ È­¸é
      **/
    favoritesCreate : function(){
        this.menuList = top.viewFrame.topFrame.menuList; //»ó´Ü ÇÁ·¹ÀÓ¿¡¼­ ÀüÃ¼ ¸Þ´º¿¡ °üÇÑ µ¥ÀÌÅ¸¸¦ °¡Á® ¿Â´Ù.
        this.favoritesClose(); //ÇöÀç ¿­·Á ÀÖ´Â ÆäÀÌÁö¸¦ ÃÊ±âÈ­ ÇÏ³®.
        document.getElementById("bmIframe").style.display = "block";//selectbox ¿Í °°Àº div À§¿¡ ¶ß´Â object ¶§¹®¿¡ iframe À» µÚ¿¡ °¨½Î ÁØ´Ù.
        this.getCookie("favorites"); //this.cookieMenu ¿¡ ¼±ÅÃµÈ cookie °ªÀ» ´ã´Â´Ù.

        var bookmark = this.createObj("div", "bookmark", "favorites");
        document.getElementById("wingmenu").appendChild(bookmark);
        bookmark.innerHTML = this.headerHTML;


        var section_favorites = this.createObj("div","favorites","section_favorites");
        bookmark.appendChild(section_favorites);

        var bg_line_t;
        // 1 dept ¸Þ´º
        for(var i = 0 ; i < this.menuList.length ; i++){
            var cookieDept1 = null;//ÄíÅ°¿¡ ÀúÀåµÈ 1detp ¸Þ´º
            if(this.cookieMenu != null){
                //ÇöÀç 1 dept ¸Þ´º¿Í cookie ÀÇ 1 dept ¸Þ´º¿Í °°Àº °ÍÀ» Ã£´Â´Ù.
                for(var ci = 0 ; ci < this.cookieMenu.length; ci++){
                    if(this.menuList[i].menu_seqno == this.cookieMenu[ci].c){
                        cookieDept1 = this.cookieMenu[ci].s;
                    }
                }
            }

            if(i%3 == 0){
                var bg_line_m;
                if(i == 0 ){
                    bg_line_m = this.createObj("div",null,"bg_line_m");
                }else{
                    bg_line_m = this.createObj("div",null,"bg_line_m mgt_3");
                }
                section_favorites.appendChild(bg_line_m);

                bg_line_t = this.createObj("div",null,"bg_line_t");
                bg_line_m.appendChild(bg_line_t);
            }

            var depth1UL;

            switch (i%3){
                case 0 :
                        depth1UL = this.createObj("ul",null,"depth1 me_first");
                    break;
                case 1 :
                        depth1UL = this.createObj("ul",null,"depth1 me_second");
                    break;
                case 2 :
                        depth1UL = this.createObj("ul",null,"depth1 me_last");
                    break;
            }

            bg_line_t.appendChild(depth1UL);

            //1 dept ¸Þ´º ±×¸®±â ½ÃÀÛ
            var depth1LI = this.createObj("li");
            depth1LI.setAttribute("code",this.menuList[i].menu_seqno);
            depth1UL.appendChild(depth1LI);

            var depth1LIstrong = this.createObj("strong");
            depth1LIstrong.innerHTML = this.menuList[i].menu_name;
            depth1LI.appendChild(depth1LIstrong);
            //1 dept ¸Þ´º ±×¸®±â Á¾·á

            if(this.menuList[i].sub_menu){ // ¸Þ´º¿¡ ÇÏÀ§ ¸Þ´º°¡ ÀÖ´ÂÁö °Ë»ç
                var depth2UL = this.createObj("ul",null,"depth2");
                depth1LI.appendChild(depth2UL);

                var depth2List = this.menuList[i].sub_menu;// 2 dept ¸Þ´º
                //2 dept ¸Þ´º loop
                for(var j = 0 ;j < depth2List.length ; j++){
                    var cookieDept2 = null;//ÄíÅ°¿¡ ÀúÀåµÈ 2detp ¸Þ´º
                    if(cookieDept1 != null){
                        //ÇöÀç 2 dept ¸Þ´º¿Í cookie ÀÇ 2 dept ¸Þ´º¿Í °°Àº °ÍÀ» Ã£´Â´Ù.
                        for(var cj = 0; cj < cookieDept1.length ; cj++){
                            if(depth2List[j].menu_seqno == cookieDept1[cj].c){
                                // ÇÏÀ§ ¸Þ´º°¡ ÀÖÀ¸¸é ÇÏÀ§ ¸Þ´º¸¦ ´ã°í ÇÏÀ§ ¸Þ´º°¡ ¾øÀ¸¸é ÇöÀç ¸Þ´º°¡ ¼±ÅÃµÈ°ÍÀÌ¹Ç·Î
                                // ÄÚµå¸¦ ´ã´Â´Ù.
                                if(cookieDept1[cj].s){
                                    cookieDept2 = cookieDept1[cj].s
                                }else{
                                    cookieDept2 = cookieDept1[cj].c
                                }
                            }
                        }
                    }


                    var depth2LI = this.createObj("li");
                    depth2LI.setAttribute("code",depth2List[j].menu_seqno);
                    depth2UL.appendChild(depth2LI)

                    // ÇÏÀ§ ¸Þ´º°¡ ÀÖ´ÂÁö ¾ø´ÂÁöÀÇ ºÐ±â
                    // ÇÏÀ§ ¸Þ´º°¡ ÀÖÀ¸¸é loop ÀÛ¾÷À» ÇÏ±¸ ¾øÀ¸¸é check ÀÛ¾÷À» ÇÑ´Ù.
                    if(depth2List[j].sub_menu){ //ÇÏÀ§ ¸Þ´º ÀÖÀ»°æ¿ì ÇÏÀ§ ¸Þ´º ÀÛ¾÷
                        var depth2A = this.createObj("a","depth2_"+depth2List[j].menu_seqno);
                        depth2A.href = "#";
                        depth2A.innerHTML = depth2List[j].menu_name;


                        depth2LI.appendChild(depth2A);


                        var depth3UL = this.createObj("ul",null,"depth3");
                        depth2LI.appendChild(depth3UL);

                        var depth3List = depth2List[j].sub_menu;
                        //3 dept ¸Þ´º loop
                        for(var k = 0 ;k < depth3List.length ; k++){
                            var cookieDept3 = null;//ÄíÅ°¿¡ ÀúÀåµÈ 3detp ¸Þ´º
                            if(cookieDept2 != null){
                                //ÇöÀç 3 dept ¸Þ´º¿Í cookie ÀÇ 3 dept ¸Þ´º¿Í °°Àº °ÍÀ» Ã£´Â´Ù.
                                for(var ck = 0; ck < cookieDept2.length ; ck++){
                                    if(depth3List[k].menu_seqno == cookieDept2[ck].c){
                                        cookieDept3 = cookieDept2[ck].c
                                    }
                                }
                            }

                            //3 dept ¸Þ´º ±×¸®±â
                            var depth3LI;
                            if(i%3 == 2)
                                depth3LI = this.createObj("li",null,"posi_r");
                            else
                                depth3LI = this.createObj("li");
                            depth3UL.appendChild(depth3LI)
                            depth3LI.setAttribute("code",depth3List[k].menu_seqno);


                            var label = this.createObj("label");
                            label.setAttribute("for","code_"+depth3List[k].menu_seqno);
                            label.innerHTML = depth3List[k].menu_name;

                            depth3LI.appendChild(label);

                            var checkbox = this.createObj("input","code_"+depth3List[k].menu_seqno,"input_checkbox");
                            checkbox.type = "checkbox";
                            checkbox.setAttribute("level",depth3List[k].level);
                            checkbox.setAttribute("menu_url",depth3List[k].menu_url);
                            depth3LI.appendChild(checkbox);
                            if(cookieDept3 != null){
                                checkbox.setAttribute("checked","true");
                            }
                        }
                    }else{//ÇÏÀ§ ¸Þ´º°¡ ¾øÀ»°æ¿ì È­¸é ±×¸®±â
                        depth2LI.className = "check";

                        var depth2A = this.createObj("a");
                        depth2A.href = "#";
                        depth2LI.appendChild(depth2A);

                        var label = this.createObj("label");
                        label.setAttribute("for","code_"+depth2List[j].menu_seqno);
                        label.innerHTML = depth2List[j].menu_name;
                        depth2A.appendChild(label);

                        var checkbox = this.createObj("input","code_"+depth2List[j].menu_seqno,"depth2_checkbox");
                        checkbox.type = "checkbox";
                        checkbox.setAttribute("level",depth2List[j].level)
                        checkbox.setAttribute("menu_url",depth2List[j].menu_url);
                        depth2LI.appendChild(checkbox);

                        if(cookieDept2 != null){
                            checkbox.setAttribute("checked","true");
                        }
                    }
                }
            }
            if(i%3 == 2 ){
                var br = this.createObj("br",null,"cboth");
                bg_line_t.appendChild(br);
                section_favorites.appendChild(this.createObj("div",null,"bg_line_b"));
            }
        }
        if(this.menuList.length%3 == 2){
            section_favorites.appendChild(this.createObj("div",null,"bg_line_b"));
        }
        bookmark.innerHTML += this.footerSaveHTML;

//        document.getElementById("inner").value = document.getElementById("wingmenu").innerHTML;

        favoritesHighlight();
        favoritesCheck();
    },
    /** Áñ°Ü Ã£±â ¸ðµÎ ¼±ÅÃ **/
    allCheckBox : function(){
        var bookmark = document.getElementById("bookmark");
        var arr_check = bookmark.getElementsByTagName("input");
        for(var i = 0 ; i < arr_check.length ; i++){
            arr_check[i].checked = true;
        }
    },
    /** Áñ°Ü Ã£±â ´Ý±â **/
    favoritesClose : function(){
        var obj = document.getElementById('bookmark');
        if(obj){
            obj.parentNode.removeChild(obj);
            document.getElementById("bmIframe").style.display = "none";
        }
    },

    /** ÇÏÀ§ ¸Þ´º¿¡ ¼±ÅÃµÈ Áñ°Ü Ã£±â°¡ ÀÖ´ÂÁö °Ë»ö
      * @param {Object} object ¹Ø¿¡ ÇÏÀ§¸Þ´º°¡ ÀÖ´ÂÁö¸¦ Ã¼Å©ÇÒ °ª
      * @return ÇÏÀ§ ¸Þ´º°¡ ÀÖÀ»°æ¿ì true ¾øÀ»°æ¿ì false ¹ÝÈ¯ÇÑ´Ù.
      **/
    searchCheckMenu : function(){
        var obj = arguments[0].getElementsByTagName("input");

        for(var i = 0 ; i < obj.length ; i++){
            if(obj[i].type == "checkbox" && obj[i].checked){
                return true;
            }
        }
        return false;
    },
    /** Áñ°Ü Ã£±â ¼±ÅÃÇÑ °¹¼ö ¹ÝÈ¯
      **/
    favoriteSaveCheckedCount : function(){
        var bookmark = document.getElementById("bookmark");

        var arr_check = bookmark.getElementsByTagName("input");

        var checkedInt = 0;
        for(var i = 0 ; i < arr_check.length ; i++){
            if(arr_check[i].checked)
                checkedInt++;
        }
        return checkedInt;
    },
    /**
      * ÄíÅ°¿¡ Áñ°Ü Ã£±â ÀúÀå
      * @param {String} ÄíÅ°¿¡ ÀúÀåÇÒ ¸í
      * @param {String} ÄíÅ°¿¡ ÀúÀåÇÒ °ª
      **/
    setCookie : function(){
        var cookieName = arguments[0];
        var cookieValue = arguments[1];

        document.cookie=cookieName+'= ; path=/; expires= ;';

        var date=new Date();
        var validity=30;
        date.setDate(date.getDate()+validity);
        document.cookie=cookieName+'='+cookieValue+'; path=/; expires='+date.toGMTString();

    },
    /**
      * ÄíÅ°¿¡¼­ Áñ°Ü Ã£±â¸¦ cookieMenu ¿¡ ¼ÂÆÃ
      * @param {String} ÄíÅ°¿¡ ÀúÀåÇÒ ¸í
      **/
    getCookie : function(){
        var cookieName = arguments[0];

        var search = cookieName + "=";

        if (document.cookie.length > 0) {
            var offset = document.cookie.indexOf(search);

            if (offset != -1) {
                offset += search.length;
                var end = document.cookie.indexOf(";", offset);

                if (end == -1) end = document.cookie.length;
                this.cookieMenu = eval(unescape(document.cookie.substring(offset, end)));
//                document.getElementById("inner").value = unescape(document.cookie.substring(offset, end));
            }
            else this.cookieMenu = null;
        }
        else this.cookieMenu = null;
    },
    /**
      * Áñ°Ü Ã£±â ÀúÀå
      **/
    favoritesSave : function(){
        var checkInt = this.favoriteSaveCheckedCount()//¼±ÅÃµÈ Áñ°Ü Ã£±âÀÇ °³¼ö
        if(checkInt > 100){
            alert("ÇöÀç ¼±ÅÃÇÑ ¸Þ´º°¡ "+checkInt+"°³ ÀÔ´Ï´Ù. 100°³ ÀÌÇÏ·Î ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
            return;
        }


        var saveMenu = "[";// ÀúÀåÇÒ Áñ°Ü Ã£±â json µ¥ÀÌÅ¸ Å¸ÀÔÀ» ¸¸µé string
        var topDom;//Áñ°Ü Ã£±â
        var bookmark = document.getElementById("bookmark");
        for(var i = 0 ; i < bookmark.childNodes.length ;i++){
            if(bookmark.childNodes[i].className == "section_favorites"){
                topDom = bookmark.childNodes[i];
                break;
            }
        }

        var depth1Length = 0;

        for (var i = 0; i < topDom.childNodes.length; i++) {
            if (topDom.childNodes[i].className.indexOf("bg_line_m") != -1) {
                var depth1 = topDom.childNodes[i].childNodes[0].childNodes;
                //1 dept Áñ°Ü Ã£±â loop
                for (var d1i = 0; d1i < depth1.length; d1i++) {
                    if (depth1[d1i].tagName == "UL") {
                        if (this.searchCheckMenu(depth1[d1i])) {
                            if (depth1Length > 0) saveMenu += ",";
                            var temp = "{\"c\":\"" + depth1[d1i].childNodes[0].getAttribute("code") + "\"";
                            for (var depth2_i = 0; depth2_i < depth1[d1i].childNodes[0].childNodes.length; depth2_i++) {//1dept ¾Æ·¡ ul ÅÂ±× ¹Ø¿¡ 2 dept °¡ ÀÖÀ¸¹Ç·Î ul ÅÂ±× Ã£±â
                                if (depth1[d1i].childNodes[0].childNodes[depth2_i].tagName == "UL") {
                                    var depth2 = depth1[d1i].childNodes[0].childNodes[depth2_i];

                                    var depth2Length = 0;
                                    temp += ",\"s\":[";
                                    //2 dept Áñ°Ü Ã£±â loop
                                    for (var d2i = 0; d2i < depth2.childNodes.length; d2i++) {
                                        if (this.searchCheckMenu(depth2.childNodes[d2i])) {
                                            if (depth2Length > 0) temp += ",";

                                            temp += "{\"c\":\"" + depth2.childNodes[d2i].getAttribute("code") + "\"";

                                            for (var depth3_i = 0; depth3_i < depth2.childNodes[d2i].childNodes.length; depth3_i++) {

                                                if (depth2.childNodes[d2i].childNodes[depth3_i].tagName == "UL") {
                                                    var depth3 = depth2.childNodes[d2i].childNodes[depth3_i].childNodes;
                                                    temp += ",\"s\":[";
                                                    var depth3Length = 0;
                                                    //3 dept Áñ°Ü Ã£±â loop
                                                    for (var depth_last = 0; depth_last < depth3.length; depth_last++) {

                                                        if (this.searchCheckMenu(depth3[depth_last])) {
                                                            if (depth3Length > 0) temp += ",";
                                                            temp += "{\"c\":\"" + depth3[depth_last].getAttribute("code")+ "\"}";
                                                            depth3Length++;
                                                        }
                                                    }
                                                    temp += "]";
                                                }
                                            }
                                            temp += "}";
                                            depth2Length++;
                                        }
                                    }
                                    temp += "]";
                                }
                            }
                            temp += "}";
                            depth1Length++;
                            saveMenu += temp;
                        }
                    }
                }
            }
        }
        saveMenu += "]";

        this.setCookie("favorites",saveMenu);
//        document.getElementById("inner").value = saveMenu;
        this.favoritesView();
    },
    /**
      * Áñ°Ü Ã£±â º¸±â
      **/
    favoritesView : function(){
    	
    	return;
        this.menuList = top.viewFrame.topFrame.menuList;//»ó´Ü frame ¿¡ ÀÖ´Â ÀüÃ¼ ¸Þ´º Á¤º¸
        this.favoritesClose();
        document.getElementById("bmIframe").style.display = "block";
        this.getCookie("favorites");//ÄíÅ°ÀÇ µ¥ÀÌÅ¸ °¡Á® ¿À±â

        var bookmark = this.createObj("div", "bookmark", "favorites");
        document.getElementById("wingmenu").appendChild(bookmark);
        bookmark.innerHTML = this.headerHTML;
        var section_favorites = this.createObj("div","favorites","section_favorites");
        bookmark.appendChild(section_favorites);

        var mymenu = this.createObj("div",null,"mymenu");
        section_favorites.appendChild(mymenu);

        var section1 = this.createObj("div",null,"section_mymenu mgr_3");
        mymenu.appendChild(section1);
        var section2 = this.createObj("div",null,"section_mymenu mgr_3");
        mymenu.appendChild(section2);
        var section3 = this.createObj("div",null,"section_mymenu");
        mymenu.appendChild(section3);

        var index = 0;
        if(this.cookieMenu != null){
            for(var deptM1 = 0 ; deptM1 < this.menuList.length ; deptM1++){//1 dept ¸Þ´º
                for(var deptC1 = 0; deptC1 < this.cookieMenu.length ; deptC1++){// 1 dept ÄíÅ°ÀÇ ¸Þ´º
                    if(this.menuList[deptM1].menu_seqno == this.cookieMenu[deptC1].c){//ÀüÃ¼ ¸Þ´º¿Í ÄíÅ°ÀÇ ¸Þ´º °°Àº ÄÚµå Ã£±â


                        var divDept1;
                        if(index%3 == 0)
                             divDept1 = section1
                        else if(index%3 == 1)
                             divDept1 = section2
                        else
                             divDept1 = section3
                        // 1dept ±×¸®±â
                        var ulDept1 = this.createObj("ul",null,"depth1");
                        divDept1.appendChild(ulDept1);
                        var liDept1 = this.createObj("li");
                        ulDept1.appendChild(liDept1);
                        var strongDept1 = this.createObj("strong");
                        liDept1.appendChild(strongDept1);
                        strongDept1.innerHTML = this.menuList[deptM1].menu_name;


                        var menuListDept1 = this.menuList[deptM1].sub_menu;
                        var cookieMenuDept1 = this.cookieMenu[deptC1].s;
                        var indexDept2 = 0;
                        for(var deptM2 = 0; deptM2 < menuListDept1.length; deptM2++){//2 dept ¸Þ´º
                            for(var deptC2 = 0; deptC2 < cookieMenuDept1.length; deptC2++){// 2 dept ÄíÅ° ¸Þ´º
                                if(menuListDept1[deptM2].menu_seqno == cookieMenuDept1[deptC2].c){// ¸Þ´º¿Í ÄíÅ°¿¡ ¼±ÅÃµÈ ¸Þ´º °°Àº°Í Ã£±â
                                    var ulDept2;
                                    if(indexDept2 == 0){
                                        ulDept2 = this.createObj("ul",null,"depth2");
                                        liDept1.appendChild(ulDept2);
                                    }

                                    var liDept2 = this.createObj("li");
                                    ulDept2.appendChild(liDept2);

                                    var aDept2 = this.createObj("a");
                                    if(menuListDept1[deptM2].menu_page_attribute == "N"){
                                        aDept2.href ="javascript:menuWindowOpen('"+menuListDept1[deptM2].menu_url+"','"+menuListDept1[deptM2].menu_newwindow_width+"','"+menuListDept1[deptM2].menu_newwindow_height+"')";
                                    }else if(menuListDept1[deptM2].menu_is_main_menu == "N"){
                                        aDept2.href = "javascript:moveUrl('"+menuListDept1[deptM2].menu_url+"','','"+menuListDept1[deptM2].menu_is_main_menu+"','"+menuListDept1[deptM2].menu_page_attribute+"','"+menuListDept1[deptM2].menu_seqno+"','"+menuListDept1[deptM2].menu_parent_seqno+"','"+menuListDept1[deptM2].menu_parent_seqno+"','"+menuListDept1[deptM2].menu_link_is_xecure+"')";
                                    }else{
                                        aDept2.href = "javascript:moveUrl('"+menuListDept1[deptM2].menu_url+"','"+menuListDept1[deptM2].menu_parent_seqno+"/"+menuListDept1[deptM2].menu_seqno+"','"+menuListDept1[deptM2].menu_is_main_menu+"','"+menuListDept1[deptM2].menu_page_attribute+"','"+menuListDept1[deptM2].menu_seqno+"','"+menuListDept1[deptM2].menu_seqno+"','"+menuListDept1[deptM2].menu_link_is_xecure+"')";
                                    }
                                    liDept2.appendChild(aDept2);

                                    aDept2.innerHTML = menuListDept1[deptM2].menu_name;

                                    if(cookieMenuDept1[deptC2].s){
                                        var menuListDept2 = menuListDept1[deptM2].sub_menu;
                                        var cookieMenuDept2 = cookieMenuDept1[deptC2].s;
                                        var indexDept3 = 0;
                                        for(var deptM3 = 0; deptM3 < menuListDept2.length; deptM3++){//3 dept ¸Þ´º
                                            for(var deptC3 = 0; deptC3 < cookieMenuDept2.length; deptC3++){// 3 dept ÄíÅ° ¸Þ´º
                                                if(menuListDept2[deptM3].menu_seqno == cookieMenuDept2[deptC3].c){// ¸Þ´º¿Í ÄíÅ°¿¡ ¼±ÅÃµÈ ¸Þ´º °°Àº°Í Ã£±â
                                                    var ulDept3;
                                                    if(indexDept3 == 0){
                                                        ulDept3 = this.createObj("ul",null,"depth3");
                                                        liDept2.appendChild(ulDept3);
                                                    }

                                                    var liDept3 = this.createObj("li");
                                                    ulDept3.appendChild(liDept3);

                                                    var aDept3 = this.createObj("a");
                                                    aDept3.href = menuListDept2[deptM3].menu_url;
                                                    if(menuListDept2[deptM3].menu_page_attribute == "N"){
                                                        aDept3.href ="javascript:menuWindowOpen('"+menuListDept2[deptM3].menu_url+"','"+menuListDept2[deptM3].menu_newwindow_width+"','"+menuListDept2[deptM3].menu_newwindow_height+"')";
                                                    }else if(menuListDept1[deptM2].menu_is_main_menu == "N"){
                                                        aDept3.href ="javascript:moveUrl('"+menuListDept2[deptM3].menu_url+"','','"+menuListDept2[deptM3].menu_is_main_menu+"','"+menuListDept2[deptM3].menu_page_attribute+"','"+menuListDept2[deptM3].menu_seqno+"','"+menuListDept1[deptM2].menu_parent_seqno+"','"+menuListDept1[deptM2].menu_parent_seqno+"','"+menuListDept1[deptM2].menu_link_is_xecure+"')";
                                                    }else{
                                                        aDept3.href ="javascript:moveUrl('"+menuListDept2[deptM3].menu_url+"','"+menuListDept1[deptM2].menu_parent_seqno+"/"+menuListDept1[deptM2].menu_seqno+"','"+menuListDept2[deptM3].menu_is_main_menu+"','"+menuListDept2[deptM3].menu_page_attribute+"','"+menuListDept2[deptM3].menu_seqno+"','"+menuListDept2[deptM3].menu_seqno+"','"+menuListDept2[deptM3].menu_link_is_xecure+"')";
                                                    }
                                                    liDept3.appendChild(aDept3);

                                                    aDept3.innerHTML = menuListDept2[deptM3].menu_name;


                                                    indexDept3++;
                                                }
                                            }
                                        }
                                    }

                                    indexDept2++;
                                }
                            }
                        }

                        var objDeptC1 = this.cookieMenu[deptC1].s;
                        index++;
                    }
                }
            }
        }

        bookmark.innerHTML += this.footerViewHTML;

//        document.getElementById("inner").value = document.getElementById("wingmenu").innerHTML;

        favoritesHighlight();
    }
}

/**
  * ¿ÞÂÊ ¸Þ´º ¼±ÅÃ½Ã ¼±ÅÃ µÈ°ÍÀ» Ç¥½Ã ÇÏ±â À§ÇÑ ½ºÅ©¸³Æ®
  * ¸Þ´º ÀüÃ¼ÀÇ ¼±ÅÃ°ªÀ» Ãë¼ÒÇÏ°í
  * ÇöÁ¦ ´©¸¥ ¸Þ´ºÀÇ »óÀ§ ¸Þ´º°¡ ÀÖÀ»°æ¿ì¿¡ »óÀ§ ¸Þ´ºµµ ¼±ÅÃ Ç¥½Ã¸¦ ÇØ ÁØ´Ù.
  * @param {Object} ÇöÀç ´©¸¥ Object °ª
  */
function leftMenuSelected(obj){

    var elem = document.getElementById("depth1").getElementsByTagName("li");
    for(var i = 0 ; i < elem.length ; i++){
        try{
            if(elem[i].id.indexOf("code1")!= -1){
                var d1Obj = elem[i];
                d1Obj.className = "";
                d1Obj.getElementsByTagName("A")[0].className = "";

            }else{
                var d1Obj = elem[i].parentNode.parentNode;
                d1Obj.className = "";
                d1Obj.getElementsByTagName("A")[0].className = "";
                elem[i].getElementsByTagName("A")[0].className = "";
            }
        }catch(e){}
    }

    if(obj.parentNode.id.indexOf("code1") != -1){
        var d1Obj = obj.parentNode
        d1Obj.className = "here";
        d1Obj.getElementsByTagName("A")[0].className = "d1_selected";
    }else{
        var d1Obj = obj.parentNode.parentNode.parentNode;
        d1Obj.className = "here";
        d1Obj.getElementsByTagName("A")[0].className = "d1_selected";
        obj.className = "d2_selected";
    }
}

/**
 * ¿ÞÂÊ ¸Þ´º °ü·Ã ÇÔ¼ö
 * ¿ÞÂÊ Å¬¸¯½Ã ÇÏÀ§ div ¸¦ ¿ÀÇÂÇØ ÁØ´Ù.
 * @param {Object} menu_id ¸Þ´º ¾ÆÀÌµð
 */
function openMenu(menu_id, url,event){
    var arrObj = document.getElementById("depth1").getElementsByTagName("ul");
    for(var i = 0 ; i < arrObj.length; i++){
        if(arrObj[i].id.indexOf("menuUL") > -1 && arrObj[i].id != menu_id){
            arrObj[i].style.display = "none";
            arrObj[i].previousSibling.previousSibling.className = "";
            arrObj[i].parentNode.className = "";
        }
    }


    var menuObj = document.getElementById(menu_id);
    if(menuObj.style.display == "none"){
        menuObj.style.display = "block";
        try{
            if(url.length > 0){
                top.viewFrame.fFrame.mainFrame.location.href = url;
        }
        }catch(e){}
    }else{
        menuObj.style.display = "none";
    }
}

/**
  * »ó´Ü º¯°æ ¾øÀÌ ÆäÀÌÁö ÀÌµ¿ »ó¼¼ ÆäÀÌÁö·Î default
  * @param {string} url : ÀÌµ¿ÇÒ url
  * @param {int} menu_parent_seqno : ¿ÞÂÊ ¸Þ´º¸¦ ¿­¾î¾ß ÇÏ´Â °ª
  * @param {int} selected_menu : ¿ÞÂÊ ¸Þ´º¿¡ ¼±ÅÃ µÇ¾î¾ß ÇÏ´Â°ª
  * @param {char} menu_link_is_xecure : xecure ¸¦ »ç¿ëÇÒÁö ¾È»ç¿ëÇÒÁö ÀÇ °ª (Y,N)
  **/
function goMenuD(url,menu_parent_seqno,selected_menu,menu_link_is_xecure){
    var frm = document.createElement("form");
    frm.setAttribute("target","fFrame");
    frm.setAttribute("id","createForm");
    frm.setAttribute("method","post");
    frm.setAttribute("action","/menu_subframe.do");
    frm.setAttribute("name","createForm");
    document.body.appendChild(frm);

	if(navigator.appVersion.indexOf("MSIE") != -1) {
        createHiddenInput2(frm,"url",url);
        createHiddenInput2(frm,"menu_parent_seqno",menu_parent_seqno);
        createHiddenInput2(frm,"selected_menu",selected_menu);
        createHiddenInput2(frm,"p",menu_link_is_xecure);
    }else{
        createHiddenInput(frm,"url",url);
        createHiddenInput(frm,"menu_parent_seqno",menu_parent_seqno);
        createHiddenInput(frm,"selected_menu",selected_menu);
        createHiddenInput(frm,"p",menu_link_is_xecure);
    }

    frm.submit();
}

/**
  * ¸ðÁú¶ó¿¡¼­ »ç¿ëÇÏ´Â input tag »ý¼º
  */
function createHiddenInput(form,name,value){
    var inp = document.createElement("input");
    inp.setAttribute("type","hidden");
    inp.setAttribute("name",name);
    inp.setAttribute("value",value);
    form.appendChild(inp);
}


/**
  * ie ¿¡¼­ »ç¿ëÇÏ´Â input tag »ý¼º
  */
function createHiddenInput2(form,name,value){
//    var inp = document.createElement("<input type='hidden' name='"+name+"' value='"+value+"'/>");
    var inp = document.createElement("input");
    inp.setAttribute("type","hidden");
    inp.setAttribute("name",name);
    inp.setAttribute("value",value);

    form.appendChild(inp);
}

/**
  * ¸Þ´º ¸µÅ© form »ý¼ºÇØ¼­ ¸µÅ©¸¦ °Ç´Ù.
  * ÀüÃ¼ ÆäÀÌÁö°¡ ·Îµå µÈ´Ù.
  * @param {string} url : ¿­¾î¾ß ÇÏ´Â ÆäÀÌÁö
  * @param {int} seqno : ÇÃ·¹½¬¿¡ ÇöÁ¦ ÆäÀÌÁö°¡ ¾î¶² ¸Þ´º¿¡ ¼ÓÇÏ´ÂÁö Ç¥½Ã ÇØ ÁÖ±â À§ÇÑ °ª menu_parent_seqno/menu_seqno
  *         ¿¹)50/232 ÁÖ¸Þ´º¿¡¼­¸¸ »ç¿ë ÇÑ´Ù. ºÎ¸Þ´º¿¡¼­´Â ºó°ª
  * @param {char} menu_is_main_menu : ÁÖ ¸Þ´º ÀÎÁö ºÎ¸Þ´º ÀÎÁö ±¸ºÐ
  * @param {char} menu_page_attribute : ÇöÀç ÆäÀÌÁö°¡ ¼­ºê ¸ÞÀÎÇüÀÎÁö ¾Æ´Ï¸é µðÆúÆ® ÇüÀÎÁö ±¸ºÐ
  * @param {int} selected_menu : ¸Þ´º ¼±ÅÃ Ç¥½Ã ÇÏ±â À§ÇØ »ç¿ëÇÏ´Â ¼±ÅÃµÈ ¸Þ´º ¹øÈ£(menu_seqno)
  * @param {int} menu_seqno : ¿ÞÂÊ ¸Þ´º¸¦ °¡Á® ¿À±â À§ÇÑ ¿ÞÂÊ ¸Þ´ºÀÇ ÃÖ»óÀ§ ¸Þ´ºÄÚµå°ª
  * @param {char} menu_link_is_xecure : xecure »ç¿ë ¿©ºÎ Y => »ç¿ë N => ¹Ì»ç¿ë
  */
function moveUrl(url, seqno, menu_is_main_menu, menu_page_attribute, selected_menu, menu_seqno, menu_link_is_xecure){
    var frm = document.createElement("form");
    
	try {			
		if (window.top.viewFrame.name == "viewFrame") {
		    frm.setAttribute("target","viewFrame");
		    frm.setAttribute("id","createForm");
		    frm.setAttribute("method","post");
		    frm.setAttribute("action","/menu_mainframe.do");
		    frm.setAttribute("name","createForm");
		    document.body.appendChild(frm);
		
			if(navigator.appVersion.indexOf("MSIE") != -1) {
		        createHiddenInput2(frm,"page_code",seqno);
		        createHiddenInput2(frm,"selected_menu",selected_menu);
		        createHiddenInput2(frm,"url",url);
		        createHiddenInput2(frm,"menu_is_main_menu",menu_is_main_menu);
		        createHiddenInput2(frm,"menu_page_attribute",menu_page_attribute);
		        createHiddenInput2(frm,"menu_seqno",menu_seqno);
		        createHiddenInput2(frm,"p",menu_link_is_xecure);
		    }else{
		        createHiddenInput(frm,"page_code",seqno);
		        createHiddenInput(frm,"selected_menu",selected_menu);
		        createHiddenInput(frm,"url",url);
		        createHiddenInput(frm,"menu_is_main_menu",menu_is_main_menu);
		        createHiddenInput(frm,"menu_page_attribute",menu_page_attribute);
		        createHiddenInput(frm,"menu_seqno",menu_seqno);
		        createHiddenInput(frm,"p",menu_link_is_xecure);
		    }
		
		    frm.submit();
		}
	} catch(ex) {
		alert('ºñÁ¤»óÀûÀÎ È£Ãâ¹æ½ÄÀ¸·Î Á¢±ÙÇÏ¿´½À´Ï´Ù. ÃÊ±âÈ­¸éÀ¸·Î ÀÌµ¿ÇÕ´Ï´Ù.');
		location.href = "/index.do";
	}		   
}

function menuWindowOpen(url, width, height){
    window.open(url,'','width='+width+",height="+height+",scrollbars=yes");
}
function mouseEventFalse(){
	document.oncontextmenu = function(){return false;}
	document.onselectstart = function(){return false;}
	document.ondragstart = function(){return false;}
}

/* °øÅëÆäÀÌÁö  Ãß°¡(YCS 08.10.02) */
function goHome(obj){
	menuLog('2');
	var frm = document.move;
	frm.target = "viewFrame";
	frm.action = obj.url;
	frm.submit();
}


function goDepth1(obj){
	var jsonData = eval(obj.data)[0];
	if(jsonData.menu_seqno){
		menuLog(jsonData.menu_seqno);
	}

	if(jsonData.menu_page_attribute == "N"){
		menuWindowOpen(obj.url,jsonData.menu_newwindow_width,jsonData.menu_newwindow_height);
	}else{
		var frm = document.move;
		
		try {			
			if (window.top.viewFrame.name == "viewFrame") {
				frm.target = "viewFrame";
				//frm.action = "/menu_mainframe.do";
				frm.action = obj.url;
				frm.url.value = obj.url;
				frm.page_code.value = jsonData.page_code;
				frm.menu_page_attribute.value = jsonData.menu_page_attribute;
				frm.menu_seqno.value = jsonData.menu_seqno;
				frm.p.value = jsonData.menu_link_is_xecure;
				frm.submit();
			}
		} catch(ex) {
			alert('ºñÁ¤»óÀûÀÎ È£Ãâ¹æ½ÄÀ¸·Î Á¢±ÙÇÏ¿´½À´Ï´Ù. ÃÊ±âÈ­¸éÀ¸·Î ÀÌµ¿ÇÕ´Ï´Ù.');
			frm.target = "_top";
			frm.action = "/index.do";
			frm.submit();
		}
	}
}

function goDepth2(obj){
	var jsonData = eval(obj.data)[0];
	//menuLog(jsonData.menu_seqno);

	if(jsonData.menu_page_attribute == "N"){
		menuWindowOpen(obj.url,jsonData.menu_newwindow_width,jsonData.menu_newwindow_height);
	}else{
		var frm = document.move;
		
		try {			
			if (window.top.viewFrame.name == "viewFrame") {
				frm.target = "viewFrame";
				frm.action = "/menu_mainframe.do";
				frm.url.value = obj.url;
				frm.page_code.value = jsonData.page_code;
				frm.menu_page_attribute.value = jsonData.menu_page_attribute;
				frm.menu_seqno.value = jsonData.menu_seqno;
				frm.p.value = jsonData.menu_link_is_xecure;
				if(jsonData.selected_menu)
					frm.selected_menu.value = jsonData.selected_menu;
				frm.submit();
			}
		} catch(ex) {
			alert('ºñÁ¤»óÀûÀÎ È£Ãâ¹æ½ÄÀ¸·Î Á¢±ÙÇÏ¿´½À´Ï´Ù. ÃÊ±âÈ­¸éÀ¸·Î ÀÌµ¿ÇÕ´Ï´Ù.');
			frm.target = "_top";
			frm.action = "/index.do";
			frm.submit();
		}
	}
}

function gohottvibk(idx) {
	var rtnURL;
	switch (idx) {
		case 1: /* IDµî·Ï */
			rtnURL = {"url":"/member/index/index.jsp", "data":"[{\"menu_seqno\":\"401\",\"selected_menu\":\"403\",\"page_code\":\"401\",\"menu_page_attribute\":\"D\", \"menu_link_is_xecure\":\"Y\"}]"};
			break;
		case 2: /* ·Î±×ÀÎ Made By YCS */
			rtnURL = {"url":"/member/login/regular.jsp", "data":"[{\"menu_seqno\":\"401\",\"selected_menu\":\"402\",\"page_code\":\"401\",\"menu_page_attribute\":\"D\", \"menu_link_is_xecure\":\"Y\"}]"};
			break;
		case 3: /* hotNews ½ÅÃ»ÇÏ±â YCS */
			rtnURL = {"url":"/mypage/nickname_newslist.do", "data":"[{\"menu_seqno\":\"47\",\"selected_menu\":\"617\",\"page_code\":\"614/47\",\"menu_page_attribute\":\"D\", \"menu_link_is_xecure\":\"Y\"}]"};
			break;
		case 4: /* ´ëÈ­¸í µî·Ï/º¯°æ YCS */
			rtnURL = {"url":"/mypage/nickname_reglist.do", "data":"[{\"menu_seqno\":\"47\",\"selected_menu\":\"616\",\"page_code\":\"614/47\",\"menu_page_attribute\":\"D\", \"menu_link_is_xecure\":\"Y\"}]"};
			break;
	}

	goDepth2(rtnURL);
}

/*-- AceCounter Log Gathering Script V.70.20080707 --
if(typeof _GUL == 'undefined'){
var _GUL = 'gtb2.acecounter.com';var _GPT='8080'; var _AIMG = new Image(); var _bn=navigator.appName; var _PR = location.protocol=="https:"?"https://"+_GUL:"http://"+_GUL+":"+_GPT;if( _bn.indexOf("Netscape") > -1 || _bn=="Mozilla"){ setTimeout("_AIMG.src = _PR+'/?cookie';",1); } else{ _AIMG.src = _PR+'/?cookie'; };
document.writeln("<scr"+"ipt language='javascript' src='/js/acecounter_V70.js'></scr"+"ipt>");
}
-- AceCounter Log Gathering Script End --*/

function fileNameCheck(f1, f2, f3, f4, f5) 
{
	var checkValue = false;
	
	if (f1 != "" && f1 != null) {
		checkValue = fileDetail(f1);
		if (checkValue == true) return checkValue;
	}
	
	if (f2 != "" && f2 != null) {
		checkValue = fileDetail(f2);
		if (checkValue == true) return checkValue;
	}
	
	if (f3 != "" && f3 != null) {
		checkValue = fileDetail(f3);
		if (checkValue == true) return checkValue;
	}
	
	if (f4 != "" && f4 != null) {
		checkValue = fileDetail(f4);
		if (checkValue == true) return checkValue;
	}
	
	if (f5 != "" && f5 != null) {
		checkValue = fileDetail(f5);
		if (checkValue == true) return checkValue;
	}
	
	return checkValue;
}

function fileDetail(diff) {
	switch(diff.substring(diff.length-4).toUpperCase()) 
	{
		case ".BMP" :
		case ".JPG" :
		case ".GIF" :
		case ".XLS" :
		case ".DOC" :
		case ".HWP" :
		case ".PPT" :
		case ".PDF" :
		case ".ZIP" :
		case ".MOV" :
		case ".MPG" :
		case ".ASF" :
		case ".AVI" :
			return false;
			break;
	}
	return true;
}

function CtrlCheckIsuNo(){ 
	if (event.ctrlKey == true ){
		 alert('CtrlÅ°´Â »ç¿ëÀÌ ºÒ°¡´É ÇÕ´Ï´Ù.');  
		 //if(typeof(setCommonCode) =="function") (getCommonIsuNo());
		 return false;
	} 
}

/**********************************************************************************************************************/

addLoadEvent(wtsTab)
//--------------------------
addLoadEvent(initMoving)
addLoadEvent(mouseTab)
addLoadEvent(imgOver)
addLoadEvent(favoritesHighlight)
addLoadEvent(favoritesCheck)
addLoadEvent(favoritesView)
//addLoadEvent(mouseEventFalse)

