/* adnstyle(http://www.adnstyle.com/) web-pubilishing team_author :  ÃÖÀº¿Á 200910 */
function show_event() {
	var top_x = document.body.clientWidth;
  if (top_x > 1028) {
  	document.getElementById("header").className="header1";
  	document.getElementById("footer").className="footer1";
  	document.getElementById("wrapper").style.width="100"+"%";
  	document.getElementById("line_top").style.width="100"+"%";
	//document.getElementById("header").style.display = 'block';
  }
  else  {
  	document.getElementById("header").className="header2"
  	document.getElementById("footer").className="footer2"
  	document.getElementById("wrapper").style.width="1028"+"px";
  	document.getElementById("line_top").style.width="1028"+"px";
	//document.getElementById("header").style.display = 'block';
  	}
 //new Floating(document.getElementById("top"),985,187,20,10); 
}
 
 //Menu
 function MenuDown(n){   
   for (var i=1;i<7;i++)  {
	  document.getElementById('menuT'+i).className = "menu_pl";
	  //document.getElementById('menuT'+i).setAttribute("className", "menu_pl");
   }

   
   for (var i=1;i<7;i++)  {
	var ul = document.getElementById('menu_sub'+i);
    var lay = document.getElementById('ico_m'+i);
    if (n==i) {  
	   if (ul.style.display=="block") {
	     lay.src="/mod/images/comm/ico_plus.gif";
		 ul.style.display = "none";  
	   }else{
		 lay.src="/mod/images/comm/ico_minus.gif";
		 ul.style.display = "block";
		 document.getElementById('menuT'+i).className = "menu_pl_on";
	   }      
      
     }else {
      lay.src="/mod/images/comm/ico_plus.gif";
      ul.style.display = "none";
	  document.getElementById('menuT'+i).className = "menu_pl";

	  document.getElementById('menuT'+i).setAttribute("className", "menu_pl");

     }  
	 //alert(document.getElementById('menuT'+i).className);
   }
  
 }
 //head
 function gnbOn(n){
    document.getElementById('head'+n).src="/mod/images/comm/btn_gnb"+n+".gif";
 }
 function gnbOff(n){
	document.getElementById('head'+n).src="/mod/images/comm/btn_gnb"+n+"_off.gif";
 }
 
 //left_ban
 function banOn(n){
    document.getElementById('baner'+n).src="/mod/images/comm/ban"+n+"_on.gif";
 }
 function banOff(n){
	document.getElementById('baner'+n).src="/mod/images/comm/ban"+n+".gif";
 }
 
 //biz_tree slide
function moveElementT(elementID,top_s,final_x,final_y,interval) {
  //alert(elementID+'/'+top_s+'/'+final_x+'/'+final_y+'/'+interval);
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
   elem.style.left = "50%";	 
  }
  if (!elem.style.top) {
    //elem.style.top = "0px";
	elem.style.top = top_s + "px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x && ypos == final_y) {
    return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/10);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/10);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/10);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "%";
  elem.style.top = ypos + "px";
  var repeat = "moveElementT('"+elementID+"',"+top_s+","+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}

function bizOpen(){
  moveElementT('biz_tree',-600,50,49,1);
}
function bizClose(){
  moveElementT('biz_tree',49,50,-600,1);	
}
  
  //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 '';
	}
