//»õ À©µµ¿ìÃ¢ ¶ç¿ì±â
function open_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 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_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_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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


// Æ÷Åä´º½º ÅÇ
function DisplayMenu(index) {
		for (i=1; i<=2; i++)
		if (index == i) {
		thisMenu = eval("menu" + index + ".style");
		thisMenu.display = "";
		} 
		else {
		otherMenu = eval("menu" + i + ".style"); 
		otherMenu.display = "none"; 
		}
		}




//¸ÞÀÎ¸Þ´º : 4.0¹öÀü¿ë [start]===========================================================================
var prevLayer_mmenu = new Array();
prevLayer_mmenu[0] = "subMenu_01";
prevLayer_mmenu[1] = "subMenu_02";
prevLayer_mmenu[2] = "subMenu_03";
prevLayer_mmenu[3] = "subMenu_04";
prevLayer_mmenu[4] = "subMenu_05";
prevLayer_mmenu[5] = "subMenu_06";
prevLayer_mmenu[6] = "subMenu_07";
prevLayer_mmenu[7] = "subMenu_08";

var prevImg_mmenu  = new Array();
prevImg_mmenu[0]  = "btn_mainMenu_01";
prevImg_mmenu[1]  = "btn_mainMenu_02";
prevImg_mmenu[2]  = "btn_mainMenu_03";
prevImg_mmenu[3]  = "btn_mainMenu_04";
prevImg_mmenu[4]  = "btn_mainMenu_05";
prevImg_mmenu[5]  = "btn_mainMenu_06";
prevImg_mmenu[6]  = "btn_mainMenu_07";
prevImg_mmenu[7]  = "btn_mainMenu_08";

function viewLayer_mmenu(nowLayer,no)
{
document.all[prevLayer_mmenu[no]].style.display = "none";
document.all[nowLayer].style.display = "";
prevLayer_mmenu[no] = nowLayer;
}

function changeImg_mmenu(nowImg,no)
{
if ( nowImg != prevImg_mmenu[no])
{
prevImgSrc = document.all[prevImg_mmenu[no]].src.replace("ov.gif",".gif");
nowImgSrc = document.all[nowImg].src.replace(".gif",".gif");

document.all[prevImg_mmenu[no]].src = prevImgSrc.replace(".gif",".gif");
document.all[nowImg].src = nowImgSrc.replace(".gif","ov.gif");
prevImg_mmenu[no] = nowImg;
}
}
//¸ÞÀÎ¸Þ´º : 4.0¹öÀü¿ë [end]===========================================================================



//Ä®·³.»ç¼³ [start]===========================================================================
function changeTab01(tabName) {
if (tabName == 'tab_saseol') {
tab_column.style.display = '';
tab_saseol.style.display = 'none';
document.all.column.src = "img/hn4_tab_column_ov.gif";
document.all.saseol.src = "img/hn4_tab_saseol.gif";
} else {
tab_saseol.style.display = '';
tab_column.style.display = 'none';
document.all.column.src = "img/hn4_tab_column.gif";
document.all.saseol.src = "img/hn4_tab_saseol_ov.gif";
}
}
//Ä®·³.»ç¼³ [end]===========================================================================



//Æ÷Åä.µ¿¿µ»ó ´º½º [start]===========================================================================
function changeTab02(tabName) {
if (tabName == 'tab_tvnews') {
tab_photonews.style.display = '';
tab_tvnews.style.display = 'none';
document.all.photonews.src = "img/hn4_tab_photonews_ov.gif";
document.all.tvnews.src = "img/hn4_tab_tvnews.gif";
} else {
tab_tvnews.style.display = '';
tab_photonews.style.display = 'none';
document.all.photonews.src = "img/hn4_tab_photonews.gif";
document.all.tvnews.src = "img/hn4_tab_tvnews_ov.gif";
}
}
//Æ÷Åä.µ¿¿µ»ó ´º½º [end]===========================================================================



//¸ÀÁý.¿©Çà.À¯¸Ó [start]===========================================================================
var prevLayer_01 = new Array();
prevLayer_01[0] = "tabMenu_01_01";

var prevImg_01  = new Array();
prevImg_01[0]  = "btn_tabMenu_01_01";

function viewLayer_01(nowLayer,no)
{
document.all[prevLayer_01[no]].style.display = "none";
document.all[nowLayer].style.display = "";
prevLayer_01[no] = nowLayer;
}

function changeImg_01(nowImg,no)
{
if ( nowImg != prevImg_01[no])
{
prevImgSrc = document.all[prevImg_01[no]].src.replace("_ov.gif",".gif");
nowImgSrc = document.all[nowImg].src.replace(".gif",".gif");

document.all[prevImg_01[no]].src = prevImgSrc.replace(".gif",".gif");
document.all[nowImg].src = nowImgSrc.replace(".gif","_ov.gif");
prevImg_01[no] = nowImg;
}
}
//¸ÀÁý.¿©Çà.À¯¸Ó [end]===========================================================================



//¸ÞÀÎ´º½ºÅÇ [ÃÖ½Å±â»ç / Á¤Ä¡ / °æÁ¦ / »çÈ¸ / IT.°úÇÐ] [start]======================================
var prevLayer_02 = new Array();
prevLayer_02[0] = "tabnews_01";

var prevImg_02  = new Array();
prevImg_02[0]  = "btn_tabMenu_02_01";

function viewLayer_02(nowLayer,no)
{
document.all[prevLayer_02[no]].style.display = "none";
document.all[nowLayer].style.display = "";
prevLayer_02[no] = nowLayer;
}

