function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<param name=\"wmode\" value=\"transparent\">');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function new_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{ 
  toolbar_str = toolbar ? 'yes' : 'no'; 
  menubar_str = menubar ? 'yes' : 'no'; 
  statusbar_str = statusbar ? 'yes' : 'no'; 
  scrollbar_str = scrollbar ? 'yes' : 'no'; 
  resizable_str = resizable ? 'yes' : 'no'; 
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); 
} 

function resizeHeight(fr) {
                fr.setExpression('height',aaa.document.body.scrollHeight);
                fr.setExpression('width',aaa.document.body.scrollWidth);
}

function error(text){
window.alert(text);
history.go(-1);
}

function startCateScrollScroll() { 
	setTimeout("slideCateScroll()", 10); 
} 

function slideCateScroll() { 
	var Sel_Height=110; //¼¿·ºÆ® ¹Ú½ºÀÇ ¼¼·Î Å©±â ÁöÁ¤ 
	el = document.getElementById("cate_scroll-list"); 
	if (el.heightPos == null || (el.isDone && el.isOn == false)) { 
		el.isDone = false; 
		el.heightPos = 1; 
		el.heightTo = Sel_Height; 
	} else if (el.isDone && el.isOn){ 
		el.isDone = false; 
		el.heightTo = 0; //¼¿·ºÆ® ¿µ¿ªÀÌ ´ÝÈú¶§ Å©±â ÁöÁ¤ 
	} 

	if (Math.abs(el.heightTo - el.heightPos) > 1) { 
		el.heightPos += (el.heightTo - el.heightPos) / 10; 
		el.style.height = el.heightPos + "px"; 
		startCateScrollScroll(); 
	} else { 
		if (el.heightTo == Sel_Height) { 
			el.isOn = true; 
		} else { 
			el.isOn = false; 
		} 
		el.heightPos = el.heightTo; 
		el.style.height = el.heightPos + "px"; 
		el.isDone = true; 
		} 
}


var stmnLEFT = 911; // ¿ÞÂÊ ¿©¹é
var stmnGAP1 = 200; // À§ÂÊ ¿©¹é
var stmnGAP2 = 400; // ½ºÅ©·Ñ½Ã ¶³¾îÁö´Â °Å¸®
var stmnBASE = 400; //½ÃÀÛÀ§Ä¡ 
var stmnActivateSpeed = 200; //³»·Á¿À´Â¼Óµµ
var stmnScrollSpeed = 5; //½ºÅ©·Ñ¼Óµµ

var stmnTimer;

function ReadCookie(name)
{
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
		var j = i + labelLen;

		if (document.cookie.substring(i, j) == label) {
				var cEnd = document.cookie.indexOf(";", j);
				if (cEnd == -1) cEnd = document.cookie.length;

				return unescape(document.cookie.substring(j, cEnd));
		}

		i++;
}

return "";
}

function SaveCookie(name, value, expire)
{
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function RefreshStaticMenu()
{
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(STATICMENU.style.top, 0);
stmnEndPoint = document.body.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 25 );
		STATICMENU.style.top = parseInt(STATICMENU.style.top, 0) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
}

stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function ToggleAnimate()
{
if (ANIMATE.checked) {
		RefreshStaticMenu();
		SaveCookie("ANIMATE", "true", 300);
}
else {
		clearTimeout(stmnTimer);
		STATICMENU.style.top = stmnGAP1;
		SaveCookie("ANIMATE", "false", 300);
}
}

function InitializeStaticMenu()
{
STATICMENU.style.left = stmnLEFT;

	 
		RefreshStaticMenu();
		SaveCookie("ANIMATE", "true", 300);

}


function ShowFlash(sfilename, iwidth, iheight,oneDepth) //ÆÄÀÏ¸í, Æø, ³ôÀÌ, depth
{ 
var _showflash = ''; 

_showflash = '<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0 width='+ iwidth +' height='+ iheight +'>';
_showflash = _showflash + '<param name=movie value='+ sfilename +'?curOpen='+oneDepth+'>'; 
_showflash = _showflash + '<param name=allowScriptAccess value=always>'; 
_showflash = _showflash + '<param name=wmode value=transparent>'; 
_showflash = _showflash + '<param name=quality value=high>'; 
_showflash = _showflash + '<embed src='+ sfilename +' quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash allowscriptaccess=always swliveconnect=true width=237 height=476></embed></object>'; 

document.write(_showflash); 
}

function sizeOn(){
 document.getElementById('mbcmenu').style.height = "290px";
}
function sizeOff(){
 document.getElementById('mbcmenu').style.height = "65px";
}



isec10 = "/img/2010img/centernews_on.gif";
isec11 = "/img/2010img/centernews_off.gif";
isec20 = "/img/2010img/centernotice_on.gif";
isec21 = "/img/2010img/centernotice_off.gif";
//isec30 = "/img/mbcimg/tab_on_03.gif";
//isec31 = "/img/mbcimg/tab_03.gif";

function ShowSection( sec_id )
{
	if( sec_id == "sec1") {
		sec1.style.display = "";
		sec2.style.display = "none";
//		sec3.style.display = "none";
		document.sec1image.src = isec10;
		document.sec2image.src = isec21;
//		document.sec3image.src = isec31;
	}
	if( sec_id == "sec2") {
		sec1.style.display = "none";
		sec2.style.display = "";
//		sec3.style.display = "none";
		document.sec1image.src = isec11;
		document.sec2image.src = isec20;
//		document.sec3image.src = isec31;
	}
//	if( sec_id == "sec3") {
//		sec1.style.display = "none";
//		sec2.style.display = "none";
//		sec3.style.display = "";
//		document.sec1image.src = isec11;
//		document.sec2image.src = isec21;
//		document.sec3image.src = isec30;
//	}
}

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 ''; 
} 
