//-------------------------------------------------------------------------
//Menubar
//-------------------------------------------------------------------------
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];}
}

//-------------------------------------------------------------------------
//Add Bookmark
//-------------------------------------------------------------------------
function fncBookmark()
{
	var strUrl="http://www.cnopartner.com";
	var strTitle="(ÁÖ)¾¾¿£¿ÀÆÄÆ®³ÊÁî";
	if (document.all)
	window.external.AddFavorite(strUrl,strTitle);
}
//-------------------------------------------------------------------------
//Login
//-------------------------------------------------------------------------
function fncInit() {
	frmData.txtID.focus();
}
function fncKeyCheck(flag){
	if(event.keyCode == 13){
		event.returnValue = false
		fncSubmit(flag);
	}
}
function fncSubmit(flag) {
	var strFrm = document.frmData;
	if(strFrm.txtID.value == "") {alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä"); strFrm.txtID.focus(); return;}
	if(strFrm.txtPWD.value == "") {alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä"); strFrm.txtPWD.focus(); return;}
	else{
		if(flag=="U") { strFrm.action = "/UTL/MEM/actLogin.asp";strFrm.submit(); }
		else if(flag=="A") { strFrm.action = "/actLogin.asp";strFrm.submit(); }
		else {alert("Àß¸øµÈ °ªÀÌ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");}
	}
}
//-------------------------------------------------------------------------
//BBS
//-------------------------------------------------------------------------
function fncSearch() {
	var strFrm = document.frmSearch;
		
	if (strFrm.fKeyword.value == "") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		strFrm.fKeyword.focus();
		return;
	}
	else {
		strFrm.action = "boardList.asp";
		strFrm.submit();
	}
}
//BBS Write
function fncWrite()
{
	var strFrm = document.frmBoard;
	if (strFrm.fTitle.value == "")
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		strFrm.fTitle.focus();
		return;
	}
	else if (strFrm.fContents.value == "")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		strFrm.fContents.focus();
		return;
	}
	else
	{
		strFrm.action = "boardWriteDo.asp";
		strFrm.submit();
	}
}
//BBS Edit
function fncEdit() 
	{
	var strFrm = document.frmBoard;

		if (strFrm.fTitle.value == "") {
			alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
			   strFrm.fTitle.focus();
			   return;
		}
		if (strFrm.fContents.value == "" ) {
			alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
			   strFrm.fContents.focus();
			   return;
		} 
			strFrm.action = "boardEditDo.asp";
			strFrm.submit();
	}