function changeImg_02(nowImg,no)
{
if ( nowImg != prevImg_02[no])
{
prevImgSrc = document.all[prevImg_02[no]].src.replace("_ov.gif",".gif");
nowImgSrc = document.all[nowImg].src.replace(".gif",".gif");

document.all[prevImg_02[no]].src = prevImgSrc.replace(".gif",".gif");
document.all[nowImg].src = nowImgSrc.replace(".gif","_ov.gif");
prevImg_02[no] = nowImg;
}
}
//¸ÞÀÎ´º½ºÅÇ [ÃÖ½Å±â»ç / Á¤Ä¡ / °æÁ¦ / »çÈ¸ / IT.°úÇÐ] [end]======================================



//°¡Àå ¸¹ÀÌ º» ´º½º [¼½¼ÇÁ¾ÇÕ / »çÈ¸ / ¿¬¿¹] [start]======================================
var prevLayer_03 = new Array();
prevLayer_03[0] = "tabMenu_03_01";

var prevImg_03  = new Array();
prevImg_03[0]  = "btn_tabMenu_03_01";

function viewLayer_03(nowLayer,no)
{
document.all[prevLayer_03[no]].style.display = "none";
document.all[nowLayer].style.display = "";
prevLayer_03[no] = nowLayer;
}

function changeImg_03(nowImg,no)
{
if ( nowImg != prevImg_03[no])
{
prevImgSrc = document.all[prevImg_03[no]].src.replace("_ov.gif",".gif");
nowImgSrc = document.all[nowImg].src.replace(".gif",".gif");

document.all[prevImg_03[no]].src = prevImgSrc.replace(".gif",".gif");
document.all[nowImg].src = nowImgSrc.replace(".gif","_ov.gif");
prevImg_03[no] = nowImg;
}
}
//°¡Àå ¸¹ÀÌ º» ´º½º [¼½¼ÇÁ¾ÇÕ / »çÈ¸ / ¿¬¿¹] [end]======================================



//IE6¿¡¼­ PNGÆÄÀÏ »ç¿ëÇÏ±â
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 '';
}


//Å©±â ÀçÇÑ¾ø´Â ÇÃ·¡½Ã ÀÌ¿Ã¶ó½º
function FlashMainbody(Ftrans,wid,hei) {
	mainbody = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+ wid +"' height='"+ hei +"'>";
	mainbody += "<param name='movie' value='"+ Ftrans +"'>";
	mainbody += "<param name='quality' value='high'>";
	mainbody += "<param name='menu' value='false'>";
	mainbody += "<param name='scale' value='scale'>";
	mainbody += "<param name='wmode' value='transparent'>";
	mainbody += "<param name='salign' value='lt' />";
	mainbody += "<embed src='"+ Ftrans +"' quality='high' align='middle' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ wid +"' height='"+ hei +"'></embed>"
	mainbody += "</object>";

	//document.body.innerHTML = mainbody;
	document.write(mainbody);
	return;
}

//ÃßÃâ¹æ¹ý
//<SCRIPT LANGUAGE="JavaScript">FlashMainbody("img/banner.swf","680","140",'Transparent');</SCRIPT>



//¸µÅ©Á¡¼±
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;



//·¹ÀÌ¾îÅøÆÁ °ü·Ã [start]  /////////////////////////////////////////////
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}


function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip
//·¹ÀÌ¾îÅøÆÁ °ü·Ã [end]  /////////////////////////////////////////////






function addLoadEvent( func )
{
    var oldonload = window.onload;
    if ( typeof window.onload != 'function' )
    {
        window.onload = func;
    }
    else
    {
        window.onload = function() {
            oldonload();
            func();
        }
    }
} 



// INCN Adding

function SetContents(str)
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	// Set the editor contents (replace the actual one).
	oEditor.InsertHtml( str ) ;
}

function GetContents()
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	return oEditor.GetXHTML( true );

}

function InsertTXTIMG(url,desc,align,width){
	var oEditor = FCKeditorAPI.GetInstance('comment') ;
	var str = "<table align='"+align+"' width=30 height=0 border=0 cellspacing=0 cellpadding=0>"
	str += "<tr><td><img src='" + url + "'";
	if(width!="") str += " width='"+width+"'";
	str += "></td></tr>";
	str += "<tr><td style='word-break:break-all;padding-top:5px;color:#3D5681;'>"+desc+"</td></tr>";
	str += "</table>";
	InsertHTML(str);
}


function InsertIMG(url,align){
	var oEditor = FCKeditorAPI.GetInstance('comment') ;
	var str = "<img src='" + url + "' align='" + align + "'>";
	InsertHTML(str);
}



function InsertHTML(str)
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	// Check the active editing mode.
	if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
	{
		// Insert the desired HTML.
		oEditor.InsertHtml( str ) ;
	}
	else
		alert( 'You must be on WYSIWYG mode!' ) ;
}


function ExecuteCommand( commandName )
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	// Execute the command.
	oEditor.Commands.GetCommand( commandName ).Execute() ;
}


function GetInnerHTML()
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	alert( oEditor.EditorDocument.body.innerHTML ) ;
}


function SetContents()
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	// Set the editor contents (replace the actual one).
	oEditor.SetData( 'This is the <b>new content<\/b> I want in the editor.' ) ;
}

function GetContents()
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance('comment') ;

	// Get the editor contents in XHTML.
	alert( oEditor.GetXHTML( true ) ) ;		// "true" means you want it formatted.
}