/********* 플래시 *********/
function showFlash(flaFile, widths, heights, btrans) { 

  var strings = '<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="' + widths + '"  height="' + heights + '"><param name="movie" value="' + flaFile + '"> <param name="quality" value="high"> '; 

  if (btrans == 'y') { 
    strings += '<param name="wmode" value="transparent">'; 
  } 

  strings += '<embed src="' + flaFile + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + widths + '" height="' + heights + '"> </embed> </object>'; 

  document.write(strings); 

  return; 
} 
/********* 플래시 *********/

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];}
}


function winClose() {
window.close()
} 

function winOpensejong() {
window.open("/infra/popup/movie_sejong.html","newWin","width=420,height=600,toolbar=no")
} 

function winOpendasan() {
window.open("/infra/popup/movie_dasan.html","newWin","width=420,height=600,toolbar=no")
}  

function winOpenflashgame() {
window.open("/infra/popup/game.html","newWin","width=400,height=500,toolbar=no")
} 

function winOpenaraonvod() {
window.open("/infra/popup/shebing.html","newWin","width=373,height=325,toolbar=no")
}

//б ˾
function people_popup(urls){
window.open(urls,'people_popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=0,left=0,width=700,height=600');
}

/********* 상세보기 *********/
<!--
function goMove(strGubun) {
	var oForm = document.faqForm;	
	
	oForm.strGubun.value = strGubun;		
	oForm.submit();	
}

function trView(strGubun) {
	var oForm = document.getElementById("trID"+strGubun);

	if (oForm.style.display != "none")
		oForm.style.display = "none";	
	else
		oForm.style.display = "";		
}
//-->
/********* //상세보기 *********/

/********* 스크롤 따라다니는 레이어 *********/
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 30);
	}
	return el;
}
//사용법: 움직일 객체 다음에 아래코드 삽입
//JSFX_FloatDiv("wing", 880,143).floatIt();

/** 페이지 로딩 완료시 수행*/
function addLoadEvents( func )
{
  var oldonload = window.onload;
  if ( typeof window.onload != 'function' ){
    window.onload = func;
  } else {
    window.onload = function()
    {
      oldonload();
      func();
    }
  }
}

/***********************************
/ 이미지 사이즈에 맞게 새창띄우기
/***********************************/
function OpenImage(s){
 //
 // 변수 정의
 //
 srcImg = new Image();
 clientWidth = screen.width;
 clientHeight = screen.height;
 srcImg.src = s.src;
 //
 // 열려는 파일을 이름
 //
 var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length);
 //
 // 새창 띄우고 이미지 삽입
 //
 win = window.open("","","width=15,height=15,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2-15)+"");
 win.document.writeln("<html>");
 win.document.writeln("<head>");
 win.document.writeln("<title>"+document.title+" ["+srcFileName+"]</title>");
 win.document.writeln("</head>");
 win.document.writeln("<body style='margin:0px;' bgcolor='#333333'>");
 win.document.writeln("<table border='0' cellpadding='0' cellspacing='0' style='cursor:hand' onclick='self.close()'>");
 win.document.writeln(" <tr>");
 win.document.writeln("  <td align='center'><img src="+s.src+" name='winImg' style='cursor:hand' onclick='self.close()' alt='클릭하면 사라집니다'></td>");
 win.document.writeln(" </tr>");
 win.document.writeln("</table>");
 win.document.writeln("</body>");
 win.document.writeln("</html>");

 srcImg = win.document.winImg;
 //
 // 이미지가 모두 로딩될때까지 기다림
 //
 while(true)
 if(srcImg.readyState == "complete")
 break;
 
 //
 // 새창의 크기 설정
 //
 var winWidth = srcImg.width+10;
 var winHeight = srcImg.height+29;
 //
 // 새창이 띄워질 위치 설정
 //
 var left = (clientWidth/2)-(srcImg.width/2);
 var top = (clientHeight/2)-(srcImg.height/2);
 //
 // 이미지의 크기 overflow 확인후 새창의 크기와 위치 재설정
 //
 if(clientWidth <= srcImg.width){
  winWidth = clientWidth;
  left = 0;
  win.document.body.scroll = "auto";
 }
 if(clientHeight <= srcImg.height){
  winHeight = clientHeight-30;
  top = 0;
  win.document.body.scroll = "auto";
 }
 //
 // 이미지로딩이 끝났음으로 이미지의 크기를 사용할수 있다.
 // 해당 이미지의 사이즈에 맞게 윈도우를 재설정한다.
 win.moveTo(left, top);
 win.resizeTo(winWidth, winHeight);
}
//-->

