function Attach() { var ID_Code = (new Date()).getTime().toString() ; var protoID = 'OBJECT_'+ID_Code ; var attributeset = {classid:'', codebase:'', type:'', pluginpage:'', align:'', width:400, height:300, style:''} ; var parameterset = {} ; var browser = {info:navigator.userAgent.toLowerCase()} ; browser.msie = browser.info.indexOf('msie') == -1 ? false : true ; browser.msie6 = browser.info.indexOf('msie 6') == -1 ? false : true ; browser.msie7 = browser.info.indexOf('msie 7') == -1 ? false : true ; browser.msie8 = browser.info.indexOf('msie 8') == -1 ? false : true ; browser.firefox = browser.info.indexOf('firefox') == -1 ? false : true ; browser.opera = browser.info.indexOf('opera') == -1 ? false : true ; browser.safari = browser.info.indexOf('safari') == -1 ? false : true ; browser.chrome = browser.info.indexOf('chrome') == -1 ? false : true ; function getMarkup() { var pn ; var pr = arguments[1] ; var attrs = {align:attributeset.align, width:attributeset.width, height:attributeset.height, style:attributeset.style} ; var params = parameterset ; var htmlObject ; var htmlId = arguments[0] ; for (pn in pr) { if (attrs[pn] || attrs[pn] == '') attrs[pn] = pr[pn] ; else params[pn] = pr[pn] ; } if (browser.msie) { htmlObject = '<object id="'+htmlId+'" name="'+htmlId+'" classid="'+attributeset.classid+'" codebase="'+attributeset.codebase+'" width="'+attrs.width+'" height="'+attrs.height+'" align="'+attrs.align+'" style="'+attrs.style+'" >' ; for (pn in params) htmlObject += '<param name="'+pn+'" value="'+params[pn]+'" />' ; htmlObject += '</object >' ; } else { htmlObject = '<embed id="'+htmlId+'" name="'+htmlId+'" pluginpage="'+attributeset.pluginpage+'" type="'+attributeset.type+'" width="'+attrs.width+'" height="'+attrs.height+'" align="'+attrs.align+'" style="'+attrs.style+'" ' ; for (pn in params) htmlObject += pn+'="'+params[pn]+'" ' ; htmlObject += '></embed >' ; } return htmlObject ; } function getHtmlId() { var tag = browser.msie ? 'object' : 'embed' ; return protoID+'_'+document.getElementsByTagName(tag).length ; } function printIt() { var obj ; var htmlId ; var p = typeof(arguments[0]) == 'object' ? arguments[0] : {} ; htmlId = getHtmlId() ; document.write(getMarkup(htmlId, p)) ; obj = document.getElementById(htmlId) ; if (obj) return obj ; } function printTo() { var obj ; var htmlId ; var tag = browser.msie ? 'object' : 'embed' ; var target = document.getElementById(arguments[0].toString()) ; var p = typeof(arguments[1]) == 'object' ? arguments[1] : {} ; if (target != null) { htmlId = getHtmlId() ; target.innerHTML += getMarkup(htmlId, p) ; obj = document.getElementById(htmlId) ; if (obj) return obj ; } } function attachTo() { var obj ; var htmlId ; var tag = browser.msie ? 'object' : 'embed' ; var container = document.createElement('div') ; var target = document.getElementById(arguments[0].toString()) ; var p = typeof(arguments[1]) == 'object' ? arguments[1] : {} ; if (target != null) { htmlId = getHtmlId() ; container.innerHTML = getMarkup(htmlId, p) ; target.appendChild(container.firstChild) ; obj = document.getElementById(htmlId) ; if (obj) return obj ; } } this.set = { id:function() {if (typeof(arguments[0]) == 'string' && arguments[0] != '') protoID = arguments[0]+'_'+ID_Code;}, attribute:function() { var pn ; var pr = typeof(arguments[0]) == 'object' ? arguments[0] : {} ; for (pn in pr) { if (attributeset[pn] || attributeset[pn] == '') attributeset[pn] = pr[pn] ; else parameterset[pn] = pr[pn] ; } } } ; this.write = printIt ; this.writeTo = printTo ; this.appendTo = attachTo ; } var Flash = new Attach() ; Flash.set.id('FLASH') ; Flash.set.attribute({ classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000', codebase:'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', type:'application/x-shockwave-flash', pluginpage:'http://www.macromedia.com/go/getflashplayer', align:'', menu:false, quality:'high', play:true, loop:true, scale:'showall', wmode:'window', devicefont:false, bgcolor:'#ffffff', allowFullScreen:false, allowScriptAccess:'sameDomain', salign:'' }) ;

// LNB¸Þ´º º¸¿©ÁÖ´Â ÇÔ¼ö
var LNB = {} ;
LNB.container = null ;
LNB.levels1Li = [] ;
LNB.levels1A = [] ;
LNB.levels2Li = [] ;
LNB.levels2A = [] ;
LNB.levels3Li = [] ;
LNB.levels3A = [] ;
LNB.init = function() {
	var i ;
	var lis ;
	var as ;
	this.container = document.getElementById("levels") ;
	lis = this.container.getElementsByTagName("li") ;
	as = this.container.getElementsByTagName("a") ;
	for (i = 0; i < Math.max(lis.length, as.length); i++) {
		if (i < lis.length) {
			if (lis[i].className.indexOf("level1") >= 0) LNB.levels1Li.push(lis[i]) ;
			else if (lis[i].className.indexOf("level2") >= 0) LNB.levels2Li.push(lis[i]) ;
			else LNB.levels3Li.push(lis[i]) ;
		}
		/*
		if (i < as.length) {
			if (as[i].className.indexOf("level1") >= 0) as[i].onclick = function() {LNB.level1(this)} ;
			else if (as[i].className.indexOf("level2") >= 0) as[i].onclick = function() {LNB.level2(this)} ;
			else as[i].onclick = function() {LNB.level3(this)} ;
			as[i].href = "javascript:;" ;
		}
		*/
	}
}
LNB.clearChild = function(lis, cls) {
	var i ;
	for (i = 0; i < lis.length; i++) {
		lis[i].className = cls ;
		ImgSrcSwap(lis[i].getElementsByTagName('a')[0].getElementsByTagName('img')[0]) ;
	}
}
LNB.level1 = function(el) {
	this.displaySub(el, this.levels1Li, "level1") ;
}
LNB.level2 = function(el) {
	this.displaySub(el, this.levels2Li, "level2") ;
}
LNB.level3 = function(el) {
	var pi = el.parentNode ;
	this.clearChild(this.levels3Li, "") ;
	pi.className = "selected" ;
}
LNB.displaySub = function(el, lis, clsn) {
	var pi = el.parentNode ;
	var cls = el.className.split(" ") ;
	if (!this.container) this.init() ;
	if (lis.length > 0) {
		this.clearChild(lis, clsn) ;
		if (cls.length == 1) pi.className += " "+cls ;
		else pi.className += " "+cls[1] ;
		ImgSrcSwap(el.getElementsByTagName('img')[0], "on") ;
	}
}
/*
window.onload = function() {
	LNB.init() ;
}
*/

// Initializing image rollover
function initRollOver(el) {
	el.onmouseover = function() {
		ImgSrcSwap(el, "on") ;
	}
	el.onmouseout = function() {
		ImgSrcSwap(el) ;
	}
}

function ImgSrcSwap(el, st) {
	var newsrc ;
	var t_off = "_off" ;
	var t_on = "_on" ;
	var exe = getExe(el.src) ;
	if (st == "on") newsrc = el.src.replace(t_off+exe, t_on+exe) ;
	else newsrc = el.src.replace(t_on+exe, t_off+exe) ;
	el.src = newsrc ;
}

// Get extension
function getExe(e) {
	return e.substring(e.lastIndexOf("."), e.length) ;
}

