/*롤오버를 위해서 드림위버가 만들 아이들*/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*롤오버를 위해서 드림위버가 만들 아이들 끝*/

/*아이디 확인*/

function _chkid(id0)
{
	var id =id0.toLowerCase();

	/* 길이는 4 ~ 12 */
	if(id.length < 4 || id.length > 12) {
		return false;
	}

	for(var i = 0; i < id.length; i++) {
		var chr = id.substr(i,1);

		/* 첫자는 영문으로 시작해야함 */
		if((i==0) && (chr >= '0' && chr <= '9'))
			return false;
		/* 첫자 _ 금지 */
		if((i==0) && (chr == '_'))
			return false;


		/* 영문과 숫자, '_' 사용 */
		if((chr < '0' || chr > '9') && (chr < 'a' || chr > 'z')&&(chr != '_')) {
       		return false;
        	}

	}
	return true;
}

function viewSelectM(a){
	if(a==1){
		menu0.style.display='none';
		menu1.style.display='';
		menu2.style.display='none';
		menu3.style.display='none';
		menu4.style.display='none';
	}else if(a==2){
		menu0.style.display='none';
		menu1.style.display='none';
		menu2.style.display='';
		menu3.style.display='none';
		menu4.style.display='none';
	}else if(a==3){
		menu0.style.display='none';
		menu1.style.display='none';
		menu2.style.display='none';
		menu3.style.display='';
		menu4.style.display='none';
	}else if(a==4){
		menu0.style.display='none';
		menu1.style.display='none';
		menu2.style.display='none';
		menu3.style.display='none';
		menu4.style.display='';
	}
}

/*번호 체크 : 숫자만 사용*/
/* 번호는 숫자만을 사용해야 합니다. */
/* onkeyup="javascript:_chknum(this);" */
function _chknum(objn1)
{
	n1 = objn1.value

	for(var i = 0; i < n1.length; i++) {
		var chr = n1.substr(i,1);
		if(chr < '0' || chr > '9')  {
			alert ("숫자만 사용해야 합니다.");
			objn1.value = n1.substring( 0 , n1.length-1);
			objn1.focus()
		}
	}
}

// 20080701_HJH 넣은것들 - 몰아넣기
function copyit(){
	if(!document.all){
		alert("파이어폭스에서는 지원되지 않습니다. \n직접 복사해주시기 바랍니다.");
		return;
	}

	var tempval=eval("document.all.CopyUrl")

	tempval.select()

	therange=tempval.createTextRange()
	therange.execCommand("Copy")
	alert("복사되었습니다.\n붙여넣기(Ctrl+V)를 해주세요.")
}

function key_down(ev){
	var evt_code = (window.netscape) ? ev.which : event.keyCode;

	if (evt_code == 13) {
		search_form();
		return;
	}
}

function key_down_top(ev){
	var evt_code = (window.netscape) ? ev.which : event.keyCode;

	if (evt_code == 13) {
		top_search();
		return;
	}
}

function key_down_login(ev){
	var evt_code = (window.netscape) ? ev.which : event.keyCode;

	if (evt_code == 13) {
		login_form();
		return;
	}
}

function goPage(page){
	searchFrm.page.value = page;
	searchFrm.submit();
}

function check_all(c_bit, objname) {		//onclick="javascript:check_all(this.checked,'print_check_code');"
	obj = document.getElementsByName(objname);
	for (i=0;i<obj.length;i++) {
		obj[i].checked = c_bit
	}
}

function check_yn(objname) {		//	check_yn('print_check_code');
	var k = 0;
	obj = document.getElementsByName(objname);

	for (i=0; i < obj.length; i++) {
		if (obj[i].checked == true) {
			k = k+1;
		}
	}
	if (k == 0 ){
		alert("체크된 항목이 없습니다.");
		return false;
	}
}



// 프론트
function my_info(userid){
	url = "/common/my_info_pop.asp?userid="+userid+" " ;
	openWindow05(url, 520, 460, 10, 10, "my_info");
}

// 통합 로그인 팝업창 띄우기
function login_pop(reUrl){
	if (confirm("로그인이 필요합니다.")){
		url = "https://www.mra.co.kr/common/login_pop.asp?reUrl='"+reUrl+"' " ;
		openWindow05(url, 520, 410, 10, 10, "login_pop");
	}
}

