﻿<!--

/* 온미디어 각종 자바스크립트 Function */
/* 작성자 : 이경은                               */
/* 최초작성일 : 2006.08.02                    */


/* 이미지 온오버 */
var top_Navi_on = ""; //초기 on 상태 objName

// ImgRollOver(오브젝트명, 초기온이미지)
function ImgRollOver_topNavi_init(objName, imgName)
{
	ImgRollOver_topNavi(objName, imgName);
	top_Navi_on = objName;

}

// ImgRollOver(오브젝트명, 바뀔이미지)
function ImgRollOver_topNavi(objName, imgName)
{
	//alert(top_Navi_on+","+objName);
	if ( eval("document."+objName) && top_Navi_on != objName )
	{
		obj = eval("document.all."+objName);

		obj.src = imgName;
	}

}

function OpenWin(dest,title,scroll,width,height,top,left)
{
   window.open(dest,title, "scrollbars="+scroll+",toolbar=no,location=no,directories=no,status=no,width="+width+",height="+height+",resizable=no,menubar=no,top="+top+",left="+left+"");
}

// 가운데 팝업 띄우기
function NewWindow(mypage,myname,w,h,scroll){
	var win = null;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}


// 회원정보 팝업
function memInfoPop(jumin)
{

	NewWindow("/member/member_info.php?tmax_jumin="+jumin,"_memberInfo",560,610,0)
}

function viewer(imgStr,w,h)
{
	document.write(viewerStr(imgStr,w,h));
}

	function doPreViewPhoto()
	{
       if(document.frmReg.photo.value !=""){
		  //document.frmReg.dfPhotoIdx.value = "";
	      document.all.introPhoto.src = document.frmReg.photo.value;
		}
	}


// 플래쉬, 이미지 보이기
function viewerStr(imgStr,w,h)
{
	width_str = "";
	height_str = "";
	dot_cnt = imgStr.lastIndexOf(".");
	ext = (imgStr.substring(dot_cnt+1)).toLowerCase();

	if ( ext == "jpg" || ext=="jpge" || ext=="gif" || ext=="png" )
	{
		if ( w > 0 )	width_str = "width='"+w+"' ";
		if( h> 0) height_str = " height='"+h+"' ";
		retStr = "<img src=\""+imgStr+"\" "+width_str+height_str+" border=0 align=absmiddle>";
	} else if ( ext == "swf" )
	{
		id = ""
		vars = ""
		bg = ""
		win = "transparent"
		if(w==0) w = 200;
		if(h==0) h=200;
			// 플래시 코드 정의
		var retStr=
		"<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+"' id='"+id+"' align='middle'>"+
		"<param name='allowScriptAccess' value='always' />"+
		"<param name='movie' value='"+imgStr+"' />"+
		"<param name='FlashVars' value='"+vars+"' />"+
		"<param name='wmode' value='"+win+"' />"+
		"<param name='menu' value='false' />"+
		"<param name='quality' value='high' />"+
		"<param name='bgcolor' value='"+bg+"' />"+
		"<embed src='"+imgStr+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
		"</object>";
	}

	return retStr;
}


// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드)
function flashWrite(url,w,h,id,bg,vars,win){

	// 플래시 코드 정의
	var flashStr=
	"<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+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);

}

// 레이어 show hide

if (document.all) {
  layerview='document.all'
  styleview='.style.'
} else if (document.layers) {
  layerview='document.layers'
  styleview='.'
}
function show(p){
  eval(layerview+'.'+p+styleview+'visibility="visible"');
}
function hide(p){
  eval(layerview+'.'+p+styleview+'visibility="hidden"');
}



// 인코더
function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '"
                        + ch
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return encoded;
}

// 디코더
function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2)
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
}

// 쿠키굽기
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}




function AllTrim(a)
{
	for (; a.indexOf(" ") != -1 ;)
  {
  	a = a.replace(" ","")
  }
  return a;
}



// 이미지 사이즈 줄이기
function img_resize(objName,objWidth)
{
	if(typeof(document.all.item[objName]) != 'undefined'){
		if ( typeof(document.all.item[objName].length) != 'undefined')
		{
			for(i=0;i<document.all.item[objName].length;i++)
			{
				width = document.all.item[objName][i].width;
				if ( width > objWidth ) { document.all.upimg[i].width = objWidth; }
			}
		} else {
				width = document.all.upimg.width;
				if ( width > objWidth ) { document.all.upimg.width = objWidth; }
		}
	}
}



