String.prototype.trim = function (){return this.replace(/^ *| *$/g, "");}

 


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_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 form_submit(){
	document.getElementById("form_btn_1").style.display = "none";
	document.getElementById("form_btn_2").style.display = "";
}

function img_erro(obj,img){
	obj.src = img;
}

function n_format(rightchar){
	var moneychar="";
	var rightchar=String(rightchar);
	for(index=rightchar.length-1;index>=0;index--){
		splitchar=rightchar.charAt(index);
		moneychar=splitchar+moneychar;
		if(index%3==rightchar.length%3&&index!=0){ moneychar=','+moneychar; }
	}
	return moneychar;
}

function show_table(obj,chk){
	var obj=document.getElementById(obj);
	(chk) ? obj.style.display="" : obj.style.display="none"
}

//아이프레임 자동 크기 조절 설정
function reSize() {
    try {
        var objBody = auto_iframe.document.body;
        var objFrame = document.all["auto_iframe"];
        ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
        objFrame.style.height = ifrmHeight;
    }
        catch(e) {}
}

function init_iframe() {
    reSize();
    setTimeout('init_iframe()',1)
}


//숫자만 입력
function SetNum(obj){
	val=obj.value;
	re=/[^0-9]/gi;
	obj.value=val.replace(re,"");
}

//숫자검색
function numcheck(check_num) {
	var inText = check_num.value;
	var ret;
	for (var i=0; i<inText.length; i++) {
		ret = inText.charCodeAt(i);
		if ((ret<48) || (ret>57))	return true;
	}
	return false;
}

function viewFlash(URL,mode,wid,hei) 
{
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>");
	document.write("<param name='movie' value='"+URL+"'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='WMODE' value='"+mode+"'>");
	document.write("<embed src='"+URL+"' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>");
	document.write("</object>");
}

function pre_viewFlash(URL,mode,wid,hei) 
{
	data="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>";
	data+="<param name='movie' value='"+URL+"'>";
	data+="<param name='quality' value='high'>";
	data+="<param name='WMODE' value='"+mode+"'>";
	data+="<embed src='"+URL+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>";
	data+="</object>";
	return data;
}

function media(file,w,h,auto,cont,state){
	if(h!="") h= "height="+h;

	document.write ('<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="'+w+'" '+h+'  id="movie">');
	document.write ('<PARAM NAME="Filename" VALUE="'+file+'">');
	document.write ('<param name="ClickToPlay" value="false">');
	document.write ('<param name="AutoSize" value="true">');
	document.write ('<param name="AutoStart" value="'+auto+'">');
	document.write ('<param name="ShowControls" value="'+cont+'">');
	document.write ('<param name="ShowAudioControls" value="false">');
	document.write ('<param name="ShowDisplay" value="0">');
	document.write ('<param name="ShowTracker" value="1">');
	document.write ('<param name="ShowStatusBar" value="'+state+'">');
	document.write ('<param name="EnableContextMenu" value="false">');
	document.write ('<param name="ShowPositionControls" value="false">');
	document.write ('<param name="ShowCaptioning" value="false">');
	document.write ('<param name="AutoRewind" value="true">');
	document.write ('<param name="Enabled" value="true">');
	document.write ('<param name="EnablePositionControls" value="true">');
	document.write ('<param name="EnableTracker" value="true">');
	document.write ('<param name="PlayCount" value="1">');
	document.write ('<param name="SendWarningEvents" value="true">');
	document.write ('<param name="SendErrorEvents" value="true">');
	document.write ('<param name="SendKeyboardEvents" value="false">');
	document.write ('<param name="SendMouseClickEvents" value="false">');
	document.write ('<param name="SendMouseMoveEvents" value="false">');
	document.write ('<param name="ShowGotoBar" value="false">');
	document.write ('<param name="TransparentAtStart" value="false">');
	document.write ('<param name="Volume" value="1000">');
	document.write ('<param name="loop" value="-1">');
	document.write ('</OBJECT>');
}

//이미지 새창 
function CaricaFoto(img)
{
	foto1= new Image();
	foto1.src=(img);
	Controlla(img);
}

function Controlla(img)
{
	if((foto1.width!=0)&&(foto1.height!=0))
	{
		viewFoto(img);
	}
	else
	{
		funzione="Controlla('"+img+"')";
		intervallo=setTimeout(funzione,20);
	}
}