////////////

 //ir_tab menu
 function scBtnClick(img,fn,n){
	 //ÀÌ¹ÌÁöid,ÆÄÀÏÀÌ¸§,°ª
    document.getElementById(fn).src="/mod/images/investor/"+fn+"_on.gif";
	if (n==1){
      document.getElementById('sc_img_2008').style.display="block";
      document.getElementById('sc_img_2007').style.display="none";
	} else if(n==2){
      document.getElementById('sc_img_2007').style.display="block";
      document.getElementById('sc_img_2008').style.display="none";
	}
	
 }
 function scBtnOn(lo,fn){
	 //Æú´õ,ÆÄÀÏÀÌ¸§
    document.getElementById(fn).src="/mod/images/"+lo+"/"+fn+"_on.gif";
 }
 function scBtnOff(lo,fn){
    document.getElementById(fn).src="/mod/images/"+lo+"/"+fn+".gif";
 }

 //biz Tree con
 function biz_btm(n){
	 
	 for(i=1;i<3;i++){
		 if(i==n){
     		document.getElementById("biz_btm"+n).style.display="block";
     		document.getElementById("biz_Tcon"+n).src="/mod/images/comm/btn_bizTcon"+n+"_on.gif";
		 } else {
			document.getElementById("biz_btm"+i).style.display="none";
     	document.getElementById("biz_Tcon"+i).src="/mod/images/comm/btn_bizTcon"+i+".gif";
		 }
	 }
 }
 
 //pop
 function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function bluring()
{ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG" || event.srcElement.type=="radio" || event.srcElement.type=="checkbox") 
	document.body.focus(); 
} 
document.onfocusin=bluring; 



/*  -----------      */
function openWindow(isCenter,vWidth,vHeight,vUrl,vOpt) {
	var	mdWindow = null;
	var	x	=	0
	var	y	=	0;
	if(isCenter==true){
		x	=	(screen.width  - vWidth)/2;
		y	=	(screen.height - vHeight)/2;
	}else{
		x	=	100;
		y	=	100;
	}
	var	opt;
	if (vOpt ==	"" ||	vOpt ==	null)	vOpt = 0;
	opt	=			"width=" + vWidth	+	",height=" + vHeight;
	opt	=	opt	+	",scrollbars=" + vOpt	+	",toolbar=0,menubars=0,locationbar=0,historybar=0,statusbar=0";
	opt	=	opt	+	",outerWidth=" + vWidth	+	",outerHeight="	+	vHeight	+	",resizable=0";
	opt	=	opt	+	",left=" + x + ",top=" + y;
	opt	=	opt	+	",channelmode=no,	titlebar=no";
	var	mdWindow = window.open(vUrl, "", opt,	false);
}

function mediaPlayer(s){
	var returnval = "";
	
	returnval= '<OBJECT ID="MediaPlayer" Name="MediaPlayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-mplayer2" bgcolor="DarkBlue" ';
	returnval +=' width="303" Height="251" >';
	returnval += '<PARAM NAME="AutoStart" VALUE="0">';
	returnval += '<PARAM NAME="AutoSize" VALUE="1">';
	returnval += '<PARAM NAME="AnimationAtStart" VALUE="0">';
	returnval += '<param name="fullScreen" value="0">';
	returnval += '<PARAM NAME="DisplayMode" VALUE="4">';
	returnval += '<PARAM NAME="Enabled" VALUE="1">';
	returnval += " <param name=\"Filename\" value=\""+ s +"\">";
	returnval += '<PARAM NAME="ShowControls" VALUE="1">';
	returnval += '<PARAM NAME="ShowAudioControls" VALUE="1">';
	returnval += '<PARAM NAME="ShowDisplay" VALUE="0">';
	returnval += '<PARAM NAME="ShowGotoBar" VALUE="0">';
	returnval += '<PARAM NAME="ShowPositionControls" VALUE="1">';
	returnval += '<PARAM NAME="ShowStatusBar" VALUE="0">';
	returnval += '<PARAM NAME="Volume" VALUE="-3400">';
	returnval += '<PARAM NAME="ShowCaptioning" VALUE="0">';
	returnval += '<PARAM NAME="TransparentAtStart" value="0">';
	returnval += '<EMBED invokeURLs="false" type="application/x-mpPlayerOnPlayBtn_div" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" id="MediaPlayer" Name="MediaPlayer" DisplaySize="4" AutoSize="1" ShowControls="0" ShowDisplay="0" ShowStatusBar="1" autostart="1"></EMBED>';
	returnval += '</OBJECT>';	
	
	return returnval;
}

function go(sel) {
    //location.href = sel.value;
	  window.open (sel.value, 'site', 'scrollbars=yes,toolbar=yes,location=yes,resizable=yes,status=1,top=0,left=0')
}

