
/*ActiveX flash*/
// id: flash id
// url: source url
// w: source width
// h: source height

function Flash(id,id2,url,w,h,bg,t){
document.writeln("<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+">");
document.writeln("<param name='movie' value="+url+" />");
document.writeln("<param name='wmode' value="+t+" />");
document.writeln("<param name='bgcolor' value="+bg+" />");
document.writeln("<param name='allowScriptAccess' value='always' />");
document.writeln("<param name='quality' value='high' />");
document.writeln("<param name='menu' value='false' />");
document.writeln("<embed id="+id2+" src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.writeln("</object>");
}
function Flash2(id,id2,url,w,h,bg,t){
document.writeln("<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=1160px height="+h+" id="+id+">");
document.writeln("<param name='movie' value="+url+" />");
document.writeln("<param name='wmode' value="+t+" />");
document.writeln("<param name='bgcolor' value="+bg+" />");
document.writeln("<param name='allowScriptAccess' value='always' />");
document.writeln("<param name='quality' value='high' />");
document.writeln("<param name='menu' value='false' />");
document.writeln("<embed id="+id2+" src="+url+" wmode="+t+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.writeln("</object>");
}

function LNB_flash(){
  var menu3 = GLOBAL_MENU3;
	document.write("<div id='GNB_iframe' style='position:absolute;left:0px;top:0px;z-index:11;width:995px;height:100%;display:none;'><iframe id='GNB_iframe' src='' frameborder='1' style='width:100%;height:100%;filter:Alpha(Opacity=0)'></iframe></div>");
	//---  
	if(menu3.indexOf("-") > 0){
		menu3 = menu3.split("-");
		menu3 = menu3[0];
	}
	var fullPath = "swf/left_menu1.swf?url_path=menu_kor.xml&menu1="+GLOBAL_MENU1+"&menu2="+GLOBAL_MENU2+"&menu3="+menu3;
	Flash('LNB','LNB2',fullPath,'170','500','#ffffff','transparent');
}

function GNB_change(check){
	if(check=="1"){
		document.getElementById("GNB").style.height="500";
		document.getElementById("GNB_iframe").style.display="block";
	}else{
		document.getElementById("GNB").style.height="92";
		document.getElementById("GNB_iframe").style.display="none";
	}
}

function AjaxMenuControl(){
	this.xmlHttp			= null;
	this.xmlData2 = null;
	
	this.getHttpRequest		= function(URL){
		var xmlHttp		= this.xmlHttp;
		var xmlData		= null;


		if(!xmlHttp){
			if(window.XMLHttpRequest) { 
				xmlHttp	= new XMLHttpRequest();
			} else { 
				xmlHttp	= new ActiveXObject("Microsoft.XMLHTTP"); 
			} 
			this.xmlHttp	= xmlHttp;
		}

		xmlHttp.open('GET', URL, true); 
		xmlHttp.onreadystatechange = function() { 

			if(xmlHttp.readyState==4 && xmlHttp.status == 200 && xmlHttp.statusText=='OK') {
				xmlData		= xmlHttp.responseXML.documentElement;

				var menuString = "<p>Ȩ";
			  
			  var menu3 = GLOBAL_MENU3;
			  
				if(menu3.indexOf("-") > 0){
					menu3 = menu3.split("-");
					menu3 = menu3[0];
				}	
	
				try{				
					var name1 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].getAttribute("name");
					var url1 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].getAttribute("url");
			
					var name2 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].childNodes[GLOBAL_MENU2-1].getAttribute("name");
					var url2 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].childNodes[GLOBAL_MENU2-1].getAttribute("url");
				  if(menu3 != "0"){			
						var name3 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].childNodes[GLOBAL_MENU2-1].childNodes[menu3-1].getAttribute("name");
						var url3 = xmlData.getElementsByTagName(GLOBAL_MENU1)[0].childNodes[GLOBAL_MENU2-1].childNodes[menu3-1].getAttribute("url");
					}
					
					if (name1 != null && name1 != "") menuString += (url1 == null || url1 == "")?" &gt; "+name1:" &gt; "+name1;
					if (name2 != null && name2 != "") menuString += (url2 == null || url2 == "")?" &gt; "+name2:" &gt; "+name2;
				  if(menu3 != "0"){
						if (name3 != null && name3 != "" && name2 != name3 ) menuString += (url3 == null || url3 == "")?" &gt; <span>"+name3+"</span>":" &gt; <span>"+name3+"</span>";
					}
					menuString += "</p>";
					document.all.topNavi.innerHTML = menuString;
	
				}catch (e) {
					document.all.topNavi.innerHTML = "<p>Ȩ</p>";
				}				
			} 
		} 
		xmlHttp.send('');
	}
}

function getCookieCheck(Name) { 
    var search = Name + "=" 
    if (document.cookie.length > 0) { 
        offset = document.cookie.indexOf(search) 
        if (offset != -1) { 
            offset += search.length 
            end = document.cookie.indexOf(";", offset) 
            if (end == -1) 
                end = document.cookie.length 
            return unescape(document.cookie.substring(offset, end)); 
        } else {
        	return "";	
        }
    } else {
    	return "";	
    }
} 