// sms 팝업창 띄우기
function sms_pop(hp_to){
	url = "/sms/sms_list.asp?hp='"+hp_to+"' " ;
	openWindow05(url, 1000, 750, 10, 10, "sms_popup");
}

// 덧글 팝업창 띄우기 어드민
function comment_pop_admin(idx, table_nm){
	url = "/admin/common/comment_pop.asp?idx="+idx+"&table_nm='"+table_nm+"' " ;
	openWindow05(url, 820, 500, 10, 10, "comment_pop");
}
// 프론트
function comment_pop(idx, table_nm, ch_name, bc_name, dc_name, pd_name){
	url = "/common/comment_pop.asp?idx="+idx+"&table_nm='"+table_nm+"'&ch_name='"+escape(ch_name)+"'&bc_name='"+escape(bc_name)+"'&dc_name='"+escape(dc_name)+"'&pd_name='"+escape(pd_name)+"' " ;
	openWindow05(url, 820, 500, 10, 10, "comment_pop");
}

// 팝업창
function my_comment(idx, od_code, table_nm, ch_name, bc_name, dc_name, pd_name){
	url = "/myroom/my_order_pop.asp?idx="+idx+"&od_code='"+od_code+"&table_nm='"+table_nm+"'&ch_name='"+escape(ch_name)+"'&bc_name='"+escape(bc_name)+"'&dc_name='"+escape(dc_name)+"'&pd_name='"+escape(pd_name)+"' " ;
	openWindow05(url, 820, 500, 10, 10, "my_comment");
}

// 상품 주문 페이지 간략보기

function simple_popup(pd_idx){
	url = "/product/simple_popup.asp?pd_idx="+pd_idx+" " ;
	openWindow05(url, 920, 540, 10, 10, "simple_popup");
}

// 교정보기 보기~ 프론트
function confirm_view(bd_idx, od_code, cd_code){
	url = '/confirm/confirm_popup.asp?bd_idx='+bd_idx+'&od_code='+od_code+'&cd_code='+cd_code
	openWindowFull (url);
}

// 이미지 풀 사이즈로 보기
function img_full(full_path){
	url = '/common/img_full_pop.asp?full_path='+escape(full_path)+''
	openWindow05(url, 850, 500, 10, 10, "img_full_pop");
}

// 우편번호 찾기
function zipcode(objname1, objname2){
	// objname1		- 우편번호를 가지고 있는 textbox 이름
	// objname2		- 주소를 가지고 있는 textbox 이름
	url = '/common/zipcode.asp?obj1='+objname1+'&obj2='+objname2;
	openWindow02(url,520,500,250,400,'zipcodepop') ;
}

// 계좌번호 보내기..
function bank_send(se_bank, phone, price){
	url = "/common/bank_send_pop.asp?se_bank='"+se_bank+"'&phone='"+phone+"'&price='"+price+"' " ;
	openWindow05(url, 520, 380, 10, 10, "bank_send_pop");		
}

// 견적서 페이지 간략보기

function go_esti_view(code){
	url = "/myroom/my_esti_view.asp?idx="+code+" " ;
	openWindow05(url, 920, 800, 10, 10, "my_esti_view");
}

// 배송조회
function dele_search(code, name){	 	// 앞번호가 30 이면 훼미리택배 , 855 이면 대한통운임
	var url = "http://e-family.co.kr/member/delivery_search_view.jsp?item_no="+code+"&sender_name=(주)마음커뮤니케이션&sender_address=서울%20중구%20충무로3가해차창빌딩&receiver_name="+name+";"
	var url2 = "http://www.doortodoor.co.kr/parcel/doortodoor.do?fsp_action=PARC_ACT_002&fsp_cmd=retrieveInvNoACT&invc_no="
	var url3 = "http://www.cjgls.co.kr/kor/service/service02_01.asp?slipno="+code+""

	code = String(code)
	if(code.substring(0,1) == 3){
	  url = url + '&item_no='+code ;
	}else if(code.length == 12){
	  url = url3 ;
	}	else{
	  url = url2 +code ;
	}

	posy = (screen.width - 400) / 2 - 1;
	posx = (screen.height - 200) / 2 - 1;

	window.open(url) ;
}



