function CHIMG(obj){
   var str = obj.src;               
   if(str.indexOf('_on.gif') < 0){         
    ss = str.substr(0, str.indexOf('.gif'))      
    obj.src = ss + "_on.gif";                         
   }else{                                      
    ss = str.substr(0, str.indexOf('_on.gif'))
    obj.src = ss + ".gif";
   }
  }


function FlashObject(swf, width, height, bgcolor, id, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}

function showflashes(_file_, _width_, _height_)
{
	var _object_ = "";
	_object_ += '<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="'+ _width_ +'" height="'+ _height_ +'">';
	_object_ += '<param name="movie" value="'+ _file_ +'">';
	_object_ += '<param name="quality" value="high">';
	_object_ += '<param name="play" value="true">';
    _object_ += '<param name="loop" value="true">';
    _object_ += '<param name="wmode" value="transparent">';
	_object_ += '<embed src="'+ _file_ +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ _width_ +'" height="'+ _height_ +'"></embed>';
	_object_ += '</object>';

	document.write(_object_);
}

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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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.01
  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 && d.getElementById) x=d.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];}
}


//menu on off===========================================================================================================
var over=1;
var overtd;
function overMouse(obj,obj2)
{

 obj3 = eval("document.all.l"+obj2);

 if (over)
 {
  temp = eval("document.all.l"+over);
  temp.style.display = "none";
 }

 over = obj2;
 overtd = obj;
 
 obj3.style.display = "block";
}
function outMouse()
{
 document.all.l1.style.display = "none";
 document.all.l2.style.display = "none";
 document.all.l3.style.display = "none";

}
//¿ì¸®¸» °í¿î¸» ÇØ´äº¸±â
function openAnswer() {
	window.open('/Readers/article/word/pop_answer.html','answer', 'scrollbars=no,resizable=no,copyhistory=no,width=450,height=700');
}


//¿µÇÑ´ë¿ª ¹æ¹ý ÆË¾÷
function openCdtomp3() {
	window.open('/Readers/article/contents/pop_cdmp3.html','mp3', 'scrollbars=no,resizable=no,copyhistory=no,width=450,height=695');
}



function changeSITE(site) {
	var sitevalue = site.options[site.selectedIndex].value;
	
	if(site.selectedIndex!=0 && sitevalue!="" && sitevalue.indexOf("javascript")==-1)
		window.open(site.options[site.selectedIndex].value,"","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
}


// °Ë»ö ¹öÆ° ¼öÇà
goSearchU = function() {

	var form = document.searchForm;
	var sText = "";
	sText = form.searchText.value;
	
	if( "" == sText ) {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return;
	}
	
	form.searchText.value = sText;

	// ¾×¼Ç ¹æÇâÀ» Á¤ÇÑ´Ù.
	var targetPage = getTargetPage(form.searchCategory.value) + "list.htm";
	
	form.action = targetPage;
	form.submit();
}

goSearch = function( val1, val2, val3, val4, val5 ) {
	var form = document.searchForm;
	
	if( val1 == "U" ) {
		form.searchCategory.value = "A";
		form.searchText.value = val2;
		form.gs.value = val5;
		form.masterno.value = val3;
		form.contentno.value = val4;
	} else if( val1 == "E" ) {
		form.searchCategory.value = val1;
		form.searchText.value = val2;
		form.id.value = val3;
	} else if( val1 == "K" ) {
		form.searchCategory.value = val1;
		form.searchText.value = val2;
		form.id.value = val3;
	} else if( val1 == "I" ) {
		form.searchCategory.value = val1;
		form.searchText.value = val2;
	} else {
	
	}	
		
	// ¾×¼Ç ¹æÇâÀ» Á¤ÇÑ´Ù.
	var targetPage = getTargetPage(form.searchCategory.value) + "list.htm";
	
	form.action = targetPage;
	form.submit();
}


// »ó¼¼ Á¤º¸·Î ÀÌµ¿ÇÑ´Ù.
goDetail = function( val1, val2, val3, val4, val5 ) {
	var form = document.searchForm;
	
	if( val1 == "U" ) {
		form.searchCategory.value = "A";
		form.searchText.value = val2;
		form.gs.value = val5;
		form.masterno.value = val3;
		form.contentno.value = val4;
	} else if( val1 == "E" ) {
		form.searchCategory.value = val1;
		form.searchText.value = val2;
		form.id.value = val3;
	} else if( val1 == "K" ) {
		form.searchCategory.value = val1;
		form.searchText.value = val2;
		form.id.value = val3;
	} else if( val1 == "I" ) {
		goSearch( val1, val2, val3, val4, val5 );
		return;
	} else {	
	}	
	
	if( val1 == "U" ) val1 = "A";	
	var targetPage = getTargetPage( val1 ) + "detail.htm";
	
	form.action = targetPage;
	form.submit();
}

// ÄÁÅÙÃ÷ »ó¼¼
goContentDetail = function( pseq, acode, lcode ) {

	var form = document.tempForm;
	form.areaCode.value = acode;
	form.langCode.value = lcode;
	form.productType.value = "area";
	form.product_seq.value = pseq;
	
	form.action = "/portfolio/content_detail.htm";
	form.submit();
}

// Å¸°Ù ÆäÀÌÁö¸¦ ¾ò´Â´Ù.
getTargetPage = function(typex) {
	var targetPage = "";

	if( "U" == typex ) {
		targetPage = "_all_";
	} else if( "C" == typex ) {
		targetPage = "_all_contents_";
	} else if( "A" == typex ) {
		targetPage = "_dic_";
	} else if( "E" == typex ) {
		targetPage = "_english_";
	} else if( "K" == typex ) {
		targetPage = "_korean_";
	} else if( "I" == typex ) {
		targetPage = "_image_";
	}
	
	var realTargetPage = "/search/search"+targetPage;
	
	return realTargetPage;
}