// 전체박스 선택
//allCheckBox_flag = true;
function allCheckBox(obform, obname, chname)
{
    flag = obform[chname].checked;

	var obj = obform[obname];


	array_sum = IsArray(obform,obname);

	if ( array_sum>1 )
	{
		for( var i=0; i<obj.length; i++) {
			obj[i].checked = flag;
		}
	} else if (array_sum == 1){
		obform[obname].checked = flag;
	} else  {
	}

    return;
}


//배열유무 체크
function IsArray(obj, str)
{
    var len = obj.elements.length;
    var sum = 0;

    for (var i=0; i<len; ++i)
    {
        if (obj.elements[i].name == str)
        {
            ++sum;
        }
    }

    return sum;
}

function mediaPlay(mUrl,mId,mWidth,mHeight,autostart)
{
	var movieWrite = "";
	movieWrite = " <OBJECT id='"+mId+"' name='"+mId+"' hideFocus style='LEFT: 0px; WIDTH: "+mWidth+"px; TOP: 0px; HEIGHT: "+mHeight+"px' type=application/x-oleobject standby='Microsoft Windows Media Player 구성요소를 읽는중입니다.' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6  VIEWASTEXT >"
	movieWrite = movieWrite + " <PARAM NAME='URL' VALUE='"+mUrl+"'>            "
	movieWrite = movieWrite + " <PARAM NAME='rate' VALUE='1'>                     "
	movieWrite = movieWrite + " <PARAM NAME='DisplaySize' VALUE='4'>              "
	movieWrite = movieWrite + " <PARAM NAME='balance' VALUE='0'>                  "
	movieWrite = movieWrite + " <PARAM NAME='currentPosition' VALUE='4.315449'>   "
	movieWrite = movieWrite + " <PARAM NAME='defaultFrame' VALUE='0'>             "
	movieWrite = movieWrite + " <PARAM NAME='playCount' VALUE='1'>                "
	movieWrite = movieWrite + " <PARAM NAME='autoStart' VALUE='"+autostart+"'>                "
	movieWrite = movieWrite + " <PARAM NAME='currentMarker' VALUE='0'>            "
	movieWrite = movieWrite + " <PARAM NAME='invokeURLs' VALUE='-1'>              "
	movieWrite = movieWrite + " <PARAM NAME='baseURL' VALUE=''>                   "
	movieWrite = movieWrite + " <PARAM NAME='volume' VALUE='80'>                  "
	movieWrite = movieWrite + " <PARAM NAME='uiMode' VALUE='none'>                "
	movieWrite = movieWrite + " <PARAM NAME='stretchToFit' VALUE='0'>             "
	movieWrite = movieWrite + " <PARAM NAME='windowlessVideo' VALUE='0'>          "
	movieWrite = movieWrite + " <PARAM NAME='enabled' VALUE='-1'>                 "
	movieWrite = movieWrite + " <PARAM NAME='enableContextMenu' VALUE='0'>        "
	movieWrite = movieWrite + " <PARAM NAME='fullScreen' VALUE='0'>               "
	movieWrite = movieWrite + " <PARAM NAME='SAMIStyle' VALUE=''>                 "
	movieWrite = movieWrite + " <PARAM NAME='SAMILang' VALUE=''>                  "
	movieWrite = movieWrite + " <PARAM NAME='SAMIFilename' VALUE=''>              "
	movieWrite = movieWrite + " <PARAM NAME='captioningID' VALUE=''>              "
	movieWrite = movieWrite + " <PARAM NAME='enableErrorDialogs' VALUE='0'>       "
	movieWrite = movieWrite + " <PARAM NAME='_cx' VALUE='0'>                      "
	movieWrite = movieWrite + " <PARAM NAME='_cy' VALUE='0'>                      "
	movieWrite = movieWrite + " <PARAM NAME='ShowDisplay' value='true'>           "
	movieWrite = movieWrite + " <PARAM NAME='ShowControls' value='true'>          "
	movieWrite = movieWrite + " <PARAM NAME='ShowTracker' value='True'>           "
	movieWrite = movieWrite + " </OBJECT> "
	document.write(movieWrite);
	//return movieWrite;
}

function mediaPlay3(mUrl,mId,mWidth,mHeight){
	var movieWrite = "";
	movieWrite = "<embed src='"+mUrl+"' AutoStart='true' ShowTracker='true' ShowControls='true' ShowGotoBar='false' ShowDisplay='false' ShowStatusBar='false' AutoSize='false' Loop='true' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='"+mWidth+"' height='"+mHeight+"'></embed></object>"
	document.write(movieWrite);
}


function imgview(img_name){
		window.open("/zhdhwmdmep_kj/pop_img.asp?img="+img_name, "bigphotoremote","toolbar=no,menubar=no,width=1,HEIGHT=1, left=100, top=100");
}