// 브랜드마크 팝업창 띄우기
function brandmark(){
	url = "/common/brandmark.asp" ;
	openWindow05(url, 730, 700, 10, 250, "brandmark");
}





// byte 수에 맞게 글자 잘라내기
// onkeyup="check_length(120);"

function check_length(data_cnt){

	var tmpStr, nStrLen, reserve, f;
	f = document.ComposerForm;

	sInputStr = f.tr_memo.value;
	nStrLen = calculate_byte(sInputStr);

	if(nStrLen > data_cnt){
		tmpStr = Cut_Str(sInputStr, data_cnt);
		reserve = nStrLen - data_cnt;
		alert("바이트가 초과되었습니다.(최대 "+data_cnt+"Bytes)\r\n초과된 부분은 전송되지 않습니다.");

		f.tr_memo.value = tmpStr;
		nStrLen = calculate_byte(tmpStr);
		f.nByte.value = nStrLen;
	}else{
		f.nByte.value = nStrLen;
	}
	return;
}

function calculate_byte(sTargetStr){
	var sTmpStr, sTmpChar;
	var nOriginLen = 0;
	var nStrLength = 0;

	sTmpStr = new String(sTargetStr);
	nOriginLen = sTmpStr.length;

	for(var i=0 ; i < nOriginLen ; i++ ){
		sTmpChar = sTmpStr.charAt(i);

		if(escape(sTmpChar).length > 4){
			nStrLength += 2;
		}else if(sTmpChar!="\r"){
			nStrLength ++;
		}
	}
	return nStrLength;
}

function Cut_Str(sTargetStr, nMaxLen){
	var sTmpStr, sTmpChar, sDestStr;
	var nOriginLen = 0;
	var nStrLength = 0;
	var sDestStr = "";
	sTmpStr = new String(sTargetStr);
	nOriginLen = sTmpStr.length;

	for(var i=0 ; i < nOriginLen ; i++){
		sTmpChar = sTmpStr.charAt(i);

		if (escape(sTmpChar).length > 4){
			nStrLength = nStrLength + 2;
		}else if(sTmpChar!="\r"){
			nStrLength ++;
		}

		if(nStrLength <= nMaxLen){
			sDestStr = sDestStr + sTmpChar;
		}else{
			break;
		}
	}
return sDestStr;
}



// 글자 잘라내기 여기까지

///////////

//width=480,height=280, top=250, left=400'

