function swf(w,h,src){
    object = "";
    object += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'	width='"+w+"' height='"+h+"'>";
    object += "<param name='allowScriptAccess' value='always'>";
    object += "<param name='movie' value='"+src+"'>";
    object += "<param name='quality' value='high'>";
    object += "<param name='wmode' value='transparent'>";
    object += "<embed src='"+src+"' quality='high' allowScriptAccess='Always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'>";
    object += "</embed>";
    object += "</object>";
    document.write(object);
}

// a 숫자를 앞에 times 만큼 0으로 채운다
function getZerofill(a,times){a= parseInt(a);f=1;for(i=0;i<times;i++){f*=10;};return (f+a+"").substr(1);};

//입력한 값이 숫자인지 판단, 리턴값: 숫자이면 true, 아니면 false 
function isNumber(s){s+='';s=s.replace(/^\s*|\s*$/g, '');if(s==''||isNaN(s)){return false;};return true;};


function bluring(){ try{if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG"){document.body.focus(); }; }catch(e){};}; 
document.onfocusin=bluring;


/*    title 태그속성의 문자열을 레이어 툴팁으로 바꿔서 출력해 주는 클래스 
      익스플로러만 적용, 모질라에서는 기존 title 기능 유지 
      사용법) 
            < a href='#none' title='나는 링크'>링크< /a> 
            < span title='나는 span'>span< /span> 
            < script> 
            var MyTitle = new TitleToDiv('a', 'span'); // 인자가 생략되면 기본으로 'a' 태그만 적용 
            MyTitle.Style.color = 'red'; // 새로운 스타일 적용, 생략하면 기본스타일로 적용, 생략 가능 
            MyTitle.Apply(); 
            < /script> 
*/ 
function TitleToDiv() 
{ 
      if(!document.all) return; // 익스플로러가 아니면 돌아감, 기본 title로 적용 함 

      this.Style = DivNewTagTitle.style; // 차후 사용자 정의 스타일로 변경 가능 

      var BaseArgs = arguments; 
      this.Apply = function() 
      { 
            var TagNames = BaseArgs.length ? BaseArgs : Array('a'); 
            for(i = 0; i < TagNames.length; i++) // 전달받은 인자(태그이름)들에게 모두 적용 
            { 
                  var TagObjects = document.getElementsByTagName(TagNames[i]); 
                  for(k = 0; k < TagObjects.length; k++) 
                  { 
                        if(TagObjects[k].getAttribute('title')) // title이 있다면 
                        { 
                              var SavedTitle; 
                              TagObjects[k].onmouseover = function() // OnMouseOver 
                              { 
                                    with(DivNewTagTitle) 
                                    { 
                                          style.display = 'block'; 
                                          innerHTML = this.title; 
                                          SavedTitle = this.title; 
                                          this.title = ''; 
                                          var X = event.x + document.body.scrollLeft; 
                                          var Y = event.y + document.body.scrollTop; 
                                          style.left = X + 10; 
                                          style.top = Y + 10; 
                                    } 
                              } 
                              TagObjects[k].onmouseout = function() // OnMouseOut 
                              { 
                                    DivNewTagTitle.style.display = 'none'; 
                                    this.title = SavedTitle; 
                              } 
                        } 
                  } 
            } 
      } 
}; 
document.write('<div style="zIndex:400;position:absolute;padding:2pxwidth:auto;height:auto;color:black;border:1px solid slategray;display:none;background-color=#95C0E8;filter:alpha(opacity=50, style=0, finishopacity=0) " id="DivNewTagTitle">DivNewTagTitle</div>'); 



/*
순위
tc = new TimeCaption("OD_",3,30); prefix,len
tc.start(2000,1);
*/
TimeCaption=function(prefix,len,h){this.cnt=0;this.prefix=prefix;this.len=len;this.nMovSleep=1500;this.nSleep=1;this.mouseover=false;this.divbody=[];this.h=h;var self=this;for(var i=0;i<this.len;i++){this.divbody[i]=document.getElementById(this.prefix+i);this.divbody[i].style.display='none';this.divbody[i].style.position='absolute';self.divbody[i].onmouseover=function(){self.mouseover=true;};self.divbody[i].onmouseout=function(){self.mouseover=false;};};this.get=function(k){var r=k;if(k<=-1){r=this.len-1;}else if(k>=this.len){ r=0;};return r;};this.divmov=function(k ,from , to){this.divbody[k].style.zIndex='200';this.divbody[k].style.display='';this.divbody[k].style.posTop=--from;if(from==to){}else{setTimeout(function(){self.divmov(k ,from , to)},self.nSleep);};};this.mov=function(k){if(!self.mouseover){this.divmov(self.get(k-1),0,-this.h);this.divmov(k,this.h,0);setTimeout(function(){self.mov(self.get(k+1))},self.nMovSleep);}else{setTimeout(function(){self.mov(self.get(k))},self.nMovSleep);};};this.start=function(nMovSleep,nSleep){this.nMovSleep=nMovSleep;this.nSleep=nSleep;this.mov(0);};};

/*
메뉴없는 탭 롤링
ch2=new TimeChangeBody("OD_",3);
ch2.start(1000);
<a href="javascript:ch2.menuPre()">Pre</a>
<a href="javascript:ch2.menuNext()">next</a>
<a href="javascript:ch2.menu(0)">0</a>
<a href="javascript:ch2.menu(1)">1</a>
<a href="javascript:ch2.menu(2)">2</a>

*/
TimeChangeBody=function(prefix,len){this.now=-1;this.prefix=prefix;this.len=len;this.nSleep=0;this.mouseover=false;this.divbody=[];this.tid;var self=this;for(var i=0;i<this.len;i++){this.divbody[i]=document.getElementById(this.prefix+i);};this.get=function(k){var r=k;if(k<=-1)r=this.len-1;else if(k>=this.len)r=0;return r;};this.show=function(k){k=parseInt(k);this.now=k;for(var i=0;i<self.len;i++){if(i==k){self.divbody[k].style.display='';self.divbody[k].onmouseover=function(){self.mouseover=true;};self.divbody[k].onmouseout=function(){self.mouseover=false;};}else{self.divbody[i].style.display='none';self.divbody[i].onmouseover=function(){};self.divbody[i].onmouseout=function(){};};};};this.go=function(k){clearTimeout(this.tid);this.show(k);if(this.nSleep){this.tid=setTimeout(function(){self.mov()},self.nSleep);};};this.mov=function(){if(!self.mouseover){k=self.get(this.now+1);this.show(k);};this.tid=setTimeout(function(){self.mov()},self.nSleep);};this.start=function(nSleep){this.nSleep=nSleep;this.mov();};this.menuPre=function(){if(this.now==-1){this.now=0;};this.go(this.get(this.now-1));};this.menuNext=function(){if(this.now==-1){this.now=0;};this.go(this.get(this.now+1));};this.menu=function(k){this.go(this.get(k));};};

/*
순차바뀜 메뉴 타이틀
ch2 = new TimeChangeBody("OD_","H_",3);
ch2.start(1000);
<a href="javascript:ch2.menuPre()">Pre</a>
<a href="javascript:ch2.menuNext()">next</a>
*/
TimeChangeTitleBody=function(title_prefix,body_prefix,len){this.now=-1;this.title_prefix=title_prefix;this.body_prefix=title_prefix+body_prefix;this.len=len;this.nSleep=1000;this.tid=0;this.mouseover=false;this.divtitle=[];this.divbody=[];var self=this;for(var i=0;i<this.len;i++){this.divtitle[i]=document.getElementById(this.title_prefix+i);this.divbody[i]=document.getElementById(this.body_prefix+i);};this.get=function(k){var r=k;if(k<=-1){r=this.len-1;}else if(k>=this.len){ r=0;};return r;};this.show=function(k){k=parseInt(k);this.now=k;for(var i=0;i<self.len;i++){if(i==k){this.divtitle[i].style.display='none';this.divbody[i].style.display='';self.divbody[k].onmouseover=function(){self.mouseover=true;};self.divbody[k].onmouseout=function(){self.mouseover=false;};}else{this.divtitle[i].style.display='';this.divbody[i].style.display='none';self.divbody[i].onmouseover=function(){};self.divbody[i].onmouseout=function(){};};};};this.go=function(k){clearTimeout(this.tid);this.show(k);this.tid=setTimeout(function(){self.mov()},self.nSleep);};this.mov=function(){if(!self.mouseover){k=self.get(this.now+1);this.show(k);};this.tid=setTimeout(function(){self.mov()},self.nSleep);};this.start=function(nSleep){this.nSleep=nSleep;this.mov();};this.menuPre=function(){this.go(this.get(this.now-1));};this.menuNext=function(){this.go(this.get(this.now+1));};this.menu=function(k){this.go(this.get(k));};};
/*
탭메뉴 롤링

img1=["http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt01.gif","http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt02.gif","http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt03.gif"];
img2=["http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt011.gif","http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt022.gif","http://image.pbc.co.kr/pbc_tv/images/contents02_03_bt033.gif"];
ch=new TimeChangeMenu("VOD_","IMG_",img1,img2);
ch.start(2000);

<a href="javascript:ch.menuPre()">Pre</a>
<a href="javascript:ch.menuNext()">next</a>
*/
TimeChangeMenu=function(prefix,imgprefix,imgArr1,imgArr2){this.prefix=prefix;this.imgprefix=prefix+imgprefix;this.imgArr1=imgArr1;this.imgArr2=imgArr2;this.len=imgArr1.length;this.nSleep=0;this.tid=0;this.mouseover=false;this.divmenu=[];this.divbody=[];this.now=-1;var self=this;for(var i=0;i<this.len;i++){this.divbody[i]=document.getElementById(this.prefix+i);this.divmenu[i]=document.getElementById(this.imgprefix+i);this.divmenu[i].onmouseover=function(){self.mouseover=true;};this.divmenu[i].onmouseout=function(){self.mouseover=false;};};this.get=function(k){var r=k;if(k<=-1){r=this.len-1;}else if(k>=this.len){ r=0;};return r;};this.show=function(k){k=parseInt(k);this.now=k;for(var i=0;i<self.len;i++){if(k==i){self.divmenu[k].src=self.imgArr2[k];self.divbody[k].style.display='';self.divbody[k].onmouseover=function(){self.mouseover=true;};self.divbody[k].onmouseout=function(){self.mouseover=false;};}else{self.divmenu[i].src=self.imgArr1[i];self.divbody[i].style.display='none';self.divbody[i].onmouseover=function(){};self.divbody[i].onmouseout=function(){};};};};this.go=function(k){clearTimeout(this.tid);if(this.nSleep){if(k==-1){k=0;};};this.show(k);if(this.nSleep){this.tid=setTimeout(function(){self.mov()},self.nSleep);};};this.mov=function(){if(!self.mouseover){k=self.get(this.now+1);this.show(k);};this.tid=setTimeout(function(){self.mov()},self.nSleep);};this.start=function(nSleep){this.nSleep=nSleep;this.mov();};this.menuPre=function(){if(this.now==-1){this.now=0;};this.go(this.get(this.now-1));};this.menuNext=function(){if(this.now==-1){this.now=0;};this.go(this.get(this.now+1));};this.menu=function(k){this.go(this.get(k));};};



function roundTable(objID) {
	var obj = document.getElementById(objID);
	var Parent, objTmp, Table, TBody, TR, TD;
	var bdcolor, bgcolor, Space;
	var trIDX, tdIDX, MAX;
	var styleWidth, styleHeight;

	Parent = obj.parentNode;
	objTmp = document.createElement('SPAN');
	Parent.insertBefore(objTmp, obj);
	Parent.removeChild(obj);

	bdcolor = obj.getAttribute('rborder');
	bgcolor = obj.getAttribute('rbgcolor');
	radius = parseInt(obj.getAttribute('radius'));
	if (radius == null || radius < 1) radius = 1;
	else if (radius > 6) radius = 6;

	MAX = radius * 2 + 1;

	Table = document.createElement('TABLE');
	TBody = document.createElement('TBODY');

	Table.cellSpacing = 0;
	Table.cellPadding = 0;

	for (trIDX=0; trIDX < MAX; trIDX++) {
		TR = document.createElement('TR');
		Space = Math.abs(trIDX - parseInt(radius));
		for (tdIDX=0; tdIDX < MAX; tdIDX++) {
			TD = document.createElement('TD');
			styleWidth = '1px'; styleHeight = '1px';
			if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
			else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
			else if (radius > 2) {
				if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
				if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
			}

			if (styleWidth != null) TD.style.width = styleWidth;
			if (styleHeight != null) TD.style.height = styleHeight;

			if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
			else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;

			if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
			TR.appendChild(TD);
		}
		TBody.appendChild(TR);
	}

	Table.appendChild(TBody);
	Parent.insertBefore(Table, objTmp);
}

function AllroundTable(preid){
var str="";var tables = document.getElementsByTagName('table');for(var i=0;i<tables.length;i++){
if(tables[i].id.substring(0,preid.length)==preid){str += "roundTable(\"" + tables[i].id + "\");";};};return str;};



function mms(code){var url='http://web.pbc.co.kr/PBCMMS/'+code+'/';urlmms(url);}

function tvlive(){
	var url='mms://203.229.58.150/tvlive';
	urlmms(url);
}

function fmlive(){
	var url='mms://203.229.58.150/fmlive';
	urlmms(url);
}

function eventlive(){
	var url='mms://203.229.58.150/pbclive';
	urlmms(url);
}

function DisplayLiveWMP(width, height){
	var CLASSID = "22D6F312-B0F6-11D0-94AB-0080C74C7E95";

	var strValue = "<object id=\"MediaPlayer\" classid=\"clsid:" + CLASSID + "\" width=\"" + width + "\" height=\"" + height + "\" align=\"center\" VIEWASTEXT>"
	+ "<param name=\"AutoStart\" value=\"True\">"
	+ "<param name=\"EnableContextMenu\" value=\"false\">"
	+ "<param name=\"DisplaySize\" value=\"0\">"
	+ "<param name=\"ShowStatusBar\" value=\"1\">"
	+ "</object>";

	document.write(strValue);
}



/*
function urlmms(url){
	var str="<object ID='Mplayer' WIDTH='320' HEIGHT='280'  STYLE='position: left:0px; top:0px;'  CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' VIEWASTEXT>"
	+"<param NAME='FileName' VALUE='"+url+"'>"
	+"<PARAM NAME='AnimationAtStart' value='0'>"
	+"<param NAME='CurrentPosition' VALUE='0'>"
	+"<param NAME='SetCurrentEntry' VALUE='1'>"
	+"<param NAME='ClickToPlay' VALUE='0'>"
	+"<PARAM NAME='AllowChangeDisplaySize' VALUE='1'>"
	+"<param NAME='AutoSize' VALUE='1'>"
	+"<param NAME='AutoStart' VALUE='1'>"
	+"<param NAME='AutoResize' VALUE='1'>"
	+"<param NAME='PreviewMode' VALUE='False'>"
	+"<param NAME='CursorType' value='1'>"
	+"<param NAME='ShowControls' VALUE='1'>"
	+"<param NAME='ShowAudioControls' VALUE='1'>"
	+"<param NAME='ShowDisplay' VALUE='0'>"
	+"<param NAME='ShowTracker' VALUE='1'>"
	+"<param NAME='SendMouseClickEvents' value='1'>"
	+"<param NAME='ShowStatusBar' VALUE='1'>"
	+"<param NAME='EnableContextMenu' VALUE='0'>"
	+"<param NAME='EnablePositionControls' VALUE='1'>"
	+"<param NAME='ShowPositionControls' VALUE='1'>"
	+"<param NAME='DisplayBackColor' VALUE='0'>"
	+"<param NAME='ShowTracker' VALUE='1'>"
	+"<param NAME='SendOpenStateChangeEvents' VALUE='0'>"
	+"<param NAME='SendPlayStateChangeEvents' VALUE='0'>"
	+"<param NAME='ShowCaptioning' VALUE='0'>"
	+"<param NAME='Volume' value='-220'>"
	+"<param NAME='TransparentAtStart' value='1'>"
	+"<PARAM NAME='EnableFullScreenControls' VALUE='1'>"
	+"<embed TYPE='application/x-mplayer2' pluginspage='http://www.microsoft.com/korea/windows/windowsmedia/' filename='Mplayer' Name='Mplayer' ShowControls='1' ShowDisplay='0' ShowPositionControls='1' ShowTracker='1' Autoresize='0' ShowStatusBar='0' ClickToPlay='1' EnableFullScreenControls='1' SendKeyboardEvents='1' volume='-720' sendMouseClickEvents='1' SendMouseMoveEvents='0' width='320' height='280' src="+url+" type='video/x-ms-asf-plugin'></OBJECT>";
	document.write(str);
}

function urlmms(url){
	var str="<object ID='Mplayer' WIDTH='320' HEIGHT='280'  CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' VIEWASTEXT>"
	+"<param NAME='FileName' VALUE='"+url+"'>"
	+"<PARAM NAME='AnimationAtStart' value='0'>"
	+"<param NAME='CurrentPosition' VALUE='0'>"
	+"<param NAME='SetCurrentEntry' VALUE='1'>"
	+"<param NAME='ClickToPlay' VALUE='0'>"
	+"<PARAM NAME='AllowChangeDisplaySize' VALUE='1'>"
	+"<param NAME='AutoSize' VALUE='1'>"
	+"<param NAME='AutoStart' VALUE='1'>"
	+"<param NAME='AutoResize' VALUE='1'>"
	+"<param NAME='PreviewMode' VALUE='False'>"
	+"<param NAME='CursorType' value='1'>"
	+"<param NAME='ShowControls' VALUE='1'>"
	+"<param NAME='ShowAudioControls' VALUE='1'>"
	+"<param NAME='ShowDisplay' VALUE='0'>"
	+"<param NAME='ShowTracker' VALUE='1'>"
	+"<param NAME='SendMouseClickEvents' value='1'>"
	+"<param NAME='ShowStatusBar' VALUE='1'>"
	+"<param NAME='EnableContextMenu' VALUE='0'>"
	+"<param NAME='EnablePositionControls' VALUE='1'>"
	+"<param NAME='ShowPositionControls' VALUE='1'>"
	+"<param NAME='DisplayBackColor' VALUE='0'>"
	+"<param NAME='ShowTracker' VALUE='1'>"
	+"<param NAME='SendOpenStateChangeEvents' VALUE='0'>"
	+"<param NAME='SendPlayStateChangeEvents' VALUE='0'>"
	+"<param NAME='ShowCaptioning' VALUE='0'>"
	+"<param NAME='Volume' value='-220'>"
	+"<param NAME='TransparentAtStart' value='1'>"
	+"<PARAM NAME='EnableFullScreenControls' VALUE='1'>"
	+"<embed TYPE='application/x-mplayer2' pluginspage='http://www.microsoft.com/korea/windows/windowsmedia/' filename='Mplayer' Name='Mplayer' ShowControls='1' ShowDisplay='0' ShowPositionControls='1' ShowTracker='1' Autoresize='0' ShowStatusBar='0' ClickToPlay='1' EnableFullScreenControls='1' SendKeyboardEvents='1' volume='-720' sendMouseClickEvents='1' SendMouseMoveEvents='0' width='320' height='280' type='video/x-ms-asf-plugin'></OBJECT>";
	document.write(str);
}
*/


function urlmms(url){
	var str="<object ID='Mplayer' WIDTH='320' HEIGHT='280'  CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809' Standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' STYLE='position: left:0px; top:0px;'  VIEWASTEXT><param NAME='FileName' VALUE='"+url+"'><PARAM NAME='AnimationAtStart' value='0'><param NAME='CurrentPosition' VALUE='0'><param NAME='SetCurrentEntry' VALUE='1'><param NAME='ClickToPlay' VALUE='0'><PARAM NAME='AllowChangeDisplaySize' VALUE='1'><param NAME='AutoSize' VALUE='1'><param NAME='AutoStart' VALUE='1'> <param NAME='AutoResize' VALUE='1'><param NAME='PreviewMode' VALUE='False'><param NAME='CursorType' value='1'><param NAME='ShowControls' VALUE='1'><param NAME='ShowAudioControls' VALUE='1'><param NAME='ShowDisplay' VALUE='0'><param NAME='ShowTracker' VALUE='1'><param NAME='SendMouseClickEvents' value='1'><param NAME='ShowStatusBar' VALUE='1'><param NAME='EnableContextMenu' VALUE='0'><param NAME='EnablePositionControls' VALUE='1'><param NAME='ShowPositionControls' VALUE='1'><param NAME='DisplayBackColor' VALUE='0'><param NAME='ShowTracker' VALUE='1'><param NAME='SendOpenStateChangeEvents' VALUE='0'><param NAME='SendPlayStateChangeEvents' VALUE='0'><param NAME='ShowCaptioning' VALUE='0'><param NAME='Volume' value='-220'><param NAME='TransparentAtStart' value='1'><PARAM NAME='EnableFullScreenControls' VALUE='1'><embed TYPE='application/x-mplayer2'pluginspage='http://www.microsoft.com/korea/windows/windowsmedia/' filename='Mplayer' Name='Mplayer' ShowControls='1' ShowDisplay='0' ShowPositionControls='1' ShowTracker='1' Autoresize='0' ShowStatusBar='0'ClickToPlay='1'EnableFullScreenControls='1'SendKeyboardEvents='1'volume='-720'sendMouseClickEvents='1'SendMouseMoveEvents='0'width='320' height='280'></OBJECT>";
	document.write(str);
}
//http://web.pbc.co.kr/PBCMMS/obk7Qr3p7aRzI4HSfhyKR3wS6/BRD/

/* PLAYER */
//김수환추기경라이브캠 (TV)
function cardinalPlayer(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('http://pbc.co.kr/legacy/event/cardinal_ksh/cardinal_live_cast.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=450,height=690,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//인터넷이벤트라이브(TV,라디오)
function popPlayer(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('/home/PBC_LiveVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//비디오(TV,라디오)
function popPlayer(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('/home/PBC_VideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}
//오디오(TV,라디오)
function popPlayer_audio(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('/home/PBC_AudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//비디오(뉴스)
function popPlayer_news_video(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('/home/PBC_NewsVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//오디오(뉴스)
function popPlayer_news_audio(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) { //538
	window.open('/home/PBC_NewsAudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//비디오(온미디어)
function popPlayer_onmedia_video(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path, cat) { //538
	window.open('/home/PBC_OnMediaVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path+'&cat='+cat,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

//오디오(온미디어)
function popPlayer_onmedia_audio(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path, cat) { //538
	window.open('/home/PBC_OnMediaAudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path+'&cat='+cat,
		'player',"width=725,height=578,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

/* SELF */

//비디오(TV,라디오) - 본창 유지하고 내용바꾸기
function popPlayer_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) {
	top.location.href='/home/PBC_VideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path;
		
}

//오디오(TV,라디오) - 본창 유지하고 내용바꾸기
function popPlayer_audio_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) {
	top.location.href='/home/PBC_AudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path;
	
}
//비디오(뉴스) - 본창 유지하고 내용 바꾸기
function popPlayer_news_video_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) {
	top.location.href='/home/PBC_NewsVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path;
		
}

//오디오(뉴스) - 본창 유지하고 내용 바꾸기
function popPlayer_news_audio_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path) {
	top.location.href='/home/PBC_NewsAudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path;
	
}

//비디오(온미디어) - 본창 유지하고 내용 바꾸기
function popPlayer_onmedia_video_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path,cat) {
	top.location.href='/home/PBC_OnMediaVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path+'&cat='+cat;
		
}

//오디오(온미디어) - 본창 유지하고 내용 바꾸기
function popPlayer_onmedia_audio_self(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path,cat) {
	top.location.href='/home/PBC_OnMediaAudioPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path+'&cat='+cat;
	
}
 
function popBuyShortCoupon() {
	window.open('/home/C20.html?brdcode=<?=$brdcode?>&brdname=<?=$brdname?>&brdcode2=<?=urlencode($i)?>',
		'buy',
		"width=286,height=286,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=200");
}

//이벤트 비디오(김대건)
function popEventPlayer(brdcode, brdname, brdcode2, mms, speed, menu_fid, cid, path, c_index) { 
	window.open('/home/PBC_EventVideoPlayer.html?brdcode='+brdcode+'&brdname='+brdname+'&brdcode2='+brdcode2+'&mms='+mms+'&speed='+speed+'&menu_fid='+menu_fid+'&cid='+cid+'&path='+path+'&c_index='+c_index,
		'player',"width=725,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=false,top=100,left=200");
}

/*
아이프레임 리사이즈 소스
이형태
*/

function resizeFrame(iframeObj){ 
        var innerBody = iframeObj.contentWindow.document.body; 
        oldEvent = innerBody.onclick; 
        innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; }; 

        var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight); 
        iframeObj.style.height = innerHeight; 

        if( !arguments[1] )        
                this.scrollTo(1,1); 
 
}


/*
이미지 리사이즈 소스 사용법 : <img src='이미지주소' onload="imageResize(this, 리사이즈기준가로,리사이즈기준세로)"  onmouseover="imageResize(this,리사이즈기준가로,리사이즈기준세로);">
이형태
*/
function imageResize(img, max_w, max_h)  {  
var org_image = new Image();
org_image.src = img.src; 
w = max_w;
h = max_h;

if ((w < org_image.width)&& (h > org_image.height)) {
  resize_width=w; 
  resize_height=(org_image.height * w)/org_image.width; 
}
if ((w < org_image.width)&& (h < org_image.height)) {
  if ((org_image.width/org_image.height) > (w/h)) {
    resize_width = w;
    resize_height= (w * org_image.height)/org_image.width;
  } else if ((org_image.width/org_image.height) < (w/h)) {
    resize_height = h ;
    resize_width  =(h * org_image.width)/org_image.height;
  } 
}

if ((w < org_image.width)&& (h < org_image.height)&&(org_image.width == org_image.height )) {
   if ( w > h ) {
    resize_height = h ;
    resize_width  = h ;
   } else if ( w < h )  {
    resize_width  = w ;
    resize_height = w ;  
   }
}


if ((w > org_image.width)&& (h < org_image.height)) {
  resize_width=w;
  resize_height=(h * org_image.width)/org_image.height;
}
if ((w > org_image.width)&& (h > org_image.height) || (w == org_image.width)&& (h > org_image.height) || (w > org_image.width)&& (h == org_image.height)) {
  resize_width=org_image.width;
  resize_height=org_image.height;
}
if ((w < org_image.width)&& (h == org_image.height)) {
  resize_width=w;
  resize_height= ( w * org_image.height) / org_image.width  ;
}

if ((w == org_image.width)&& (h < org_image.height)) {
  resize_height=h;
  resize_width=(h * org_image.width)/org_image.height;
}


  img.width = resize_width ;
  img.height = resize_height ;

}

// 리사이징된 이미지를 클릭했을경우 원본 사이즈로 보여주기 위한 새창 2007년8월29일
    function image_window(img)
    {
        var w = img.tmp_width; 
        var h = img.tmp_height; 
        var winl = (screen.width-w)/2; 
        var wint = (screen.height-h)/3; 

        if (w >= screen.width) { 
            winl = 0; 
            h = (parseInt)(w * (h / w)); 
        } 

        if (h >= screen.height) { 
            wint = 0; 
            w = (parseInt)(h * (w / h)); 
        } 

        var js_url = "<script language='JavaScript1.2'> \n"; 
            js_url += "<!-- \n"; 
            js_url += "var ie=document.all; \n"; 
            js_url += "var nn6=document.getElementById&&!document.all; \n"; 
            js_url += "var isdrag=false; \n"; 
            js_url += "var x,y; \n"; 
            js_url += "var dobj; \n"; 
            js_url += "function movemouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  if (isdrag) \n"; 
            js_url += "  { \n"; 
            js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
            js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "function selectmouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
            js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
            js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
            js_url += "  } \n"; 
            js_url += "  if (fobj.className=='dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    isdrag = true; \n"; 
            js_url += "    dobj = fobj; \n"; 
            js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
            js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
            js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
            js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
            js_url += "    document.onmousemove=movemouse; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "document.onmousedown=selectmouse; \n"; 
            js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
            js_url += "//--> \n"; 
            js_url += "</"+"script> \n"; 

        var settings;

            settings  ='width='+(w+10)+','; 
            settings +='height='+(h+10)+','; 
      
       
        settings +='top='+wint+','; 
        settings +='left='+winl+','; 
        settings +='scrollbars=no,'; 
        settings +='resizable=yes,'; 
        settings +='status=no'; 


        win=window.open("","image_window",settings); 
        win.document.open(); 
        win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset=utf-8'>\n"); 
        var size = "이미지 사이즈 : "+w+" x "+h;
        win.document.write ("<title>"+size+"</title> \n"); 
        if(w >= screen.width || h >= screen.height) { 
            win.document.write (js_url); 
            var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n 이미지 사이즈가 화면보다 큽니다. \n 왼쪽 버튼을 클릭한 후 마우스를 움직여서 보세요. \n\n 더블 클릭하면 닫혀요. '"; 
        } 
        else 
            var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n 클릭하면 닫혀요. '"; 
        win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
        win.document.write ("</head> \n\n"); 
        win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
        win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
        win.document.write ("</body></html>"); 
        win.document.close(); 

        if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
    }

    // a 태그에서 onclick 이벤트를 사용하지 않기 위해
    function win_open(url, name, option)
    {
        var popup = window.open(url, name, option);
        popup.focus();
    }
// 리사이징된 이미지를 클릭했을경우 원본 사이즈로 보여주기 위한 새창 여기까지

// 라디오 바로가기 스크립터
function change(form) { 
  if(form.GoUrl.selectedIndex !=0){
  location.href=form.GoUrl.options[form.GoUrl.selectedIndex].value
  }
  form.GoUrl.selectedIndex = 0
  } 
