// Latest News Button Display
	function _DISPLAY(id) {
		var max = 5;

		for (var i = 1; i <= max; i++) {
			var obj = document.getElementById("display_" + i);
			var img = document.getElementById("tab" + i);

			if (i == id) {
				obj.style.display = "";
				img.src = "/modules/home/images/btn_latest_num0" + i + "a.gif";
			} else {
				obj.style.display = "none";
				img.src = "/modules/home/images/btn_latest_num0" + i + ".gif";
			}
		}
	}

function Link(num){ 
	switch (num)
	{
		// sub01 company(001)
		case 11: document.location.href="/company/overview.html";//01
		break;
		case 12: document.location.href="/company/greeting.html";//02
		break;
		case 13: document.location.href="/company/organization.html";//03
		break;
		case 14: document.location.href="/company/newsdata.html";//04
		break;

		// sub02 broadcast(002)
		case 21: document.location.href="/broadcast/culture.html";//01
		break;
		case 22: document.location.href="/broadcast/documentary.html";//02
		break;
		case 23: document.location.href="/broadcast/variety.html";//03
		break;
		case 24: document.location.href="/broadcast/news.html";//04
		break;
		case 25: document.location.href="/broadcast/entertainment.html";//05
		break;

		// sub03 ad(003)
		case 31: document.location.href="/ad/publicity.html";//01
		break;
		case 32: document.location.href="/ad/campaign.html";//02
		break;
		case 33: document.location.href="/ad/cf.html";//03
		break;
	}
};


// Flash Writer
	function flashWrite(url,w,h,id,bg,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='movie' value='"+url+"' />"+
	 "<param name='wmode' value='"+win+"' />"+
	 "<param name='menu' value='false' />"+
	 "<param name='quality' value='high' />"+
	 "<param name='bgcolor' value='"+bg+"' />"+
	 "<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	 "</object>";
	 document.write(flashStr);
	};

// Persistent Menu
	var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
	var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
	var cookievalue="";

	if (document.getElementById){ //DynamicDrive.com change
	document.write('<style type="text/css">\n')
	document.write('.submenu{display: none;}\n')
	document.write('</style>\n')
	}

	function SwitchMenu(obj){
		if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
			if(el.style.display != "block"){ 
				for (var i=0; i<ar.length; i++){
					if (ar[i].className=="submenu") 
					ar[i].style.display = "none";
				}
				el.style.display = "block";
				blockid = el.id;
			}else{
				el.style.display = "none";
				blockid = "";
			}
			var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname;
			var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
			document.cookie=cookiename+"="+cookievalue;
		}
	}

	function get_cookie(Name) { 
	var search = Name + "="
	var returnvalue = "";
	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;
	returnvalue=unescape(document.cookie.substring(offset, end))
	}
	}
	return returnvalue;
	}

	function onloadfunction(){
		if (persistmenu=="yes"){
			var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname;
			var cookievalue=get_cookie(cookiename);
			if (cookievalue!=""){
				document.getElementById(cookievalue).style.display="block"
			}
		}
	}

	function savemenustate(){
		
	}

	if (window.addEventListener)
	window.addEventListener("load", onloadfunction, false)
	else if (window.attachEvent)
	window.attachEvent("onload", onloadfunction)
	else if (document.getElementById)
	window.onload=onloadfunction