//BBS Delete
function fncDel(fQuery)
{
	var msg = "\nÁ¤¸» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?";
	if (confirm(msg) == 1)
	{
		targetUrl = "boardDelDo.asp" + fQuery;
		location.href = targetUrl;
	}
}
//Comment Write
function fncComWrite()
{
	var strFrm = document.frmBoard;
	if (strFrm.fContents.value == "")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		strFrm.fContents.focus();
		return;
	}
	else
	{
		strFrm.action = "boardComWriteDo.asp";
		strFrm.submit();
	}
}
//Comment Delete
function fncComDel(fQuery)
{
	var msg = "\nÁ¤¸» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?";
	if (confirm(msg) == 1)
	{
		targetUrl = "boardComDelDo.asp" + fQuery;
		location.href = targetUrl;
	}
}
//Comment Display
function fncDisplay(trID)
{
	if (document.all[trID].style.display=="none")
	{
		document.all[trID].style.display=""
	}
	else
	{
		document.all[trID].style.display='none';
	}
}
//Comment Write : FreeBoard
function fncComWrite2(trID,fNum)
{
	var strFrm = document.frmBoard;
	if (document.all[trID].value == "")
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.all[trID].focus();
		return;
	}
	else
	{
		strFrm.fContents.value=document.all[trID].value;
		strFrm.fNum.value=fNum;
		strFrm.action = "boardComWriteDo.asp";
		strFrm.submit();
	}
}
//Poll Check
function fncPollChk(){
	var objRadio = document.forms["frmPoll"]["fPoll"];
	var flg = false;
	for(var i=0 ; i<objRadio.length; i++){
		if( objRadio[i].checked == true){
			flg = true;
			break;
		}
		else{
			flg = false;
		}
	}
	if(flg==true){
		document.frmPoll.action = "/COM/POLL/boardPollWriteDo.asp";
		document.frmPoll.submit();
	}
	else{
		alert("\n´äº¯À» ¼±ÅÃÇØ ÁÖ¼¼¿ä.\n");
		return;
	}
}
//Poll Check2 : MainPage
function fncPollChk2(){
	var objRadio = document.forms["frmPoll"]["fPoll"];
	var flg = false;
	for(var i=0 ; i<objRadio.length; i++){
		if( objRadio[i].checked == true){
			flg = true;
			break;
		}
		else{
			flg = false;
		}
	}
	if(flg==true){
		document.frmPoll.action = "/COM/POLL/boardPollWriteDo.asp";
		document.frmPoll.submit();
	}
	else{
		document.frmPoll.action = "/COM/POLL/boardList.asp";
		document.frmPoll.submit();
	}
}
/*--------------------------------------------------------------------------------*/
//Check : Input Value
/*--------------------------------------------------------------------------------*/	
	/*[fnc_null_check]*/
	function fnc_null_check(str_value,str_msg,str_focus) {
		if(str_value=="") {
			alert(str_msg);
			if(str_focus!="") { str_focus.focus(); }
			return false;
		}
		else {  return true;  }
	}

	/*[fnc_specialword_check]*/
	function fnc_specialword_check (str_value,str_msg,str_focus) {
		if (str_value.search(/[$!#%|\\@\\\#%\^\&\*\(\)\[\]\+\{\}\`.\~\=\|]/) != -1) {
			alert(str_msg);
			str_focus.focus();
			return false;
		}
		else {  return true;  }
	}
	
	/*[fnc_idval_check]*/
	function fnc_idval_check (str_value,str_msg,str_focus) {
		var ch,str_yn="y";
		for (var i=0; i<str_value.length; i++) {
			ch = str_value.charAt(i);
			if ( !(ch >= 'a' && ch <= 'z') && !(ch >= '0' && ch <= '9') && ch != '-' && ch != '_' ) {
				str_yn = "n";
				break;
			}
		}
		if (str_yn=="n") {
			alert(str_msg);
			str_focus.focus();
			return false;
		}
		else {  return true;  }
	}
	
	/*[fnc_abcnumword_check]*/
	function fnc_abcnumword_check (str_value,str_msg,str_focus) {
		if (str_value.search(/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]/) != -1) {
			alert(str_msg);
			str_focus.focus();
			return false;
		}
		else {  return true;  }
	}
	
	/*[fnc_number_check]*/
	function fnc_number_check(str_value,str_msg,str_focus) {
	  	for (var j = 0 ; j < str_value.length; j++) {
		  		if (str_value.substring(j, j + 1) != "0" && str_value.substring(j, j + 1) != "1" &&
				    str_value.substring(j, j + 1) != "2" && str_value.substring(j, j + 1) != "3" &&
				    str_value.substring(j, j + 1) != "4" && str_value.substring(j, j + 1) != "5" &&
				    str_value.substring(j, j + 1) != "6" && str_value.substring(j, j + 1) != "7" &&
				    str_value.substring(j, j + 1) != "8" && str_value.substring(j, j + 1) != "9") {
					alert(str_msg);
					str_focus.focus();
					return false;
					break;
				   }
		}
		return true;
	 }
	 
	/*[fnc_junmin_check]*/
	//str_value´Â 13ÀÚ¸® (str_frm.fJumin1.value + str_frm.fJumin2.value)
	function fnc_junmin_check (str_value,str_msg,str_focus) {
		var sum=0;
		for(i=0;i<8;i++) { sum+=str_value.substring(i,i+1)*(i+2); }
		for(i=8;i<12;i++) { sum+=str_value.substring(i,i+1)*(i-6); }
			sum = 11 - (sum%11);
		if (sum>=10) { sum-=10; }
			if (str_value.substring(12,13) != sum || (str_value.substring(6,7) !=1 && str_value.substring(6,7) != 2)) {
			alert(str_msg);
			str_focus.focus();
			return false;
		}
		else {  return true;  }
	}
//-------------------------------------------------------------------------
//Media Object
//-------------------------------------------------------------------------
  function setMedia(src, Ow, Oh, Pw, Ph) {
	  var Media_html = "";
	  Media_html += '<OBJECT id=MPlay1 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 ';
	  Media_html += '    type=application/x-oleobject height='+Oh+'';
	  Media_html += '    standby="Loading Microsoft Windows Media Player components..." width='+Ow+' ';
	  Media_html += '    classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95>';
	  Media_html += '   <PARAM NAME="Width" VALUE="'+Pw+'">';
	  Media_html += '   <PARAM NAME="Height" VALUE="'+Ph+'">';
	  Media_html += '   <PARAM NAME="FileName" VALUE="'+src+'">';
	  Media_html += '   <PARAM NAME="Volume" VALUE="500">';
	  Media_html += '   <PARAM NAME="AnimationatStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="AutoSize" VALUE="0">';
	  Media_html += '   <PARAM NAME="TransparentatStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="ControlType" VALUE="1">';
	  Media_html += '   <PARAM NAME="EnableContextMenu" VALUE="0">';
	  Media_html += '   <PARAM NAME="EnablePositionControls" VALUE="0">';
	  Media_html += '   <PARAM NAME="ShowTracker" VALUE="1">';
	  Media_html += '   <PARAM NAME="AutoStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="ShowControls" VALUE="1">';
	  Media_html += '   <PARAM NAME="ClickToPlay" VALUE="1">';
	  Media_html += '   </OBJECT>';
	  document.write(Media_html);
  }
//-------------------------------------------------------------------------
//Media Object
//-------------------------------------------------------------------------
  function setMedia2(src, Ow, Oh, Pw, Ph) {
	  var Media_html = "";
	  Media_html += '<OBJECT id=MPlay1 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 ';
	  Media_html += '    type=application/x-oleobject height='+Oh+'';
	  Media_html += '    standby="Loading Microsoft Windows Media Player components..." width='+Ow+' ';
	  Media_html += '    classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95>';
	  Media_html += '   <PARAM NAME="Width" VALUE="'+Pw+'">';
	  Media_html += '   <PARAM NAME="Height" VALUE="'+Ph+'">';
	  Media_html += '   <PARAM NAME="FileName" VALUE="'+src+'">';
	  Media_html += '   <PARAM NAME="Volume" VALUE="-1300">';
	  Media_html += '   <PARAM NAME="AnimationatStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="AutoSize" VALUE="0">';
	  Media_html += '   <PARAM NAME="TransparentatStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="ControlType" VALUE="1">';
	  Media_html += '   <PARAM NAME="EnableContextMenu" VALUE="0">';
	  Media_html += '   <PARAM NAME="EnablePositionControls" VALUE="0">';
	  Media_html += '   <PARAM NAME="ShowTracker" VALUE="0">';
	  Media_html += '   <PARAM NAME="AutoStart" VALUE="1">';
	  Media_html += '   <PARAM NAME="ShowControls" VALUE="1">';
	  Media_html += '   <PARAM NAME="ClickToPlay" VALUE="1">';
	  //Media_html += '   <PARAM NAME="Loop" VALUE="1">';
	  //Media_html += '   <PARAM NAME="PlayCount" VALUE="1">';
	  Media_html += '   </OBJECT>';
	  document.write(Media_html);
  }

function  openFlash(src,width,height){
	var tmpHtml = '';
	tmpHtml += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+width+'" height="'+height+'">'
	tmpHtml += '	<param name="movie" value="'+src+'">'
	tmpHtml += '    <param name="wmode" value="transparent">'
	tmpHtml += '    <embed src="'+src+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>'
	tmpHtml += '</object>'
	document.write(tmpHtml);
}

//-------------------------------------------------------------------------
//Window.open : Free Single VOD
//-------------------------------------------------------------------------
function fncWinOpen1(url) {
	var win = window.open(url,"vodSamplePlayer","toolbar=no,menubar=no,scrollbars=no,resizable=no,width=689,height=558");
	win.focus();
}
//-------------------------------------------------------------------------
//Window.open : Free Multy VOD
//-------------------------------------------------------------------------
function fncWinOpen2(url) {
	var win = window.open(url,"vodViewer","toolbar=no,menubar=no,scrollbars=no,width=689,height=558");
	win.focus();
}
//-------------------------------------------------------------------------
//Window.open : Normol
//-------------------------------------------------------------------------
function fncWinOpen3(url) {
	window.open(url);
}

//-------------------------------------------------------------------------
//³×ºñ°ÔÀÌ¼Ç
//-------------------------------------------------------------------------
  //  ³×ºñ°ÔÀÌ¼Ç ¾Æ¿ô½Ã ÃÖ¼Ò ³ôÀÌ °ª 
  var _minHeight = 30;
  //  ³×ºñ°ÔÀÌ¼Ç ¿À¹ö½Ã ÃÖ´ë ³ôÀÌ°ª 
  var _maxHeight = 144;
  var _tmpHeight;
  var _timerID;

  function getFlashNavigationHeight(_mouseStatus,_height){
//	  alert("bb");
    if(_mouseStatus=="over"){
      clearTimeout(_timerID);
      document.all.apDiv1.style.height=_maxHeight;
    }else{
      _tmpHeight = _maxHeight;
      _timerID = setTimeout("slideClose()", 1000);
    }
  }

  function slideClose(){
      document.all.apDiv1.style.height=_minHeight;
      clearTimeout(_timerID);
  }