function viewFoto(img)
{
	largh=foto1.width+20;
	altez=foto1.height;
	stringa="width="+largh+",height="+altez+",scrollbars=1,top=10,left=10";
	finestra=window.open("/program/board/action/img_pop.php?img="+img,"",stringa);
}


//파일의 확장자를 가져옮
function getFileExtension(filePath)
{
    var lastIndex = -1;
    lastIndex = filePath.lastIndexOf('.');
    var extension = "";

if ( lastIndex != -1 )
{
    extension = filePath.substring( lastIndex+1, filePath.len );
} else {
    extension = "";
}
    return extension;
}


//롤오버 이미지 변환
function ch_over(obj)
{
	if(obj.src.indexOf("_on") == -1){ 
		var img = obj.src.split('.gif');
		obj.src = img[0] + '_on.gif';
	}
}
function ch_out(obj)
{
	var img = obj.src.split('_on.gif');
	obj.src = img[0] + '.gif';
}

function isNull( s ) { 
	if( s == null ) return true; 

	var result = s.replace(/(^\s*)|(\s*$)/g, ""); 

	if( result ) return false; 
	else return true; 
}

function resizeImg(arg,w2,h2) {
    var w = eval(arg.width);
    var h = eval(arg.height);  
    if (w > eval(w2)) arg.width = w2;
    if (h > eval(h2)) arg.height = h2;
}

//주민번호 체크
function JuminCheck(ResNo1, ResNo2){
	var chk = 0;
	var yy  = ResNo1.substring(0,2);
	var mm  = ResNo1.substring(2,4);
	var dd  = ResNo1.substring(4,6);
	var sex = ResNo2.substring(0,1);

	if(ResNo1.length != 6) return true;

	if((sex != 1 && sex != 2 && sex != 3 && sex != 4) || (ResNo2.length != 7)) return true;   

	if((ResNo1.length == 6) && (ResNo2.length == 7)) {
		var ich = parseInt(sex, 10); 
		switch(ich) {
			case 1: break;
			case 2: break;
			case 3: if(yy == 00) break;
			case 4: if(yy == 00) break;
			default:
			return true;
		}
	}

	for(var i = 0; i <=5; i++) { 
		chk = chk + (((i % 8) + 2) * parseInt(ResNo1.substring(i, i + 1)));
	}

	for(var i = 6; i <= 11; i++) {
	chk = chk + (((i % 8) + 2) * parseInt(ResNo2.substring(i - 6, i - 5)));
	}

	chk = 11 - (chk % 11);
	chk = chk % 10;

	if(chk != ResNo2.substring(6, 7)) return true;
	return false
}

//주민번호 단일 파라메터
function isNumerSsn(jumin){
	var my=jumin; //1234561234567
	var chk="234567892345";
	var sum=0;
	for(var i=0;i<=11;i++)
		sum +=my.charAt(i)*chk.charAt(i);
	sum=(11-sum%11)%10;
	if(parseInt(my.charAt(12))==sum)
		return true;
	else
		return false;
}

//외국인번호
function isRegNo_fgnno(fgnno){ 
	var sum=0; 
	var odd=0; 
	buf = new Array(13); 
	for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); } 
	odd = buf[7]*10 + buf[8]; 
	if(odd%2 != 0) { return false; } 
	if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) { 
		return false; 
	} 
	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; 
	for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); } 
	sum = 11 - (sum%11); 
	if(sum >= 10) { sum -= 10; } 
		sum += 2; 
	if(sum >= 10) { sum -= 10; } 
	if(sum != buf[12]) { return false }
	return true;
}
 

function move_url(str){
	location.href=str;
}


function date_chk(ymd1,ymd2){
	//ymd 형식 : y/m/d H:i;
	
	date1	= ymd1;
	date2	= ymd2;
	d1 = new Date(date1); 
	d2 = new Date(date2); 

	if (d1 > d2) return true;
	else return false;
}

function timeview(sTday,eNday){ 
    var sTyear=sTday.substr(0,4);var sTmonth=sTday.substr(5,2);var sTday=sTday.substr(8,2); 
    var eNyear=eNday.substr(0,4);var eNmonth=eNday.substr(5,2);var eNday=eNday.substr(8,2); 
    var sTall=new Date(sTyear, sTmonth-1, sTday); 
    var eNall=new Date(eNyear, eNmonth-1, eNday); 
    return (eNall.getTime()-sTall.getTime())/(24*60*60*1000); 
} 

