/****************************************************************************
	Flash_view - 단순 Flash일 경우
*****************************************************************************
	- width		: 가로크기
	- height	: 세로크기
	- wmode	: 투명, 절대위치등 레이어의 기능
	- url			: 플래쉬 파일의 경로
*****************************************************************************/

function Flash_view(width, height, wmode, url){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='"+wmode+"'> ");
	document.write("	<embed src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' wmode='"+wmode+"' ");
	document.write("		allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

/****************************************************************************
	F_viewSwf - 페이지 인식이 있는 Flash일 경우
*****************************************************************************
	- width		: 가로크기
	- height	: 세로크기
	- wmode	: 투명, 절대위치등 레이어의 기능
	- url			: 플래쉬 파일의 경로
	- a		: pageNum
	- b 	: subNum
*****************************************************************************/

function F_viewSwf(width, height, wmode, url, a, b){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='"+wmode+"'> ");
	document.write("	<param name='FlashVars'			value='pageNum="+a+"&subNum="+b+"'> ");
	document.write("	<embed src='"+url+"' FlashVars='pageNum="+a+"&subNum="+b+"' quality='high' width='"+width+"' height='"+height+"' align='middle' wmode='"+wmode+"' ");
	document.write("		allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}


/***********************************************************************************************************
	F_viewMediaPlayer - Microsoft Windows Media Player 재생
************************************************************************************************************
	예) F_viewMediaPlayer('NSPlay','NSPlay','322','286','true','true','true','false','false','false','false','파일명');
************************************************************************************************************/
function F_viewMediaPlayer(id, name, width, height, showcontrols, autostart, autorewind, autosize, autoresize, transparentatstart, loop, url) {
	document.write("<object id='"+id+"' codeBase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' ");
	document.write("		type='application/x-oleobject' standby='Loading Microsoft Windows Media Player components...' ");
	document.write("		width='"+width+"' height='"+height+"' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' name='"+name+"'> ");
	document.write("	<param name='ShowControls' value='"+showcontrols+"'> ");
	document.write("	<param name='AutoStart' value='"+autostart+"'> ");
	document.write("	<param name='AutoRewind' value='"+autorewind+"'> ");
	document.write("	<param name='Autosize' value='"+autosize+"'> ");
	document.write("	<param name='AutoResize' value='"+autoresize+"'> ");
	document.write("	<param name='TransparentAtStart' value='"+transparentatstart+"'> ");
	document.write("	<param name='loop' value='"+loop+"'> ");
	document.write("	<param name='Filename' value='"+url+"'> ");
	document.write("	<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' ");
	document.write("		id='"+id+"' name='"+name+"' showpositioncontrols='0' showcontrols='0' autosize='0' autostart='1' showdisplay='0' ");
	document.write("		showstatusbar='0' showtracker='1' loop='1' width='"+width+"'  height='"+height+"' src='"+url+"'> ");
	document.write("	</embed> ");
	document.write("</object> ");
}


/****************************************************************************
	img_over - 이미지 롤오버
****************************************************************************/

function img_over(img1,name,dir,over){

	if(over=='over')
	{
		img1.src=dir+name+'_on.gif';
	}
	else
	{
		img1.src=dir+name+'.gif';
	}
}


/****************************************************************************
	Popup - 팝업창 띄우기
****************************************************************************/
function Popup(url, width, height, left, top, scrollbars){
	var pop_win;
 		pop_win = window.open(url, "custom", "width=" + width + ",height=" + height + ",left=" +left+",top="+top+",scrollbars=" + scrollbars);
	pop_win.focus();
}


/* 서비스바로가기 펼치고접기 */
function Service_Info(state){
	if(state == 'open'){
		document.getElementById('Service_Box_Close').style.display = 'none';
		document.getElementById('Service_Box_Open').style.display = '';
	}
	else if(state == 'close'){
		document.getElementById('Service_Box_Close').style.display = '';
		document.getElementById('Service_Box_Open').style.display = 'none';
	}
}

/*탭전환(주의 id의값은 1부터.. total값은 탭수)*/
function tabDisplay(total,num,url){
	location.href = "scrap.php?depth="+escape(url);
//	a = total + 1;
//	for(i=1; i<a; i++){
//		if( num == i){
//			document.getElementById("Tab_0"+i).style.display = "";
//		}
//		else{
//			document.getElementById("Tab_0"+i).style.display = "none";
//		}
//	}
}

function tabDisplay2(v1,v2){
	location.href = "scrap.php?depth="+escape(v1)+"&depth2="+v2;
}

function tabDisplay_2(total,num){
	a = total + 1;
	for(i=1; i<a; i++){
		if( num == i){
			document.getElementById("Tab_0"+i).style.display = "";
		}
		else{
			document.getElementById("Tab_0"+i).style.display = "none";
		}
	}
}

/*자주하는 질문*/
function questionView(num){
	anser = document.getElementById("anser"+ num);
	if(anser.style.display == ""){
		anser.style.display = "none";
	}
	else{
		anser.style.display = "";
	}
}

/*IE6에서 셀렉트박스가 레이어에올라가는현상 제거*/
function DivSetVisible(state){
	var DivRef = document.getElementById('Service_Box_Open');
	var IfrRef = document.getElementById('DivShim');
	if(state)
	{
	DivRef.style.display = "block";
	IfrRef.style.width = DivRef.offsetWidth;
	IfrRef.style.height = DivRef.offsetHeight;
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
	}
	else
	{
	DivRef.style.display = "none";
	IfrRef.style.display = "none";
	}
}


/* 따라다니는 레이어 */
function initMoving(target, topPosition, topLimit, btmLimit) {
if (!target)
return false;

var obj = target;
obj.initTop = topPosition;
obj.topLimit = topLimit;
obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

obj.style.position = "absolute";
obj.top = obj.initTop;
obj.left = obj.initLeft;
obj.style.top = obj.top + "px";

obj.getTop = function() {
if (document.documentElement.scrollTop) {
return document.documentElement.scrollTop;
} else if (window.pageYOffset) {
return window.pageYOffset;
} else {
return 0;
}
}

obj.move = setInterval(function() {
//pos = obj.getTop() + obj.getHeight() / 2 - 15;
pos = obj.getTop() + topPosition;

if (pos > obj.bottomLimit)
pos = obj.bottomLimit
if (pos < obj.topLimit)
pos = obj.topLimit

interval = obj.top - pos;
obj.top = obj.top - interval / 15;
obj.style.top = obj.top + "px";
}, 20)
}
/* 따라다니는 레이어_END */



/* 090629_관련정보다 */
function tagView(v){
	document.getElementById(v).style.height = "100%";
	document.getElementById(v).style.borderBottom = "none";
	document.getElementById(v+"_01").style.display = "none";
	document.getElementById(v+"_02").style.display = "";
}
function tagView_close(v,z){
	document.getElementById(v).style.height = z+"px";
	document.getElementById(v).style.borderBottom = "1px solid #E3E3E3";
	document.getElementById(v+"_01").style.display = "";
	document.getElementById(v+"_02").style.display = "none";
}




// 이미지 사이즈맞게 새창이 자동으로 조절
function cnj_win_view(img){
  img_conf1= new Image();
  img_conf1.src=(img);
  cnj_view_conf(img);
}

function cnj_view_conf(img){
  if((img_conf1.width!=0)&&(img_conf1.height!=0)){
    cnj_view_img(img);
  } else{
    funzione="cnj_view_conf('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

var cnj_img_view = null;
function cnj_view_img(img){
    if(cnj_img_view != null) {
      if(!cnj_img_view.closed) {
      cnj_img_view.close();
      }
    }
  cnj_width=img_conf1.width+20;
  cnj_height=img_conf1.height+20;
  str_img="width="+cnj_width+",height="+cnj_height;

   cnj_img_view=window.open("about:blank","",str_img);
   cnj_img_view.document.open();   // document.open()
   cnj_img_view.document.writeln("<html>");
   cnj_img_view.document.writeln("<head>");
   cnj_img_view.document.writeln("<title></title>");
   cnj_img_view.document.writeln("<meta http-equiv='content-type' content='text/html; charset=euc-kr'>");
   cnj_img_view.document.writeln("<meta http-equiv='imagetoolbar' content='no'>");
   var start="<";
   cnj_img_view.document.writeln("<script language='javascript'>");
   cnj_img_view.document.writeln("function click() {");
   cnj_img_view.document.writeln("if ((event.button==1) || (event.button==2))  {");
   cnj_img_view.document.writeln("top.close();");
   cnj_img_view.document.writeln("      }");
   cnj_img_view.document.writeln("}");
   cnj_img_view.document.writeln("document.onmousedown=click");
   cnj_img_view.document.writeln(start+"/script>");
   cnj_img_view.document.writeln("</head>");
   cnj_img_view.document.writeln("<body onload='window.print();'>");
   cnj_img_view.document.writeln("<img src="+ img +" border=0 style='cursor:hand'>") // 소스 테스트 부분
   cnj_img_view.document.writeln("</body></html>");
   cnj_img_view.document.close();  // 반드시 document.close() 닫아주어야 함
   cnj_img_view.focus();
  return;
}