function openWindow01(url,width,height,top,left) {
	window.open(url,"win01",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width='+width+',height='+height+', top='+top+', left='+left);
}


function openWindow02(url,width,height,top,left,wname) {
	window.open(url, wname,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+width+',height='+height+', top='+top+', left='+left);
}

function openWindow03(url, win_name, width,height,top,left) {
	window.open(url,win_name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+', top='+top+', left='+left);
}

function openWindow04(url, win_name, width,height,top,left) {
	window.open(url,win_name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height='+height+', top='+top+', left='+left);
}

function openWindow05(url,width,height,top,left,wname) {
	window.open(url, wname,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height='+height+', top='+top+', left='+left);
}

function npopup(url) {

	np = window.open(url,'npopup','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=500, top=100, left=200');
	np.focus();
}

function nsheet(url) {

	ns = window.open(url,'nsheet','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1100,height=760, top=0, left=0');
	ns.focus();
}

function nsheettt(url) {

	ns = window.open(url,'nsheettt','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1100,height=760, top=0, left=0');
	ns.focus();
}

function nsheettt3(url) {

	ns3 = window.open(url,'nsheettt','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1100,height=760, top=0, left=0');
	ns3.focus();
}

function nsheet2(url) {
	ns2 = window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=1000,height=680, top=0, left=0');
	ns2.focus();
}
function pop_delivery_check(url) {
	ns2 = window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=440, top=0, left=0');
	ns2.focus();
}

function openWindowFull (URL) {
	window.open(URL,"winfull","fullscreen");
}

function btn1( btn_text , btn_url ) {


document.write ("<table border='0' cellpadding='0' cellspacing='0' align='left'>");
document.write ("  <tr>");
document.write ("    <td width='24'><img src='/images/estimate/btn_01.gif' width='24' height='21'></td>");
document.write ("    <td width='*' align='center' background='/images/estimate/btn_02.gif' nowrap ><a href='" + btn_url + "' class='a_btn'>"+ btn_text +"</a></td>");
document.write ("    <td width='14'><img src='/images/estimate/btn_03.gif' width='14' height='21'></td>");
document.write ("  </tr>");
document.write ("</table>");

}

//disable일때 사용
function btn2( btn_text ) {


document.write ("<table border='0' cellpadding='0' cellspacing='0' align='left'>");
document.write ("  <tr>");
document.write ("    <td width='24'><img src='/images/estimate/btn_01.gif' width='24' height='21'></td>");
document.write ("    <td width='*' align='center' background='/images/estimate/btn_02.gif' nowrap >"+ btn_text +"</td>");
document.write ("    <td width='14'><img src='/images/estimate/btn_03.gif' width='14' height='21'></td>");
document.write ("  </tr>");
document.write ("</table>");

}

function gourl (url) {
	window.document.location.href= url;
}




function Resize_Frame(name){

	var Frame_Body = document.frames(name).document.body;
	var Frame_name = document.all(name);

	Frame_name.style.width = Frame_Body.scrollWidth + (Frame_Body.offsetWidth-Frame_Body.clientWidth);
	Frame_name.style.height = Frame_Body.scrollHeight + (Frame_Body.offsetHeight-Frame_Body.clientHeight);

	if (Frame_name.style.height == "0px" || Frame_name.style.width == "0px") {
		Frame_name.style.width = "700px"; //기본 iframe 너비
		Frame_name.style.height = "300px"; //기본 iframe 높이
		window.status = 'iframe resizing fail.';
	}
	else	{
		window.status = '';
	}
}



// menu 기본 js

    var dlg = null;
    var s = window.screen;
    var w = s.availWidth, h = s.availHeight;

function showChannel(url,width,height,top,left)
    {
        dlg = showModelessDialog( url, "menu" ,  "scroll:auto; status:no; dialogLeft:"+ left +"px; dialogTop:"+top+"px; dialogWidth:"+width+"px; dialogHeight:"+height+"px");
    }

function toggleChannel()
    {
        if(dlg == null || dlg.closed)   showChannel();
        else                            dlg.close();
    }


//숫자만 입력
//tmp => CheckNum(etm.quantity);
function CheckNum(tmp)
{
    for (i = 0; i < tmp.value.length; i++)
    {
			if(isNaN(tmp.value.charAt(i)) )
			{
				alert("숫자로만 입력하세요");
				tmp.value = tmp.value.substring(0,i);
				tmp.focus();
				return;
			}
			else
				continue;
	}
   return true;
}

//메일 체크
//obj => emailcheck(form.email)
function emailcheck(obj){
  var c1,c2,tmpstr,s,e;
  c1=0;
  c2=0;
  s=-1;
  e=-1;

  //if ( obj.value.length == 0) return (false);

  for (var i=0; i<obj.value.length; ++i) {     var ch=obj.value.charAt(i);
	 if (ch != " " && s == -1) s = i;
  }
  for (var i=obj.value.length -1; i > 0; --i) {
     var ch=obj.value.charAt(i);
	 if (ch != " " && e == -1) e = i;
  }

  for (var i=s; i <= e; ++i) {
     var ch=obj.value.charAt(i);
     if (ch == ' ') return(false);
     if (ch == '@') {
		if (i-s < 2) return(false);
		if (c1 != 0) return(false);
		if (c2 != 0) return(false);
		c1 = i
     }
     if (ch == '.') {
		if (i - c1 < 2) return(false);
		c2 = i;
     }
  }

  if (i-c2 < 2)  return(false);
  if (c1 == 0 || c2 == 0) return(false);
  return (true);
}

//FileCheck(tmp1, tmp2)
//업로드 개수가 1개 이상 일때
//tmp1 => file type의 name
//tmp2 => file type의 수, 업로드 개수
function FileCheck(tmp1, tmp2)
{
	var file_list = ["asp", "html", "inc", "htm"];
	//file_list = [asp, html];
	var img = tmp1;
	var file;
	var extention;
	for (i = 0 ; i < tmp2; i++)
	{
		file = img(i).value;
		if ( file.value != "" && (pos = file.lastIndexOf(".")) != -1 )
		{
			extention = file.substring(pos + 1, file.length);
			//alert(extention);
			for (x = 0; x < 4; x++)
			{

				if( file_list[x] == extention )
				{
					alert(extention+"파일은 첨부 할 수 없습니다.");
					return false;
				}
			}
		}
	}
	return true;
}


//메인 레이어 공지창
function tempx(win_name){
		if ( getCookie( win_name )!= "checked" ){
			document.getElementById(win_name).style.display='';
			//document.getElementById(win_name).style.left=600;
		}
}

function closePopLayer1(win_name , days) {
		if ( document.popupform.Notice.checked ) {
			setCookie( win_name, "checked" ,days );
		}
		closePopLayer (win_name)
}

function closePopLayer (tmp) {
	document.getElementById(tmp).style.visibility='hidden';
}



//하루동안 창을 열지않음
function setCookie( name, value, expiredays )
{
var today = new Date();
today.setDate( today.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function closewin(win_name) {
   if ( document.forms[0].Notice.checked ) {
	setCookie( win_name, "checked" ,1 );
	   }
   top.close();
}

function closewin2(win_name, url) {
   if ( document.forms[0].Notice.checked ) {
	setCookie( win_name, "checked" ,1 );
	   }
   opener.location.href = url;
   top.close();
}


function getCookie(strName)
{

	var strArg = new String(strName + "=");
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;

	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;

	if(nCookieLen > 0) {

		while(i < nCookieLen) {

			j = i + nArgLen;

			if(document.cookie.substring(i, j) == strArg) {

				nEnd = document.cookie.indexOf (";", j);

				if(nEnd == -1) nEnd = document.cookie.length;

				return unescape(document.cookie.substring(j, nEnd));

			}

			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}

	return("");
}

function temp(win_name){
if ( getCookie( win_name ) != "checked" )
{
	openWindow01("/popup/event/event_newspaper.asp", 310, 430, 0, 0);
}
}

function temp2(win_name, url){
if ( getCookie( win_name ) != "checked" )
{
	openWindow03(url, win_name, 310, 430, 0, 0);
}
}


function temp3(win_name, url){
if ( getCookie( win_name ) != "checked" )
{
	openWindow03(url, win_name, 310, 430, 0, 320);
}
}

function temp4(win_name, url){
if ( getCookie( win_name ) != "checked" )
{
	openWindow03(url, win_name, 380, 420, 0, 0);
}
}
function temp5(win_name){
if ( getCookie( win_name ) != "checked" )
{
	openWindow01("/popup/event/event_20070914.asp", 500, 400, 0, 0);
}
}



/*입력한 값이 올바른 포맷인지.. true : 올바른 포맷, false : 올바른 안포맷.. 그러므로.. alert 띄워줘야겠지용?*/
function isValidFormat(input,format) {
    if (input.value.search(format) != -1) {
        return true; //올바른 포맷 형식
    }
    return false;
}


/*스페이스 이외에 의미있는값이 있는지..*/
function isEmpty(input) {
    if (input.value == null || input.value.replace(/ /gi,"") == "") {
        return true;
    }
    return false;
}


/*메일주소체크*/
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return isValidFormat(input,format);
}



/*입력한 값이 숫자-숫자-숫자냐??*/

function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}





/*--------------2005-04-06 김진연추가--------------*/

/*숫자로만 되어있는지..*/
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}




/*특정문자로만 되어있는지..*/
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}


function checkDigit_saupG(num){
	var chkRule = "137137135";
	var strCorpNum = num;
	var step1, step2, step3, step4, step5, step6, step7;

	step1 = 0;			// 초기화

	for (i=0; i<7; i++)
	{
		step1 = step1 + (strCorpNum.substring(i, i+1) *chkRule.substring(i, i+1));
	}

	step2 = step1 % 10;
	step3 = (strCorpNum.substring(7, 8) * chkRule.substring(7, 8))% 10;
	step4 = strCorpNum.substring(8, 9) * chkRule.substring(8, 9);
	step5 = Math.round(step4 / 10 - 0.5);
	step6 = step4 - (step5 * 10);
	step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;

	if (strCorpNum.substring(9, 10) != step7)   // 결 과 비교 판단
	{
		alert("사업자 번호가 틀린 곳이 있습니다!")
		return 0;
	}
	return 1;
}



function checkSaup_nonDashG( str ){
	if ( isEmpty( str ))
	{
		alert("사업자번호를 입력하세요");
		return 0;
	}

	if ( !isNumberG( str ) )
	{
		alert("사업자번호는 숫자만 허용됩니다.");
		return 0;
	}


	if ( str.value.length != 10)
	{
		alert("사업자번호는 10자입니다.");
		return 0;

	}

	if (!checkDigit_saupG(str.value))
	{
		return 0;
	}

	return 1;

}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}


/* e-book */
	function wndWebBook()	{
			var win = window.open('/diary/eBook.htm','MaumeBook', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=0,top=0,width='+window.screen.width + ',height='+window.screen.height)
	}
	function wndWebBook2()	{
			var win = window.open('/diary2/eBook.htm','MaumeBook2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=0,top=0,width='+window.screen.width + ',height='+window.screen.height)
	}
	function wndWebBook3()	{
			var win = window.open('/diary3/eBook.htm','MaumeBook3', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=0,top=0,width='+window.screen.width + ',height='+window.screen.height)
	}




/*--------------2005-04-06 김진연추가끝--------------*/

/*-------------- 황준현 추가 --------------*/
// 스페이스, 탭등 없애주는 정규화식 적용
// 적용방법 -- form.mm_pwd.value = replace_space(form.mm_pwd.value);
	function replace_space(FormValue){
		var tmp = FormValue;
		tmp = tmp.replace(/\s/g,"");
		return tmp;
	}


// 추가결제
function go_settle_all(){
	url = "/myroom/my_settle_pop.asp " ;
	openWindow05(url, 520, 550, 10, 10, "my_settle_pop");
}

/* SNS Share */
function ShareSNS(sns,sTitle,sUrl){
		if(sTitle=='') {sTitle = document.title;}
		if(sUrl=='') {sUrl = document.location.href};

		switch(sns)
		{
		case 'tw':
		  var shref ="http://twitter.com/home?status="+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
		  break;
		case 'fa':
  		var shref ="http://www.facebook.com/share.php?u="+encodeURIComponent(sUrl)+"&t="+encodeURIComponent(sTitle);
		  break;
		case 'm2':
		  var shref ="http://me2day.net/posts/new?new_post[body]"+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
		  break;
		default:
		  shref=sUrl;
		}

	  var sWindow=window.open(shref);
	  if (sWindow){
	    sWindow.focus();
	  }
}


/* SNS Photo */
function PhotoSNS(sns,sTitle,sUrl){
		if(sTitle=='') {sTitle = document.title;}
		if(sUrl=='') {sUrl = document.location.href};

		switch(sns)
		{
		case 'tw':
		  var shref ="http://twitter.com/home?status="+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
		  break;
		case 'fa':
  		var shref ="http://www.facebook.com/share.php?u="+encodeURIComponent(sUrl)+"&t="+encodeURIComponent(sTitle);
		  break;
		case 'm2':
		  var shref ="http://me2day.net/posts/new?new_post[body]"+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
		  break;
		default:
		  shref=sUrl;
		}

	  var sWindow=window.open(shref);
	  if (sWindow){
	    sWindow.focus();
	  }
}

// 비밀번호 체크 모듈
	function chkPW(val){
		rea=/[a-zA-Z]/; //영문
		re0=/[0-9]/; //숫자
		flag=0; //체크플래그

		if (val ==""){
			alert("비밀번호를 입력해주세요.");
			form.mm_pwd.focus();
			return 0;
		}
		if (val.length < 4 ){
			alert("비밀번호는 4자 이상입력하셔야 합니다.");
			form.mm_pwd.focus();
			return 0;
		}
		if(rea.test(val)){ //영문테스트
			flag+=1;
		}
		if(re0.test(val)){ //숫자테스트
			flag+=2;
		}
		if(flag!=3){ //오류인경우 에러출력
			alert("영문과 숫자가 포함되어야 됩니다.");
			form.mm_pwd.focus();
			return 0;
		}else{
			return 1;
		}
	}


/*-------------- 황준현 추가끝 --------------*/