//쿠키값 추출
//@param cookieName 쿠키명

function getCookie( cookieName ){
	var search = cookieName + "=";
	var cookie = document.cookie;

	// 현재 쿠키가 존재할 경우
	if( cookie.length > 0 )	{
		// 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴.
		startIndex = cookie.indexOf( cookieName );
		// 만약 존재한다면
		if( startIndex != -1 ){
			// 값을 얻어내기 위해 시작 인덱스 조절
			startIndex += cookieName.length;
			// 값을 얻어내기 위해 종료 인덱스 추출
			endIndex = cookie.indexOf( ";", startIndex );
			// 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정
			if( endIndex == -1) endIndex = cookie.length;
				// 쿠키값을 추출하여 리턴
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
		}else{
			// 쿠키 내에 해당 쿠키가 존재하지 않을 경우
			return false;
		}
	}else{
		// 쿠키 자체가 없을 경우
		return false;
	}
}


//쿠키 설정
//@param cookieName 쿠키명
//@param cookieValue 쿠키값
//@param expireDay 쿠키 유효날짜

function setCookie( cookieName, cookieValue, expireDate ){
	var today = new Date();
	today.setDate( today.getDate() + parseInt( expireDate ) );
	document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";"
}

//쿠키 삭제
//@param cookieName 삭제할 쿠키명

function deleteCookie( cookieName ){
	var expireDate = new Date();
	//어제 날짜를 쿠키 소멸 날짜로 설정한다.
	expireDate.setDate( expireDate.getDate() - 1 );
	document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}