function mediaMovie(playUrl)
{
	document.write (" <OBJECT id=objMUSIC hideFocus style='LEFT: 0px; WIDTH: 320px; TOP: 0px; HEIGHT: 240px' type=application/x-oleobject standby='Microsoft Windows Media Player 구성요소를 읽는중입니다.' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 name=objMUSIC VIEWASTEXT AutoStart='1'>");
	document.write (" <PARAM NAME='URL' VALUE='"+playUrl+"'>            ");
	document.write (" <PARAM NAME='rate' VALUE='1'>                     ");
	document.write (" <PARAM NAME='balance' VALUE='0'>                  ");
	document.write (" <PARAM NAME='currentPosition' VALUE='4.315449'>   ");
	document.write (" <PARAM NAME='defaultFrame' VALUE='0'>             ");
	document.write (" <PARAM NAME='playCount' VALUE='1'>                ");
	document.write (" <PARAM NAME='autoStart' VALUE='1'>                ");
	document.write (" <PARAM NAME='currentMarker' VALUE='0'>            ");
	document.write (" <PARAM NAME='invokeURLs' VALUE='-1'>              ");
	document.write (" <PARAM NAME='baseURL' VALUE=''>                   ");
	document.write (" <PARAM NAME='volume' VALUE='80'>                  ");
	document.write (" <PARAM NAME='uiMode' VALUE='none'>                ");
	document.write (" <PARAM NAME='stretchToFit' VALUE='0'>             ");
	document.write (" <PARAM NAME='windowlessVideo' VALUE='0'>          ");
	document.write (" <PARAM NAME='enabled' VALUE='-1'>                 ");
	document.write (" <PARAM NAME='enableContextMenu' VALUE='0'>        ");
	document.write (" <PARAM NAME='fullScreen' VALUE='0'>               ");
	document.write (" <PARAM NAME='SAMIStyle' VALUE=''>                 ");
	document.write (" <PARAM NAME='SAMILang' VALUE=''>                  ");
	document.write (" <PARAM NAME='SAMIFilename' VALUE=''>              ");
	document.write (" <PARAM NAME='captioningID' VALUE=''>              ");
	document.write (" <PARAM NAME='enableErrorDialogs' VALUE='0'>       ");
	document.write (" <PARAM NAME='_cx' VALUE='0'>                      ");
	document.write (" <PARAM NAME='_cy' VALUE='0'>                      ");
	document.write (" <PARAM NAME='ShowDisplay' value='true'>           ");
	document.write (" <PARAM NAME='ShowControls' value='true'>          ");
	document.write (" <PARAM NAME='ShowTracker' value='True'>           ");
	document.write (" </OBJECT> ");
}


function moneyPoint(str){ //함수형
 str = parseInt(str,10);
 str = str.toString().replace(/[^-0-9]/g,'');
 while(str.match(/^(-?\d+)(\d{3})/)) {
        str = str.replace(/^(-?\d+)(\d{3})/, '$1,$2');
    }
 return str;
}


function trim(str) {
    return str.replace(/(^\s*)|(\s*$)/g, "");
}

function getNumber(str) {
    str = "" + str.replace(/,/gi,''); // 콤마 제거
    str = str.replace(/(^\s*)|(\s*$)/g, ""); // trim
    return (new Number(str));
}
//////////////////////////////////////////

//radio value값 가져오기
function getRadio(objName)
{
	obj = document.all.item(objName);
	val = "";
	if ( obj[0].type == "radio" )
	{
		for(j=0;j<obj.length;j++)
		{
			if ( obj[j].checked ) { val = obj[j].value; break; }
		}
	} else {
		val = obj.value;
	}
	return val;

}


function makeFileInput(obj_name, img, size, op)
{
		f_str = "<div style='position:absolute;'> "
		f_str += "<input name='"+ obj_name +"' type='file'  style='filter:alpha(opacity:0);width:"+( size + 95 )+";' "+op+"> "
		f_str += "</div> "
		f_str += "<input name='"+ obj_name +"_v' type='text' style='width:"+ size +"; height:20' value='' readonly> "
		f_str += "<img src='"+img +"' align='absmiddle'> "

		document.write(f_str);
}


