﻿// **************************************
// **************************************

//mailCHK PATTERN - 정규표현식 CHK
var mail_pattern ="^[-_a-zA-Z0-9]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$ ";
function mailCheck(emailad) { 
  var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/; 
  var check=/@[\w\-]+\./; 
  var checkend=/\.[a-zA-Z]{2,3}$/; 

    if(((emailad.search(exclude) != -1)||(emailad.search(check)) == -1)||(emailad.search(checkend) == -1)){ 
  	   return true;
    }else { 
		
		return false;
    } 
}	

// 화면 이동 자바스크립트용
function xgo(url) {
	location.replace(url);
}
 // **************************************
function goPageLink1(list_count,link_count,num_str,enc_str,fname){
//	Frm = document.+fname;
//alert(Frm);
	Frm.list_count.value = list_count; 
	Frm.link_count.value = link_count;
	Frm.num_str.value = num_str;
	Frm.enc_str.value = enc_str;
	Frm.submit();
}
  // **************************************
  
//창내리기  스크립트
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//

//스크롤따라다니는 AOD
function scroll(){    
	if(document.body.scrollTop < 110){
 		document.all.menu.style.pixelTop=110; //IE에서 상단으로 올라가는 상한값
 	}else{
		if((document.body.scrollHeight - document.body.scrollTop) < menu.clientHeight)
			document.all.menu.style.pixelTop = document.body.scrollHeight - menu.clientHeight
		else document.all.menu.style.pixelTop = document.body.scrollTop;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Search Keyword Click
function Search_Click(){
	document.Search.KeyWord.value="";
}

function menu_Search_Click(){
	document.menu_Search.menu_KeyWord.value="";
}
// 이미지 사이즈맞춰서 팝업띄우기////////////////////////////////////////////////////////////////////////////////////////////////
function view(what) { 
		var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no,top=0, left=0,width=10,height=10'); 
		imgwin.focus(); 
		imgwin.document.open(); 
		
		imgwin.document.write("<html>\n"); 
		imgwin.document.write("<head>\n"); 
		imgwin.document.write("<title>KBS WORLD Radio</title>\n"); //오픈창 타이틀 이름 지정하는 부분
		imgwin.document.write("<sc"+"ript>\n"); 
		imgwin.document.write("function resize() {\n"); 
		imgwin.document.write("pic = document.il;\n"); 
		//imgwin.document.write("alert(eval(pic).height);\n"); 
		imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
		imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 30; myWidth = eval(pic).width + 10;\n"); 
		imgwin.document.write(" } else { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10; }\n"); 
		imgwin.document.write(" clearTimeout();\n"); 
		imgwin.document.write(" var height = screen.height;\n"); 
		imgwin.document.write(" var width = screen.width;\n"); 
		imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
		imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
		imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
		imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
		imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
		imgwin.document.write("</sc"+"ript>\n");
		imgwin.document.write("</head>\n"); 
		
		imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n');
		imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>"); 
		imgwin.document.write("</body>\n");
		
		imgwin.document.write("</html>\n"); 
		imgwin.document.close(); 
}

// 이미지 사이즈맞춰서 팝업띄우기////////////////////////////////////////////////////////////////////////////////////////////////
function view_plus(what, height, width, scrollbars) { 
		var imgwin = eval("window.open('','WIN','scrollbars="+scrollbars+",status=no,toolbar=no,resizable=no,location=no,menu=no,top=0, left=0,width="+width+",height="+height+"');");
		imgwin.focus(); 
		imgwin.document.open(); 
		
		imgwin.document.write("<html>\n"); 
		imgwin.document.write("<head>\n"); 
		imgwin.document.write("<title>KBS WORLD Radio</title>\n"); //오픈창 타이틀 이름 지정하는 부분
		/*imgwin.document.write("<sc"+"ript>\n"); 
		imgwin.document.write("function resize() {\n"); 
		imgwin.document.write("pic = document.il;\n"); 
		//imgwin.document.write("alert(eval(pic).height);\n"); 
		imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
		imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 30; myWidth = eval(pic).width + 10;\n"); 
		imgwin.document.write(" } else { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10; }\n"); 
		imgwin.document.write(" clearTimeout();\n"); 
		imgwin.document.write(" var height = screen.height;\n"); 
		imgwin.document.write(" var width = screen.width;\n"); 
		imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
		imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
		imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
		imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
		imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
		imgwin.document.write("</sc"+"ript>\n");*/
		imgwin.document.write("</head>\n"); 
		
		imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" onClick="self.close()">\n');
		imgwin.document.write("<img border=0 src="+what+" name=il'>"); 
		imgwin.document.write("</body>\n");
		
		imgwin.document.write("</html>\n"); 
		imgwin.document.close(); 
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

// KBS 온에어 팝업띄우기...
function VODPlayer(file,title,type,starttime,endtime) {
	gurl = 'http://asx.kbs.co.kr/check_login.php?url='+file+'&title='+title+'&type='+type+'&starttime='+starttime+'&endtime='+endtime+'no_logon=1';
	vodplayer = window.open(gurl, 'vodplayer', 'width=350 , height=200 , resizable=no , status=0 , scrollbars=0 , menubar=no, toolbar=no, fullscreen=no, channelmode=no,location=no,directories=no,alwaysRadised=0');
}				
//

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//메뉴 슬라이딩
<!-- Hide script from older browsers 
     function toggleMenu(currMenu) { 
		 if (document.all) { 
			 thisMenu = eval("document.all." + currMenu + ".style") 
			 if (thisMenu.display == "block") { 
			 	thisMenu.display = "none" 
		 	}else { 
			 	thisMenu.display = "block" 
		 	} 
		 	return false 
		 }else { 
		 	return true 
		 } 
     } 
// End hiding script --> 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//메뉴 롤오버 변경
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 setCookie( name, value, expiredays ) {
		var todayDate = new Date();
		todayDate.setDate( todayDate.getDate() + expiredays );
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
		
		self.close();
	  }
	 function closeWin(name) {
	   if (document.frm.popCHK.checked == true) {
	 	 	setCookie( name, "done" , 1);
		} else {
	   		setCookie( name, "1" , 1);
		}
	  }
	  
	  function getCookie(name) {
	   var from_idx = document.cookie.indexOf(name+'=');
	   if (from_idx != -1) { 
		  from_idx += name.length + 1
		  to_idx = document.cookie.indexOf(';', from_idx) 
	
		  if (to_idx == -1) {
				to_idx = document.cookie.length
		  }
		  return unescape(document.cookie.substring(from_idx, to_idx))
	   }
	}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function DisplayAOD(url, width, height,contextmenu){

 var CLASSID = "22d6f312-b0f6-11d0-94ab-0080c74c7e95";

 document.write('<object  id="MPlayer" classid="CLSID:'+CLASSID+'" width='+width+' height='+height+' type="application/x-oleobject">'
 +'            <param name="Filename" value="' + url + '">'
 +'            <param name="AutoStart" value="1">'
 +'            <param name="AnimationAtStart" value="1">'
 +'            <param name="DisplaySize" value="0">'
 +'            <param name="EnableContextMenu" value="'+contextmenu+'">'
 +'            <param name="EnablePositionControls" value="-1">'
 +'            <param name="EnableFullScreenControls" value="0">'
 +'            <param name="Mute" value="0">'
 +'            <param name="ShowCaptioning" value="0">'
 +'            <param name="ShowControls" value="1">'
 +'            <param name="ShowAudioControls" value="1">'
 +'            <param name="ShowControls" value="1">'
 +'            <param name="ShowDisplay" value="0">'
 +'            <param name="ShowGotoBar" value="0">'
 +'            <param name="ShowPositionControls" value="-1">'
 +'            <param name="ShowStatusBar" value="1">'
 +'            <param name="ShowTracker" value="-1">'
 +'            <param name="Volume" value="100">'
 +'            <param name="SendMouseClickEvents" value="-1">' 
 +'          </object>');
}



function DisplayVOD(url, width, height){

 var CLASSID = "22d6f312-b0f6-11d0-94ab-0080c74c7e95";
 var CODEBASE = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112";

 document.write('<object id="MPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" width="'+width+'" height="'+height+'">'
 +'            <param name="ANIMATIONATSTART" value="0">'
 +'            <param name="AUTOSTART" value="1">'
 +'            <param name="BALANCE" value="0">'
 +'            <param name="CURRENTMARKER" value="0">'
 +'            <param name="CURRENTPOSITION" value="0">'
 +'            <param name="DISPLAYMODE" value="4">'
 +'            <param name="ENABLECONTEXTMENU" value="1">'
 +'            <param name="Filename" value="'+url+'">'
 +'            <param name="ENABLED" value="1">'
 +'            <param name="FULLSCREEN" value="0">'
 +'            <param name="INVOKEURLS" value="1">'
 +'            <param name="PLAYCOUNT" value="1">'
 +'            <param name="RATE" value="1">'
 +'            <param name="SHOWCONTROLS" value="0">'
 +'            <param name="SHOWPOSITIONCONTROLS" value="0">'
 +'            <param name="SHOWSTATUSBAR" value="0">'
 +'            <param name="STRETCHTOFIT" value="0">'
 +'            <param name="TRANSPARENTATSTART" value="0">'
 +'            <param name="UIMODE" value="FULL">' 
 +'            <param name="displaybackcolor" value="0">' 
 +'          </object>');
}


function write_menu()
{
document.write("<div id=main_panel style='height:")
if (N) document.write(height);
else document.write(height-2);
document.write(";width:");
if (N) document.write(vwidth)
else document.write(vwidth-2)
document.write("'>");

cl =0;
for(i=0;i<Link.length;i++)
{
 la = Link[i].split("|");
 if(la[0] == "0")
 {
   if (items == true) {document.write("</div>");items = false;}
   document.write("<div class='head_item' id='move"+cl+"' style='padding:3px;height:"+hheight+";width:"+vwidth+";top:"+(ntop-1)+";z-index:"+z+"' onclick='move("+cl+","+hnr+")'>&nbsp;"+la[1]+"</div>");
   link_array[cl] = new Array("up",0,hnr);
   cl++;hnr++;
   ntop += hheight-1;
   z++;
 }
 else
 {
  cheight = height - ntop + 1;
  if (items == false) {document.write("<div class='item_panel' id='move"+cl+"' style='padding:3px;height:"+cheight+"px;width:"+vwidth+";top:")
  if (N) document.write(ntop+2);
  else document.write(ntop);
  document.write(";z-index:"+z+"'>");
  z++;
  link_array[cl] = new Array("up",0,"");
  cl++;
  }
   document.write("<a href='"+la[2]+"'");
   if (la[3] != "") document.write(" target='" + la[3] + "' ");
   document.write(" onmouseover=color('item"+i+"') onmouseout=uncolor('item"+i+"') ><div class='item' id='item"+i+"' style='padding:2px;height:"+iheight+";width:"+vwidth+"'>"+la[1]+"</div></a>");
  items = true;
 }
}
document.write("</div>");
if (items == true) {document.write("</div>");}
}


function color(obj)
{
 document.getElementById(obj).style.backgroundColor = over_bgc;
 document.getElementById(obj).style.color = over_tc
 return true;
}

function uncolor(obj)
{
 document.getElementById(obj).style.backgroundColor = bgc;
 document.getElementById(obj).style.color = tc;
}

function move(idnr,hid)
{
 if ((idnr != open)&& (timerID == null))
 {
 if(link_array[idnr][0] == "up")
 {
  down = height - (hid * hheight) - ((hnr -(hid+1))* hheight) + 2;
  if(N) down+=2;
  dmover(idnr+2,down);
 }
 else
 {
  up = height - ((hid -1) * hheight) -((hnr - (hid))* hheight) +2;
  if(N) up+=2;
  umover(idnr,up);
 }
 open = idnr;
 }
}

function dmover(idnr,down)
{
 for (i=idnr;i<link_array.length;i++)
 {
  if(link_array[i][0] == "up")
  {
   txt_obj = "move" + i
   document.getElementById(txt_obj).style.top = parseInt(document.getElementById(txt_obj).style.top) + step;
  }
 }
 down-= step;
 if(down > 0)timerID = setTimeout("dmover("+idnr+","+down+")",speed);
 else 
 {
  for (i=idnr;i<link_array.length;i++) {link_array[i][0] = "down";}
 timerID = null;
 }
}

function umover(idnr,up)
{
 for (i=0;i<(idnr+2);i++)
 {
  if(link_array[i][0] == "down")
  {
   txt_obj = "move" + i
   document.getElementById(txt_obj).style.top = parseInt(document.getElementById(txt_obj).style.top) - step;
  }
 }
 up-=step;
 if(up > 0)timerID = setTimeout("umover("+idnr+","+up+")",speed);
 else 
 {
  for (i=0;i<(idnr+2);i++) {link_array[i][0] = "up";}
 timerID = null;
 }
}

function start(idnr)
{
 write_menu();
 for(i=0;i<link_array.length;i++)
 {
  if (link_array[i][2] == idnr)
  {
   pull = i;
   i = link_array.length;
  }
  move(pull,idnr);
 }
}  

// 화면 이동 자바스크립트용
function xgo(url) {
	location.replace(url);
}
function fn_RadioPlay(url){
	window.open(url,'aod','width=333,height=324,left=0,top=0');
}
 // **************************************
function goPageLink1(list_count,link_count,num_str,enc_str,fname){
//	Frm = document.+fname;
//alert(Frm);
	Frm.list_count.value = list_count; 
	Frm.link_count.value = link_count;
	Frm.num_str.value = num_str;
	Frm.enc_str.value = enc_str;
	Frm.submit();
}
  // **************************************
  
// 이미지 사이즈맞춰서 팝업띄우기
function view(what) { 
		var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no,top=0, left=0,width=10,height=10'); 
		imgwin.focus(); 
		imgwin.document.open(); 
		
		imgwin.document.write("<html>\n"); 
		imgwin.document.write("<head>\n"); 
		imgwin.document.write("<title>KBS WORLD Radio</title>\n"); //오픈창 타이틀 이름 지정하는 부분
		imgwin.document.write("<sc"+"ript>\n"); 
		imgwin.document.write("function resize() {\n"); 
		imgwin.document.write("pic = document.il;\n"); 
		//imgwin.document.write("alert(eval(pic).height);\n"); 
		imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
		imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 30; myWidth = eval(pic).width + 10;\n"); 
		imgwin.document.write(" } else { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10; }\n"); 
		imgwin.document.write(" clearTimeout();\n"); 
		imgwin.document.write(" var height = screen.height;\n"); 
		imgwin.document.write(" var width = screen.width;\n"); 
		imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
		imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
		imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
		imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
		imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
		imgwin.document.write("</sc"+"ript>\n");
		imgwin.document.write("</head>\n"); 
		
		imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n');
		imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>"); 
		imgwin.document.write("</body>\n");
		
		imgwin.document.write("</html>\n"); 
		imgwin.document.close(); 
}

// 이미지 사이즈맞춰서 팝업띄우기
function view_plus(what, height, width, scrollbars) { 
		var imgwin = eval("window.open('','WIN','scrollbars="+scrollbars+",status=no,toolbar=no,resizable=no,location=no,menu=no,top=0, left=0,width="+width+",height="+height+"');");
		imgwin.focus(); 
		imgwin.document.open(); 
		
		imgwin.document.write("<html>\n"); 
		imgwin.document.write("<head>\n"); 
		imgwin.document.write("<title>KBS WORLD Radio</title>\n"); //오픈창 타이틀 이름 지정하는 부분
		/*imgwin.document.write("<sc"+"ript>\n"); 
		imgwin.document.write("function resize() {\n"); 
		imgwin.document.write("pic = document.il;\n"); 
		//imgwin.document.write("alert(eval(pic).height);\n"); 
		imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
		imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 30; myWidth = eval(pic).width + 10;\n"); 
		imgwin.document.write(" } else { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10; }\n"); 
		imgwin.document.write(" clearTimeout();\n"); 
		imgwin.document.write(" var height = screen.height;\n"); 
		imgwin.document.write(" var width = screen.width;\n"); 
		imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
		imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
		imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
		imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
		imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
		imgwin.document.write("</sc"+"ript>\n");*/
		imgwin.document.write("</head>\n"); 
		
		imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" onClick="self.close()">\n');
		imgwin.document.write("<img border=0 src="+what+" name=il'>"); 
		imgwin.document.write("</body>\n");
		
		imgwin.document.write("</html>\n"); 
		imgwin.document.close(); 
}

// KBS 온에어 팝업띄우기
function VODPlayer(file,title,type,starttime,endtime) {
	gurl = 'http://asx.kbs.co.kr/check_login.php?url='+file+'&title='+title+'&type='+type+'&starttime='+starttime+'&endtime='+endtime+'no_logon=1';
	vodplayer = window.open(gurl, 'vodplayer', 'width=350 , height=200 , resizable=no , status=0 , scrollbars=0 , menubar=no, toolbar=no, fullscreen=no, channelmode=no,location=no,directories=no,alwaysRadised=0');
}				

//메뉴 롤오버 변경
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 setCookie( name, value, expiredays ) {
		var todayDate = new Date();
		todayDate.setDate( todayDate.getDate() + expiredays );
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
		
		self.close();
	  }
	 function closeWin(name) {
	   if (document.frm.popCHK.checked == true) {
	 	 	setCookie( name, "done" , 1);
		} else {
	   		setCookie( name, "1" , 1);
		}
	  }
	  
	  function getCookie(name) {
	   var from_idx = document.cookie.indexOf(name+'=');
	   if (from_idx != -1) { 
		  from_idx += name.length + 1
		  to_idx = document.cookie.indexOf(';', from_idx) 
	
		  if (to_idx == -1) {
				to_idx = document.cookie.length
		  }
		  return unescape(document.cookie.substring(from_idx, to_idx))
	   }
	}

//AOD 플레이어

function DisplayAOD(url, width, height,contextmenu){

 var CLASSID = "22d6f312-b0f6-11d0-94ab-0080c74c7e95";

 document.write('<object  id="MPlayer" classid="CLSID:'+CLASSID+'" width='+width+' height='+height+' type="application/x-oleobject">'
 +'            <param name="Filename" value="' + url + '">'
 +'            <param name="AutoStart" value="1">'
 +'            <param name="AnimationAtStart" value="1">'
 +'            <param name="DisplaySize" value="0">'
 +'            <param name="EnableContextMenu" value="'+contextmenu+'">'
 +'            <param name="EnablePositionControls" value="-1">'
 +'            <param name="EnableFullScreenControls" value="0">'
 +'            <param name="Mute" value="0">'
 +'            <param name="ShowCaptioning" value="0">'
 +'            <param name="ShowControls" value="1">'
 +'            <param name="ShowAudioControls" value="1">'
 +'            <param name="ShowControls" value="1">'
 +'            <param name="ShowDisplay" value="0">'
 +'            <param name="ShowGotoBar" value="0">'
 +'            <param name="ShowPositionControls" value="-1">'
 +'            <param name="ShowStatusBar" value="1">'
 +'            <param name="ShowTracker" value="-1">'
 +'            <param name="Volume" value="100">'
 +'            <param name="SendMouseClickEvents" value="-1">' 
 +'          </object>');
}


//VOD 플레이어
function DisplayVOD(url, width, height){

 var CLASSID = "22d6f312-b0f6-11d0-94ab-0080c74c7e95";
 var CODEBASE = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112";

 document.write('<object id="MPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" width="'+width+'" height="'+height+'">'
 +'            <param name="ANIMATIONATSTART" value="0">'
 +'            <param name="AUTOSTART" value="1">'
 +'            <param name="BALANCE" value="0">'
 +'            <param name="CURRENTMARKER" value="0">'
 +'            <param name="CURRENTPOSITION" value="0">'
 +'            <param name="DISPLAYMODE" value="4">'
 +'            <param name="ENABLECONTEXTMENU" value="1">'
 +'            <param name="Filename" value="'+url+'">'
 +'            <param name="ENABLED" value="1">'
 +'            <param name="FULLSCREEN" value="0">'
 +'            <param name="INVOKEURLS" value="1">'
 +'            <param name="PLAYCOUNT" value="1">'
 +'            <param name="RATE" value="1">'
 +'            <param name="SHOWCONTROLS" value="0">'
 +'            <param name="SHOWPOSITIONCONTROLS" value="0">'
 +'            <param name="SHOWSTATUSBAR" value="0">'
 +'            <param name="STRETCHTOFIT" value="0">'
 +'            <param name="TRANSPARENTATSTART" value="0">'
 +'            <param name="UIMODE" value="FULL">' 
 +'            <param name="displaybackcolor" value="0">' 
 +'          </object>');
}

// Search Keyword Click
function Search_Click(){
	document.Search.KeyWord.value="";
}


//플래쉬삽입
function DisplayFlash(url, width, height){

 var CLASSID = "D27CDB6E-AE6D-11cf-96B8-444553540000";
 var CODEBASE = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
 var PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer";
 var TYPE = "application/x-shockwave-flash";

 document.write('<object classid="clsid:'+CLASSID+' codebase="'+CODEBASE+'" width="'+width+'" height="'+height+'">'
 +'            <param name="movie" value="' + url + '">'
 +'            <param name="quality" value="high">'
 +'            <param name="wmode" value="transparent">'
 +'            <embed src="' + url + '" width="' + width + '" height="' + height + '" quality="high" pluginspage="' + 
                  PLUGINSPAGE + '" type="' + TYPE + '" wmode="transparent"></embed>'
 +'          </object>');
}

//그래픽 & 포토뉴스 main 마우스오버 스크립트
function fn_changeView(com, root_path){
	if(com == "photo"){
		document.all.photo_menu.src = "/"+root_path+"/img/img_news_phototab01.gif";    
		document.all.graphic_menu.src = "/"+root_path+"/img/img_news_phototab02a.gif";    
		photo_view.style.display="block" ;
		graphic_view.style.display="none" ;
	}else if(com == "graphic"){
		document.all.photo_menu.src = "/"+root_path+"/img/img_news_phototab01a.gif";    
		document.all.graphic_menu.src = "/"+root_path+"/img/img_news_phototab02.gif";    
		photo_view.style.display="none" ;
		graphic_view.style.display="block" ;
	}
 
}

function print_pop(no,lang,key){
	open_pop = window.open("/news_print.htm?lang="+lang+"&No="+no+"&Category="+key,"WORLDKBSNEWS","status=no,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes,width=600,height=445,left=20,top=20");
}