//화면중앙 팝업창 위치
function center_popup(w,h,url,scroll,name){
	if(scroll=="undefined")	scrool	= "no";
	if(name=="undefined")	name	= "normal";

	if (screen.width < 1025){
		LeftPosition=0;
		TopPosition=0;
	} else {
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	window.open(url,name,"width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+", scrollbars="+scroll).focus();
}

//화면중앙 레이어 위치
function center_Div(w,h,IdName){

	if (screen.width < 1025){
		TopPosition=0;
		LeftPosition=0;
	} else {
		TopPosition=(screen.height)?(screen.height-h)/2:100;
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
	}
	TopPosition=TopPosition-100;
	document.getElementById(IdName).style.top=TopPosition + "px";
	document.getElementById(IdName).style.left=LeftPosition + "px";



}



//팝업창 위치 지정 팝업
function popup_open(w,h,url,scroll,name,t,l){
	window.open(url,name,"width="+w+",height="+h+",top="+t+",left="+l+", scrollbars="+scroll).focus();
}

function alertWin(sURL,sMsg,sWidth,sHeight,sTop,sLeft,sResize)
{
	var sFeatures = new Array();
	sFeatures[0] = (sWidth > 0)? "dialogWidth:"+sWidth+"px":"dialgWidth:300px";
	sFeatures[1] = (sHeight > 0)? "dialogHeight:"+sHeight+"px":"dialogHeight:300px";
	sFeatures[2] = (sTop > 0)? "dialogTop:"+sTop+"px":"";
	sFeatures[3] = (sLeft > 0)? "dialogLeft:"+sLeft+"px":"";
	sFeatures[4] = (!sTop && !sLeft)? "center:Yes":"";
	sFeatures[5] = (sResize)? "resizeable:"+sResize:"resizeable:No";
	sFeatures[6] = "help:No";
	sFeatures[7] = "status:No";
	sFeatures = sFeatures.join(";");
	window.showModalDialog(sURL,sMsg,sFeatures);
}

var old_menu = '';
function menuclick(submenu) {
    if( old_menu != submenu ) {
    if( old_menu !='' ) {
        document.getElementById(old_menu).style.display = 'none';
        document.getElementById("t"+old_menu).className = '';
	}
    document.getElementById(submenu).style.display = 'block';
    document.getElementById("t"+submenu).className = 'in';
	old_menu = submenu;
    } else {
        document.getElementById(submenu).style.display = 'none';
        document.getElementById("t"+submenu).className = '';
        old_menu = '';
    }
}

function menu_show(obj,num){
	var obj_name = document.getElementsByName(obj);
	for(i=0;i<obj_name.length;i++){
		if(i==eval(num))	obj_name[i].style.display = "";
		else				obj_name[i].style.display = "none";	
	}
}

//사업자 등록번호 체크
function check_busino(vencod) {
	var sum = 0;
	var getlist =new Array(10);
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
	for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
	for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
	sum = sum + parseInt((getlist[8]*5)/10);
	sidliy = sum % 10;
	sidchk = 0;
	if(sidliy != 0) { sidchk = 10 - sidliy; }
	else { sidchk = 0; }
	if(sidchk != getlist[9]) { return false; }
	return true;
}

function downLoad(id,b_idx,cnt,type){
	location.href="/program/board/action/download.php?id="+id+"&amp;b_idx="+b_idx+"&amp;f="+cnt+"&amp;type="+type;
}

function delete_alert(ss,url,return_page)
{
	if(ss == "1") {
		var bool = confirm("삭제 하시겠습니까!?");
		if (bool) 	location.href = "/program/board/action/board_delete_ok.php?"+url+"&amp;return_page="+return_page;
	}
	else {
		menuLocBod = window.document.body;
		mouse_x = window.event.x;
		mouse_y = window.event.y;
		scroll_left = menuLocBod.scrollLeft;
		scroll_top  = menuLocBod.scrollTop;
		posX = mouse_x + scroll_left;
		posY = mouse_y + scroll_top;
		document.getElementById("delete_area").style.left = posX-150;
		document.getElementById("delete_area").style.top = posY-70;
		document.getElementById("delete_area").style.display="";
		document.getElementById('edit_area').style.display='none'
		document.del_form.passwd2.focus();
	}
}

function edit_alert(ss,url,return_page,href_v)
{
	if(ss == "1") {
		location.href = href_v;
	}
	else {
		menuLocBod = window.document.body;
		mouse_x = window.event.x;
		mouse_y = window.event.y;
		scroll_left = menuLocBod.scrollLeft;
		scroll_top  = menuLocBod.scrollTop;
		posX = mouse_x + scroll_left;
		posY = mouse_y + scroll_top;
		document.getElementById("edit_area").style.left = posX-150;
		document.getElementById("edit_area").style.top = posY-70;
		document.getElementById("edit_area").style.display="";
		document.getElementById('delete_area').style.display='none'
		document.edit_form2.passwd.focus();
	}
}

/*코멘트*/
function cmtdel(ss,b_idx,no,bbs_id,retUrl)
{
	if(ss == "1") {
		var bool = confirm("삭제 하시겠습니까!?");

		if (bool) 	location.href = "/program/board/action/comment_action.php?no="+no+"&bbs_id="+bbs_id+"&b_idx="+b_idx+"&actType=delete&retUrl="+retUrl;
	}else {
		document.getElementById("comment_del_div"+no).style.display="";
	}
}

function comment_pwd_chk(no){
	chk_v=check_form("del_pwd"+no,"비밀번호");
	if(chk_v==1){
		return false;
	}
}



function ico_view() {
	menuLocBod = window.document.body;
	mouse_x = window.event.x;
	mouse_y = window.event.y;
	scroll_left = menuLocBod.scrollLeft;
	scroll_top  = menuLocBod.scrollTop;
	posX = mouse_x + scroll_left;
	posY = mouse_y + scroll_top;
	document.getElementById("ico_area").style.left = posX;
	document.getElementById("ico_area").style.top = posY;
	document.getElementById("ico_area").style.display="";
}
function cEs(i) {
	document.getElementById("e_ico").src = "/board/editor/img/emotions/"+i;
	document.getElementById("ico_area").style.display="none";
	document.getElementById("ico_value").value = i;
}

function check_it(obj){
	chk_bt	= document.getElementsByName("no[]");
	for(i=0;i<chk_bt.length;i++){
		chk_bt[i].checked = (obj.checked == true) ? true : false;
	}
}
function rs_del(bbs_id){
	no_list	= "";
	chk_bt	= document.getElementsByName("no[]");
	for(i=0;i<chk_bt.length;i++){
		if(chk_bt[i].checked==true){
			no_list	+= chk_bt[i].value+",";
		}
	}

	if(no_list==""){
		alert("선택된 게시물이 없습니다.");
	}else{
		var c = confirm("게시물을 삭제하시겠습니까?");
		if(c) hiddenframe.location.href = "/board/action/board_delete_ok.php?no_list="+no_list+"&amp;mode=all&amp;bbs_id="+bbs_id;
	}
}

/*-------------- 회원 관련 스크립트 --------------------------*/

//약관동의 체크
function form_agree(obj){
	if(validate(obj)=="chk_ok"){
		if(JuminCheck(obj.ssn1.value,obj.ssn2.value)){
			alert("주민번호가 올바르지 않습니다.");
			obj.ssn2.value = "";
			obj.ssn1.focus();
			return false;
		}
		return true;
	}else{
		return false;
	}
}

//아이디 중복검사
function id_chk(){
	var obj	= document.getElementById("userid");
	if(isNull(obj.value)){
		alert("아이디를 입력해주세요");
		obj.focus();		
	}else{
		dynamic.src = "/board/member/id_chk.php?id="+obj.value;
	}
}

//우편번호 검색
function post_search(){
	center_popup(400,500,"/board/member/post.php","no","post");
}
var member_chk_fleg = true;
function member_chk(obj){
	if(validate(obj)=="chk_ok"){

		var regMail =/^[_a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+\.[a-zA-Z]+$/;

/*별도 처리 부분 ---------------------*/
		if(obj.password.value != obj.repassword.value){
			alert("비밀번호가 일치하지 않습니다.");
			obj.password.value		= "";
			obj.repassword.value	= "";
			obj.password.focus();
			return false;
		}

		if(!isNull(obj.phone1.value) && isNull(obj.phone2.value)){
			alert("연락처를 입력해주세요.");
			obj.phone2.focus();
			return false;
		}

		if(!isNull(obj.phone1.value) && isNull(obj.phone3.value)){
			alert("연락처를 입력해주세요.");
			obj.phone3.focus();
			return false;
		}

		if(!isNull(obj.email.value) && !regMail.test(obj.email.value)){
			alert("이메일 형식이 잘못입력 되었습니다.");
			obj.email.focus();
			return false;
		}

		if(isNull(obj.home_post.value) || isNull(obj.home_addr1.value)){
			alert("주소를 입력해주세요.");
			post_search();
			return false;
		}

		if(isNull(obj.home_addr2.value)){
			alert("상세 주소를 입력해주세요.");
			obj.home_addr2.focus();
			return false;
		}
/*-------------------------------------------*/
		if(member_chk_fleg){
			member_chk_fleg = false;
			return true;
		}else{
			alert("데이터 전송중입니다.");
			return false;
		}

	}else{
		return false;
	}
}

function member_del(idx){
	var c = confirm("삭제하시겠습니까?","");
	if(c) dynamic.src = "/board/member/member_proc.php?type=admin_member_del&amp;idx="+idx;
}

function member_out(idx){
	var c = confirm("탈퇴하시겠습니까?\n\n관련 데이터는 영구히 삭제가 됩니다.","");
	if(c) dynamic.src = "/board/member/member_proc.php?type=member_del&amp;idx="+idx;
}

function imgResize() 
{ 
	var maxsize = 600;
    var content = document.getElementById("DivContents"); 
    var img = content.getElementsByTagName("img"); 
    for(i=0; i<img.length; i++) 
    { 

        if ( eval('img[' + i + '].width > maxsize') ) 
        { 
            var heightSize = ( eval('img[' + i + '].height')*maxsize )/eval('img[' + i + '].width') ; 
            eval('img[' + i + '].width = maxsize') ; 
            eval('img[' + i + '].height = heightSize') ; 
        } 
    } 
} 

function ch_tabs(str,head,img){
	//객체 변수 선언
	var obj_img		= document.getElementsByName(head+"_img[]");
	var obj_content	= document.getElementsByName(head+"_contents[]");
	
	//탭메뉴 갯수만큼 루프
	for(i=0;i<obj_img.length;i++){
		//특정 탭메뉴에 마우스 오버시
		if(eval(str)==i){
			obj_img[i].src					= img +(i+1)+"_on.gif";
			obj_content[i].style.display	= "";
		}else{
			obj_img[i].src					= img +(i+1)+".gif";
			obj_content[i].style.display	= "none";
		}
	}
}

function member_login(url){
	var c = confirm("회원로그인후 이용가능합니다.\n\n로그인 하시겠습니까?");
	if(c) location.href="/member/member_login.php?return_page="+url;
	else history.go(-1);
}


function postSearch(){
	center_popup(430,463,'/program/member/postSearch.php',0,'post_search');
}

var objInstance;
function FCKeditor_OnComplete(editorInstance){objInstance=editorInstance;}


function media(file,w,h,auto,cont,state){
	document.write ('<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="'+w+'" height="'+h+'" id="movie">');
	document.write ('<PARAM NAME="Filename" VALUE="'+file+'">');
	document.write ('<param name="ClickToPlay" value="false">');
	document.write ('<param name="AutoSize" value="true">');
	document.write ('<param name="AutoStart" value="'+auto+'">');
	document.write ('<param name="ShowControls" value="'+cont+'">');
	document.write ('<param name="ShowAudioControls" value="false">');
	document.write ('<param name="ShowDisplay" value="0">');
	document.write ('<param name="ShowTracker" value="1">');
	document.write ('<param name="ShowStatusBar" value="'+state+'">');
	document.write ('<param name="EnableContextMenu" value="false">');
	document.write ('<param name="ShowPositionControls" value="false">');
	document.write ('<param name="ShowCaptioning" value="false">');
	document.write ('<param name="AutoRewind" value="true">');
	document.write ('<param name="Enabled" value="true">');
	document.write ('<param name="EnablePositionControls" value="true">');
	document.write ('<param name="EnableTracker" value="true">');
	document.write ('<param name="PlayCount" value="1">');
	document.write ('<param name="SendWarningEvents" value="true">');
	document.write ('<param name="SendErrorEvents" value="true">');
	document.write ('<param name="SendKeyboardEvents" value="false">');
	document.write ('<param name="SendMouseClickEvents" value="false">');
	document.write ('<param name="SendMouseMoveEvents" value="false">');
	document.write ('<param name="ShowGotoBar" value="false">');
	document.write ('<param name="TransparentAtStart" value="false">');
	document.write ('<param name="Volume" value="1000">');
	document.write ('</OBJECT>');
}


 function findpost(u,adr,post) {
	window.open("/program/board/post.php?u="+u+"&amp;adr="+adr+"&amp;post="+post,"","width=450,height=463,left=250,top=200,scrollbars=yes");
}

//체크박스 선택확인 라디오 선택값 가져오기
function radio_checkbox_chk(qqq){
	var radio_v=document.getElementsByName(qqq);
	var bbb;
	for(i_i=0;i_i<radio_v.length;i_i++){
		if(radio_v[i_i].checked) {
			bbb=radio_v[i_i].value;
			break;
		}else{
			bbb="";
		}
	}
	return bbb;
}

function radio_checkbox_chk_value(qqq){
	var radio_v=document.getElementsByName(qqq);
	var bbb="";
	for(i_i=0;i_i<radio_v.length;i_i++){
		if(radio_v[i_i].checked) {
			bbb=radio_v[i_i].value+"|"+bbb;
		}
	}
	return bbb;
}


		

function check_form(chk_v,chk_name){
	if(document.getElementById(chk_v)){
		if(document.getElementById(chk_v).value=="" && document.getElementById(chk_v).type!= "hidden"){
			alert(chk_name+" 을 입력해주세요.");
			document.getElementById(chk_v).focus();
			return "1";
		}
	}
}

function check_form_eng(chk_v,chk_name){
	if(document.getElementById(chk_v)){
		if(document.getElementById(chk_v).value=="" && document.getElementById(chk_v).type!= "hidden"){
			alert("Please onter the "+chk_name);
			document.getElementById(chk_v).focus();
			return "1";
		}
	}
}

function chtab(str,maxnum,img,obj){
	for(i=1;i<=maxnum;i++){
		if(i==str){
			document.getElementById("timg"+i).src=img+i+"_on.gif";
			document.getElementById("bbsCont"+i).style.display="";
			if(document.getElementById("bbslink")!=undefined) document.getElementById("bbslink").value = obj.href;
		}else{
			document.getElementById("timg"+i).src=img+i+".gif";
			document.getElementById("bbsCont"+i).style.display="none";
		}
	}
}
function bbsMove(){
	location.href=document.getElementById("bbslink").value;
}


function logChk(obj){
	if(isNull(obj.login_id.value)){
		alert("아이디를 입력해주세요");
		obj.login_id.focus();
		return false;
	}
	if(isNull(obj.login_pwd.value)){
		alert("비밀번호를 입력해주세요");
		obj.login_pwd.focus();
		return false;
	}
	return true;
}

function login(){
	center_popup(408,278,"/program/member/login_pop.php",0,"login");
}



 
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='about:blank;';
	return '';
}

function bbsChk(ssidx,link){
	if(ssidx==""){
		alert("로그인후 이용가능합니다.");
	}else{
		location.href=link;
	}
}
function href_move(){
	v=document.getElementById("select_href_move").value;
	location.href=v;
}

// 온클릭시 사용
function keyPress_code(e,t){

  if(window.event){
      var code = window.event.keyCode;
   }else{
      var code = e.charCode;
   }
	if(code==13){
		t.onclick();	
	}
}

   
// /program/board/lib/PopupNameChk.php   
function fnPopup(){
	//한국신용평가정보 안심 실명확인 팝업페이지를 띄웁니다.	   
	window.open('', 'popup','width=410, height=660');
	document.form.target = "popup";
//	document.form.action = "https://cert.namecheck.co.kr/certnc_input.asp";
	document.form.submit();
}





function id_check(engnum){ 
 var tempStr = false;        //  숫자검색 변수
 var tempStr2 = false;        //  영문검색 변수
 var tempStr3 = false;        // 그외 문자 검색 변수
 var str = engnum;        // 문자열 입력 받기
 if ( engnum ==""){ str=""}
 var strln = str.length;   
 for (var i = 0;  i < strln;  i++){
  var slideStr = str.charCodeAt(i)   
   if ((slideStr >= 48)   &&   (slideStr <= 57)){   //숫자이면
    tempStr = true;
   }   
   if ((slideStr >= 97)   &&  (slideStr <= 122)) {   //영문이면
    tempStr2 = true;
   }
   if ( !((slideStr >= 48)  &&  (slideStr <= 57))   &&  !((slideStr >= 97)   &&  (slideStr <= 122))){ 
    tempStr3 = true;     // 그 외 문자이면
   }
 }
 if ((tempStr == true) && (tempStr2 == true) && (tempStr3 == false)){   
  return true;
 }else {  
  return false;
 }
}







/* 색상설정 시작 */
var ColorSelectDialog = null;
function SelectColor(pushed_button, color_value_text_id)
{
    if (ColorSelectDialog==null)
    {
        var ColorSelectDialog = document.createElement("OBJECT");
        ColorSelectDialog.classid = "clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b";
        ColorSelectDialog.style.width = 0;
        ColorSelectDialog.style.height = 0;
        document.body.appendChild(ColorSelectDialog);
    }
 
    var color_value_obj = document.getElementById(color_value_text_id);
    var inputed_color = color_value_obj.value;
 
    if (inputed_color == '')    var selected_color = ColorSelectDialog.ChooseColorDlg();
    else                        var selected_color = ColorSelectDialog.ChooseColorDlg(inputed_color);
 
    selected_color = selected_color.toString(16);
    if (selected_color.length < 6)
    {
        var tmp = "000000".substring(0,6-selected_color.length);
        selected_color = tmp.concat(selected_color);
    }
 
    color_value_obj.value = '#' + selected_color.toUpperCase();
    pushed_button.style.backgroundColor = selected_color;
}
function MakeColorInputField()
{
    var els = document.getElementsByTagName('colorpicker');
    for (var i=0; i<els.length; i++)
    {
        var text_obj = document.createElement("input");
        text_obj.type = 'text';
        text_obj.id = els[i].getAttribute('name');
        text_obj.name = els[i].getAttribute('name');
		text_obj.className = 'bbs_input';
        if (els[i].getAttribute("size")!=null) text_obj.size = els[i].getAttribute("size");
        else text_obj.size = '7';
        if (els[i].getAttribute("value")!=null) text_obj.value = els[i].getAttribute("value");
        else text_obj.value = '#000000';
        if (els[i].getAttribute("hide")!=null) text_obj.style.display = "none";
 
        els[i].insertAdjacentElement("BeforeBegin",text_obj);
 
        var button_obj = document.createElement("input");
        button_obj.type = 'button';
		button_obj.className = 'bbs_input';
 
        if (els[i].getAttribute("button_width")!=null) button_obj.style.width = els[i].getAttribute("button_width");
        else button_obj.style.width = 25;
 
        if (els[i].getAttribute("value")!=null) button_obj.style.backgroundColor = els[i].getAttribute("value");
        else button_obj.style.backgroundColor = '#000000';
 
 
        button_obj.id = els[i].getAttribute('name');
        text_obj.insertAdjacentElement("AfterEnd",button_obj);
 
        button_obj.onclick = function()
        {
            SelectColor(this, this.id);
        }
    }
}
/* 색상설정 끝 */


/* gallery_album  스킨에 사용 시작  */
	function AlbumChange(BigImgUrl,BigImgAlt){
		document.getElementById("AlbumBigImg").src=BigImgUrl;
		document.getElementById("AlbumBigImg").alt=BigImgAlt;
	}
/* gallery_album  스킨에 사용 끝  */



 
/* 병원별 외국어 사이트 레이어작업 시작 */
// '이미지값','알트값','열릴주소값'
function LanguageChoice(ImgV,AltV,UrlV){
	document.getElementById("LanguageBaseImg").src="/images/00common/"+ImgV;
	document.getElementById("LanguageBaseImg").alt=AltV;
	LanguageView();
	document.getElementById("LanguageGo").focus();
	document.getElementById("LanguageUrl").value=UrlV;
	//url 준다
}
function LanguageView(str){
	if(str=="0"){
		document.getElementById("LanguageDiv").style.display = "";
		document.getElementById("labg").className="languageDivOn";
	}else{
		document.getElementById("LanguageDiv").style.display = "none";
		document.getElementById("labg").className="languageDivOff";
	}


}

function ImgOnOff(obj,Iname,OnOFF){
	obj.src="/images/00common/L_"+Iname+"_"+OnOFF+".gif";
}

function open_url(urlV){
	href=document.getElementById(urlV).value;
	if(href==""){
		alert("선택해주세요.");
	}else{
		window.open(href,'_blank')
	}
}
/* 문화병원 외국어 사이트 레이어작업 끝 */



/* 통합검색 시작 */
function TotalSearch(){
	if(document.getElementById("SearchStr").value==""){
		alert("통합검색어를 입력하세요.");
		document.getElementById("SearchStr").focus();
		return false;
	}
}
/*통합검색 끝*/


/* 불임용어사전검색 :: s ::*/
function TotalSearch(){
	if(document.getElementById("SearchStr").value==""){
		alert("검색어를 입력하세요.");
		document.getElementById("SearchStr").focus();
		return false;
	}
}
/* 불임용어사전검색 :: e :: */



/*문화병원메인에 사용됨  */
//ne_tab(자신번호,전체수,'타이틀이미지주소')
function ne_tab(n,TabTatalNum,TabImgUrl){
	for(i=1;i <= TabTatalNum;i++){
		if(n==i){
			document.getElementById("n_e_div"+i).style.display="";
			document.getElementById("img_ne"+i).src=TabImgUrl+i+"on.gif";
		}else{
			document.getElementById("n_e_div"+i).style.display="none";
			document.getElementById("img_ne"+i).src=TabImgUrl+i+".gif";
		}
	}
}



/* basis_normal_FAQ 시작   -----   dd 열로 닫기기능 */
	tempHidden="";
	function dd_open(n){
		if(tempHidden != n){
			document.getElementById("dd_display"+n).style.display="";
		}
		if(tempHidden != "" && tempHidden != n){
			document.getElementById("dd_display"+tempHidden).style.display="none";
		}
		if(tempHidden == n){
			document.getElementById("dd_display"+tempHidden).style.display="none";
			tempHidden="";
		}else{
			tempHidden=n;
		}
	}
/* basis_normal_FAQ 끝 */







function pstCLog(link,title,thumbnail,summary,writer) {
var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
if ( a ) {
 a.focus();
}
}

function pstTwitter(msg,url) {
var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
var a = window.open(href, 'twitter', '');
if ( a ) {
 a.focus();
}
}
function pstMe2Day(msg,url,tag) {
var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
var a = window.open(href, 'me2Day', '');
if ( a ) {
 a.focus();
}
}
function pstFaceBook(msg,url) {
var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
var a = window.open(href, 'facebook', '');
if ( a ) {
 a.focus();
}
}

function pstYozmDaum(link,prefix,parameter) {
var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "&parameter=" + encodeURIComponent(parameter);
var a = window.open(href, 'yozm', 'width=466, height=356');
if ( a ) {
 a.focus();
}
}

/* 좋은문화병원 좋은문화교실 */
function tabShow(n,TabTatalNum,TabImgUrl){
	for(i=1;i <= TabTatalNum;i++){
		if(n==i){
			document.getElementById("tab_view"+i).style.display="";
			document.getElementById("img_ne"+i).src=TabImgUrl+i+"_on.gif";
		}else{
			document.getElementById("tab_view"+i).style.display="none";
			document.getElementById("img_ne"+i).src=TabImgUrl+i+".gif";
		}
	}
}