//레이어 팝업
function layerPopup(id,img,x,y,link)
{
	document.write("<div id='layer_pop_"+id+"' style='position:absolute; left:"+x+"; top:"+y+"; z-index:100;'>");
	document.write("<table border=0 cellspacing=1 cellpadding=0 bgcolor=#000000>");
	document.write("<tr bgcolor=#ffffff>");
	document.write("	<td>");
	if ( link != "" )
	{
		document.write("		<a href='javascript:gogo(\""+link+"\")' title='바로가기'>");
	}
	document.write("<img src='"+img+"'  name='_img' border=0 ></a></td>");
	document.write("</tr>");
	document.write("<tr bgcolor=#ffffff>");
	document.write("	<td height=30 bgcolor=#000000>");
	document.write("	<table width=100% cellspacing=0 cellpadding=0><tr>");
	document.write("	<td><a href=javascript:todayClose('"+id+"')><font color=white>&nbsp;오늘 하루 이창을 열지 않기</a></td>");
	document.write("	<td align=right><a href=javascript:popClose('"+id+"')><font color=white>[닫기]</a>&nbsp;</td>");
	document.write("</tr></table>");
	document.write("	</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</div>");

}
//레이어 팝업 new
function layerPopupNew(id,x,y)
{
	document.write("<div id='layer_pop_"+id+"' style='position:absolute; left:"+x+"; top:"+y+"; z-index:100;'>");
	document.write("<table border=0 cellspacing=1 cellpadding=0 bgcolor=#000000>");
	document.write("<tr bgcolor=#ffffff>");
	document.write("	<td>");
	document.write(document.getElementById("pop_"+id).innerHTML);
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr bgcolor=#000000>");
	document.write("	<td height=30 bgcolor=#000000>");
	document.write("	<table width=100% cellspacing=0 cellpadding=0><tr>");
	document.write("	<td><a href=javascript:todayClose('"+id+"')><font color=white>&nbsp;오늘 하루 이창을 열지 않기</a></td>");
	document.write("	<td align=right><a href=javascript:popClose('"+id+"')><font color=white>[닫기]</a>&nbsp;</td>");
	document.write("</tr></table>");
	document.write("	</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</div>");

}



function todayClose(seq)
{
	setCookie("pop_"+seq,"close",1);
	popClose(seq);
}

function popClose(seq)
{
	document.getElementById("layer_pop_"+seq).style.display = "none";
}


function gogo(link)
{
	location.href = link;
}

function NewWindow(mypage,myname,w,h,scroll){
	var win = null;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}

function callme(msg){
	var popWin = window.createPopup();
	var tot_msg, msg1, msg2, msg;
	msg1 = "<DIV STYLE='background:#ffffcc; border:1px solid black; padding:4px; width:170px; font-family:verdana; font-size:100%; '>";
	msg2 = "</DIV>";
	tot_msg = msg1 + msg + msg2;
	
	 popWin.document.body.innerHTML = tot_msg;
    
    var popupBody = popWin.document.body;
    popWin.show(0, 0, 170, 50);
    var realHeight = popupBody.scrollHeight;
    popWin.hide();
    popWin.show(30, 10 , 170, realHeight, event.srcElement);
}

/*아래부터는 플래시위에 플래시 레이어 유동 소스 추가했습니다 - 10.08.16인식 */
ns = (document.layers)? true:false
  ie = (document.all)? true:false

sc_c = 0;
sc_top = 0;
sc_mode = "";

function show(id) { 
	
	sc_mode = "down";
	sc_c = 30;
	sc_top = -344
	document.getElementById(id).style.top = sc_top;
	menu_sscroll();

} 
 
function hide(id) { 

	sc_mode = "up";
	sc_c = 30;
	sc_top = 0
	document.getElementById(id).style.top = sc_top;
	menu_sscroll();

} 


function menu_sscroll()
{
	sc_c -= 1;
	if ( sc_mode == "down")
	{
		sc_top += sc_c;
		document.getElementById("apDiv1").style.top = sc_top;

		if ( sc_top < 0)
		{
			sswitch = true;
		} else {
			sswitch = false;
			document.getElementById("apDiv1").style.top = 0;	
		}

	} else if ( sc_mode == "up" )
	{
		sc_top -= sc_c;
		document.getElementById("apDiv1").style.top = sc_top;
		if ( sc_top > -344)
		{
			sswitch = true;
		} else {
			sswitch = false;
			document.getElementById("apDiv1").style.top = -344;
		}

	}

	if (sswitch) { setTimeout("menu_sscroll()",10); }
}

 

  function openallview(num)
  {
       if(num==1) 
       {
			 show('apDiv1')
       }
       else if(num==2) 
       {
            hide('apDiv1')
       }

  return true;
  }


  function rss_popup(vill)
  {
	window.open("/1011season/etc/0930_rss.asp?vb_vill="+vill,"_rss_popup","width=691, height=527");
  }
//-->



