<!--
var OBJ;

NS4=(document.layers)?1:0;
IE4=(document.all)?1:0;

function MM_swapImgRestore() { 
  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() { 
  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) { 
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { 
  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 MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { 
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features+"toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no");
}

function scroll() {
  var a=document.body.scrollTop+280 
  // 280 은 배너의 기준위치가 위쪽에서 280 픽셀 떨어지도록 설정한 것입니다
  menu.style.top=a
}

function OpenWindow(a,b,c) {
  OpenWin = window.open( a ,'popDialog','toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizble=yes, width=' + b + ',height=' + c );
}

//a		: URL
//b		: Width
//c		: Height
//str		: pop_name
//str2	: scroll 여부
function OpenWindow_Scroll(a,b,c,str,str2) {
  OpenWin = window.open( a , str,'toolbar=no,location=no,directories=no,status=no,scrollbars='+ str2 +',menubar=no,resizble=yes, width=' + b + ',height=' + c );
}

//a		: URL
//b		: Width
//c		: Height
//str		: pop_name
//str2	: scroll 여부
//left		: left
//top		: top
function OpenWindow_Location(a,b,c,str,str2, left, top) {
  OpenWin = window.open( a , str,'toolbar=no,location=no,directories=no,status=no,scrollbars='+ str2 +',menubar=no,resizble=yes, width=' + b + ',height=' + c +', left=' + left +', top='+ top);
}

function MM_controlSound(x, _sndObj, sndFile) { 
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}

function CheckAll(form, id, range) {
	var chk = form;

	if (form.checkboxAll.checked == true) {
		for (var i=0; i<chk.length;i++) {
			if (chk[i].type == "checkbox" && chk[i].checked == false) {
				chk[i].checked = true;
				hL(chk[i]);
			}
		}
	}
	else {
		for (var i=0; i<chk.length;i++) {
			if (chk[i].type == "checkbox" && chk[i].checked == true) {
				chk[i].checked = false;
				dL(chk[i]);
			}
		}
	}
}

function ChangeList(CB) {
  var TB=TO=0;

  if (CB.checked)
     hL(CB);
  else
     dL(CB);

  for (var i=0;i<CB.length;i++){
      var e = document.MyChannelList.elements[i];
	  if ((e.name != 'allbox') && (e.type=='checkbox')){
	     TB++;
		 if (e.checked)	TO++;
	  }
  }
}

function hL(E) {
  if (IE4) {
     while (E.tagName!="TR") {E=E.parentElement;}
  }	else {
	 while (E.tagName!="TR") {E=E.parentNode;}
  }
  E.className = "H";
}

function dL(E) {
  if (IE4) {
	 while (E.tagName!="TR") {E=E.parentElement;}
  }	else {
	 while (E.tagName!="TR") {E=E.parentNode;}
  }
  E.className = "";
}


function surfto(Form) { 
  var targetLink=Form.GoLink.selectedIndex;

  window.open(Form.GoLink.options[targetLink].value, "", ""); 
  Form.GoLink.selectedIndex = 0; 
}


function OnImageLoad(targetImage,maxWidth,maxHeight) {
  var newimgX, newimgY;
  var newWidth, newHeight;
  var newImage;

  newImage = new Image();
  newImage.src = targetImage.src;
  imgw = newImage.width;
  imgh = newImage.height;

  if (imgw > maxWidth || imgh > maxHeight) {
     if (imgw > imgh) {
        if (imgw > maxWidth)
           newWidth = maxWidth;
        else
           newWidth = imgw;
           newHeight = Math.round((imgh*newWidth)/imgw);
     } else {
        if (imgh > maxHeight)
           newHeight = maxHeight;
        else
           newHeight = imgh;
           newWidth = Math.round((imgw*newHeight)/imgh);
     }
     newimgX = maxWidth/2 - newWidth/2;
     newimgY = maxHeight/2 - newHeight/2;

     targetImage.onload = null;
     targetImage.src = newImage.src;
     targetImage.width = newWidth;
     targetImage.height = newHeight;
  } else {
     newWidth = imgw;
     newHeight = imgh;
     targetImage.width = newWidth;
     targetImage.height = newHeight;
  }
}

function CheckStrLen(obj, MaxLen, FieldName) {
	var i, len=0;
	if (typeof obj == "undefined") {
		return true
	}
	var s = obj.value;



	for(i=0;i < s.length; i++) (s.charCodeAt(i) > 255)? len+=2:len++;



	if (MaxLen < len) {
		if (FieldName != "") alert(FieldName + "은(는) " + MaxLen + "자를 넘을 수 없습니다(한글은 글자당 2자로 계산됩니다.)");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, MaxLen);
		obj.focus();
		return false;
	}
	return true;
}


function assert_msglen(message, maximum)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	return msg;
}

function GoPage(no) {
    document.ListForm.Page.value = no;
    document.ListForm.submit();
}

function Search() {
  document.Search.submit();
  return;
}

function Check_ID(input) {
  var err_cnt=0
  for (var i = 0; i < input.length; i++) {
      var val = input.charAt(i);
      if (!((val >= "0" && val <= "9") || (val >= "a" && val <= "z") || (val >= "A" && val <= "Z"))) err_cnt ++;
  }
  if (err_cnt == 0 ) {
     return true;
  } else {
     return false;
  }
}

function CheckEmail(input) {
  var err_cnt=0

  if (input.value.length > 0) {
     if (input.value.indexOf("@") == -1 || input.value.indexOf(".") == -1) err_cnt ++;
     if (err_cnt != 0 ) return false;

	 if ((input.value.indexOf(".@") != -1) || (input.value.indexOf("@.") != -1) ||
	     (input.value.substring(0,1) == ".") || (input.value.substring(0,1) == "@") ||
		 (input.value.substring(input.value.length-1,input.value.length) == ".") ||
		 (input.value.substring(input.value.length-1,input.value.length) == "@")) {
		err_cnt ++;
     }
     if (err_cnt != 0 ) return false;

     for (i=0; i < input.value.length; i++) {
         var val = input.value.charAt(i);
         if (!((input.value.substring(i,i+1) == "@") || (input.value.substring(i,i+1) == ".") ||
               (input.value.substring(i,i+1) == "-") || (input.value.substring(i,i+1) == "_") ||
               (val >= "0" && val <= "9") || (val >= "a" && val <= "z") || (val >= "A" && val <= "Z"))) err_cnt ++;
     }
     if (err_cnt != 0 ) return false;
  } else err_cnt ++;

  if (err_cnt == 0 ) return true;
  else return false;
}

function CheckEmail2(input) {
  var err_cnt=0

  if (input.length > 0) {
     if (input.indexOf("@") == -1 || input.indexOf(".") == -1) err_cnt ++;
     if (err_cnt != 0 ) return false;

	 if ((input.indexOf(".@") != -1) || (input.indexOf("@.") != -1) ||
	     (input.substring(0,1) == ".") || (input.substring(0,1) == "@") ||
		 (input.substring(input.length-1,input.length) == ".") ||
		 (input.substring(input.length-1,input.length) == "@")) {
		err_cnt ++;
     }
     if (err_cnt != 0 ) return false;

     for (i=0; i < input.length; i++) {
         var val = input.charAt(i);
         if (!((input.substring(i,i+1) == "@") || (input.substring(i,i+1) == ".") ||
               (input.substring(i,i+1) == "-") || (input.substring(i,i+1) == "_") ||
               (val >= "0" && val <= "9") || (val >= "a" && val <= "z") || (val >= "A" && val <= "Z"))) err_cnt ++;
     }
     if (err_cnt != 0 ) return false;
  } else err_cnt ++;

  if (err_cnt == 0 ) return true;
  else return false;
}

function CheckHome(input) 
{
	var err_cnt=0
	if (input.length > 0) 
	{
		if (input.indexOf("http://") == -1) err_cnt ++;
		if (err_cnt != 0 ) return false;
		
		if (input.substring(0,7) != "http://") err_cnt ++;
		if (err_cnt != 0 ) return false;
    
	} else err_cnt ++;

	if (err_cnt == 0 ) return true;
	else return false;
}




function CheckSpecial(chk_str) {
  var subject = '~!@#$%^=+\|?□■△▲▽☆★▼○●◎◇◆◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑☜☞♨★☆▒▤ⓞ:;'
  var err_cnt=0
  for(i=0; i < chk_str.length;i++) 
     if (subject.indexOf(chk_str.substring(i,i+1)) > 0) err_cnt ++;
  if (err_cnt == 0 ) {
     return true;
  } else {
     return false;
  }
}

function CheckDigit(chk_str) {
  var subject = '0123456789'
  var err_cnt=0
  for(i=0; i < chk_str.length;i++) 
     if (subject.indexOf(chk_str.substring(i,i+1)) > 0) err_cnt ++;
  if (err_cnt == 0 ) {
     return true;
  } else {
     return false;
  }
}

//큰이미지 보기
function imgWindow(ref,I,P) {
	winObj = window.open('/html/'+ref+'?'+'MessageID='+I+'&imgLarge='+P, 'imgView', 'width=100,height=100');
                winObj.focus();

}
//주민등록번호체크
function isJumin(num1,num2){
	var yy = num1.substring(0,2)
	var mm = num1.substring(2,4)
	var dd = num1.substring(4,6)
	var sex = num2.substring(0,1)
	var chk =0;
	
	for (var i = 0; i <=5 ; i++){
		chk = chk + ((i%8+2) * parseInt(num1.substring(i,i+1)));
	}
	for (var i = 6; i <=11 ; i++){
		chk = chk + ((i%8+2) * parseInt(num2.substring(i-6,i-5)));
	}
	chk = 11 - (chk %11);
	chk = chk % 10;
	
	
	if ((num1.length!=6)||(yy <25||mm <1||mm>12||dd<1)){
		return false;
	} else if ((sex != 1 && sex !=2 )||(num2.length != 7 )){
		return false;
	} else if (chk != num2.substring(6,7)) {
		return false;
	}
	return true;
}

// 주민번호 체크
function check_juminno(juminno){
	if(juminno=="" || juminno==null || juminno.length!=13){ return false; }
	var jumin1 = juminno.substr(0,6);
	var jumin2 = juminno.substr(6,7);
	var yy = jumin1.substr(0,2);	// 년도
	var mm = jumin1.substr(2,2);	// 월
	var dd = jumin1.substr(4,2);	// 일
	var genda = jumin2.substr(0,1);	// 성별
	var msg, ss, cc;

	if(!isNumeric(jumin1)){ return false;}
	if(jumin1.length != 6){ return false; }
	if(yy < "00" || yy > "99" || mm < "01" || mm > "12" || dd < "01" || dd > "31"){ return false; }
	if(!isNumeric(jumin2)){ return false; }
	if(jumin2.length != 7){ return false; }
	if(genda < "1" || genda > "4"){ return false; }
	cc = (genda == "1" || genda == "2") ? "19" : "20";
	if(isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false){ return false; }
	if(!isSSN(jumin1, jumin2)){ return false; }
	return true;
}

// 재외국인 번호 체크
function check_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 isNumeric(s){
	for(i=0; i<s.length; i++){
		c = s.substr(i, 1);
		if(c < "0" || c > "9") return false;
	}
	return true;
}


function isSSN(s1, s2){
	n = 2;
	sum = 0;
	for(i=0; i<s1.length; i++)
		sum += parseInt(s1.substr(i, 1)) * n++;
	for(i=0; i<s2.length-1; i++){
		sum += parseInt(s2.substr(i, 1)) * n++;
		if(n == 10) n = 2;
	}
	c = 11 - sum % 11;
	if(c == 11) c = 1;
	if(c == 10) c = 0;
	if(c != parseInt(s2.substr(6, 1))) return false;
	else return true;
}

function isYYYYMMDD(y, m, d){
  switch(m){
  case 2: // 2월의 경우
   if(d > 29) return false;
   if(d == 29){
    // 2월 29의 경우 당해가 윤년인지를 확인
    if((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0))
     return false;
   }
   break;
  case 4: // 작은 달의 경우
  case 6:
  case 9:
  case 11:
   if(d == 31) return false;
  }
  // 큰 달의 경우
  return true;
 }

var KeyType=0;	// 숫자만 체크함.
var KeyType=1;	// 확장 키보드의 숫자까지 체크함.
var KeyType=2;	// 영문 소문자 체크함
var KeyType=4;	// 영문 대문자 체크함
var KeyType=8;	// 영문 대소문자 체크함
var KeyType=9;	// 숫자 및 영문 대소문자 체크함

//키 숫자 체크
function pub_chkKeyPress(chkType){
	// delete control key 와 상하좌우 허용함.
	// Delete = 46, BackSpace=8 , Tab=9 , left-right=37-40 Enter = 13 
	if( ((event.keyCode>=37)&&(event.keyCode<=40))||((event.keyCode>=8)&&(event.keyCode<=9))||(event.keyCode==46) ) {
		return true;
	}
	if(chkType==1){
		if( ( (event.keyCode>=48)&&(event.keyCode<=57) ) || ( (event.keyCode>=96)&&(event.keyCode<=105) ) ) {
			return true;
		}	
		else{
			event.returnValue=false;
			return false;
		} 
	}

	if(chkType==3){
		if( ( (event.keyCode>=48)&&(event.keyCode<=57) ) || ( (event.keyCode>=96)&&(event.keyCode<=105) ) || ((event.keyCode >= 110)&&(event.keyCode <= 110))) 
		{
			return true;
		}	
		else
		{
			event.returnValue=false;
			return false;
		} 
	}

	if(chkType==4){
		if( ( (event.keyCode>=48)&&(event.keyCode<=57) ) || ( (event.keyCode>=96)&&(event.keyCode<=105) ) || ((event.keyCode >= 189)&&(event.keyCode <= 189)) || ((event.keyCode >= 109)&&(event.keyCode <= 109))) 
		{
			return true;
		}	
		else
		{
			event.returnValue=false;
			return false;
		} 
	}
}

function isBlank(obj)
{
	if (obj.value.split(" ").join("") == ""){
		obj.value="";
    return true;
	}
}

//게시판 검색1
function form_search1()
	{
		var f = document.form_search;	
			if(f.search_value.value == "") 
			{
				alert("검색어를 입력하십시오!");
				f.search_value.focus();
				return ;
			}
		f.submit();
	}

//게시판 검색2
function Form_S()
{
var f = document.Form_Search;
	for (var i =0;i < f.Search_Type.length;i++ )
	{
		if (f.Search_Type[i].checked == true)
		{
			if (f.Search_Value.value =="")
			{
				alert("검색어를 입력해주세요.");
				f.Search_Value.focus();
				return;
			}
		}
	}
	f.submit();
}

//자동 넘김 다른 폼으로...

function focus_next(num,fromform,toform){
		var str = fromform.value.length;
		if(str == num)
			toform.focus();
	}

//자동 더하기
//str:폼이름
//str1:필드이름
//str2:add:더하기, minus :빼기
function Volume_add(f,str1,str2)
{
	var VolumeT = 0;
	var frm = eval(f+"."+str1);

	if (frm.value =="")
	{
		frm.value  = 0;
	}
	var str_fild = frm.value;
	if (str2 =="add")
	{
		VolumeT = new Number(str_fild) + 1;
	}
	if (str2 =="minus")
	{
		VolumeT = new Number(str_fild) - 1;
	}

	if (VolumeT <= 0)
	{
		alert("더이상 줄일수 없습니다.");
		VolumeT = 1;
	}
	frm.value = VolumeT;	

}


//메시지 박스에서 메시지 바이트 수로 계산
function CheckMsg(obj,bytebox, num)
{ 
	var str,msg; 
	var len = 0; 
	var temp; 
	var count = 0; 

	msg = obj.value; 
	str = new String(msg); 
	len = str.length;
	input_name_str =new String(msg);
	input_name_length = input_name_str.length;

	for(i=0;i<input_name_length;i++)
	{
		one_str=input_name_str.charAt(i);
		if(escape(one_str).length > 4)
		{
			count+=2;
		}
		else if(one_str != '\r')
		{
			count++;
		}
	}
	
	bytebox.value = count; 

	if(count > num) 
	{ 
		obj.blur(); 
		obj.focus(); 
		alert("메시지 내용은 "+num+"글자까지만 가능합니다."); 
		CutChar(obj,bytebox,num); 
	} 
} 

/* 콤마체크*/
function Comma_Chk(input){
var err_cnt=0
	if (input.value.length > 0) 
	{
		if (input.value.indexOf(",") != -1)
			err_cnt ++;
		if (err_cnt != 0 ) return false;
	}else  
		if (err_cnt == 0 ) return true;
		else return false;
}
// 쉼표'/'로 변경저장 //
function CommaReplace(str1, str2) {
	var kk, x, oChar, nChar;

	for (kk = 0 ; kk <= str2 ; kk++) {
		nChar = '';

		for (x = 0 ; x <= str1[kk].value.length ; x++) {
			oChar = str1[kk].value.charAt(x);
			if (oChar == ',') { oChar = '/'; }

			nChar = nChar + oChar;
		}

		str1[kk].value = nChar;
	}
}
/*Textarea 길이체크*/
function input_cal_byte(input_name, max_byte)
{
	var input_name_str, byte_count=0, input_name_length=0, one_str, ext_byte;
	input_name_str = new String(input_name.value);
	input_name_length = input_name_str.length;
		
		for(i=0;i<input_name_length;i++)
		{
			one_str=input_name_str.charAt(i);
			if(escape(one_str).length > 4)
			{
				byte_count+=2;
			}
			else if(one_str != '\r')
			{
				byte_count++;
			}
		}

		if(byte_count > max_byte)
		{
			ext_byte = byte_count - max_byte;
			alert('\n내용을 '+max_byte+'Byte 이상 입력하실수 없습니다.\n\n입력하신 내용 중 초과 '+ext_byte+'Byte는 자동 삭제 됩니다.\n');
			input_cut_text(input_name,max_byte);
		}
}

//입력창 byte대로 자르기
function input_cut_text(input_name, max_byte)
{
	var input_name_str, byte_count=0, input_name_length=0, one_str;
	
	input_name_str = new String(input_name.value);
	input_name_length = input_name_str.length;
	
	for(i=0;i<input_name_length;i++)
	{
		if(byte_count < max_byte)
		{
			one_str=input_name_str.charAt(i);
			
			if(escape(one_str).length > 4)
			{
				byte_count+=2;
			}
			else if(one_str != '\r')
			{
				byte_count++;
			}
		}
		else
		{
			input_name_str = input_name_str.substring(0,i);
			break;
		}
	}
	
	if((max_byte%2) ==1)
	{
		input_name_length =(input_name_str.length-1);
		
		if(escape(input_name_str.charAt(input_name_length)).length > 4)
		{
			input_name_str = input_name_str.substring(0,input_name_length);
		}
	}
	
	input_name.value = input_name_str;
	return input_name_str;
}

/* 폼 박스 배경 처리*/
function Back_Img(str, str2)
{
	var f = document.Form_Top;
	if (str.value =="")
	{
		str.style.backgroundImage ="url("+str2+")";
	}
}

function Right_click() {
	if ((event.button==2) || (event.button==2)) 
	{
		alert('죄송합니다.오른쪽 마우스금지입니다..');
	}
}
//특수문자 방지
function nonkr(inputname) 
{
	count=0
		for (i=0;i<inputname.length;i++)
		{
		ls_one_char = inputname.charAt(i);
			if(ls_one_char.search(/[0-9|a-z|A-Z|ㄱ-ㅎ|ㅏ-ㅣ|가-힝]/) == -1)
			{
				count++
			}
		}
		if(count!=0) {
		return true;
	}else{
		return false;
	}
}

//포인트
function number_format(numstr) 
{
var numstr = String(numstr);
var re0 = /(\d+)(\d{3})($|\..*)/;
	if (re0.test(numstr))
		return numstr.replace(
		re0,
		function(str,p1,p2,p3) 
		{ 
			return number_format(p1) + "," + p2 + p3; 
		}
	);
	else
		return numstr;
}
function count_Point(str)
{
	var frm = eval("document."+str);
	var minP = frm.Point_Maxuse.value;
	if(parseInt(frm.Use_Point.value) > parseInt(frm.Total_Price.value))
	{
		alert("총 결제금액을 넘었습니다.");
		frm.Use_Point.value = frm.Total_Price.value;
	}	
	else if(parseInt(frm.Use_Point.value) > parseInt(frm.MyPoint.value))
	{
		alert("보유하신 적립금을 넘었습니다.");
		frm.Use_Point.value = frm.MyPoint.value;
	}else if (parseInt(frm.Point_Maxuse.value) > 0)
	{
		if(parseInt(frm.Use_Point.value) > parseInt(frm.Point_Maxuse.value))
		{
			alert(minP+"point 이상은  사용할수 없습니다.");
			frm.Use_Point.value = frm.Point_Maxuse.value;
		}
	}

	RpriceChk(str);
	
}	

function RpriceChk(str)
{
	var frm = eval("document."+str);
	var co_pr = frm.Total_Price.value-frm.Use_Point.value-frm.Coupon_Price.value;
	document.all.P_price.innerText = number_format(co_pr);
	frm.Total_Result.value = co_pr;
}

function point_check(str)
{	
	var frm = eval("document."+str);
	var minP = frm.Point_Minuse.value;
	if (frm.Point_Chk.checked == true)
	{
		if (parseInt(frm.MyPoint.value) > 0)
		{
			if (parseInt(frm.MyPoint.value) < parseInt(frm.Point_Minuse.value))
			{
				alert(minP+"point 이상부터 사용가능 합니다.\n\n보유포인트가 부족합니다.");
				frm.Point_Chk.checked =false;
				return;
			}else{
			
				frm.Use_Point.readOnly=false;
				frm.Use_Point.focus();	
			}
		}else{
		
			frm.Use_Point.readOnly=false;
			frm.Use_Point.focus();	
		}
	}
	else
	{
		frm.Use_Point.value="";
		frm.Use_Point.readOnly=true;
	}
}
// #버튼클릭시 위로 올라가는 현상 막기//
function click() {
         return;
    }


function Email_Input(a, str)
{
	var f = eval("document."+str);
	f.Email2.value =a;
}

function Email_Input2(str, str1, str2)
{	
	var EN = eval("document."+str+"."+str2);
	EN.value =str1;
}

//공백 체크~
function isBlank(obj)
{
	if (obj.value.split(" ").join("") == ""){
		obj.value="";
    return true;
	}
}

// 쉼표'/'로 변경저장 //
function CommaReplace1(str1, str2) 
{
	var kk, x, oChar, nChar;	
	for (kk = 0 ; kk < str2 ; kk++) 
	{
		nChar = '';

		for (x = 0 ; x <= str1[kk].value.length ; x++) {
			oChar = str1[kk].value.charAt(x);
			if (oChar == ',') { oChar = '/'; }

			nChar = nChar + oChar;
		}

		str1[kk].value = nChar;
	}	
}

function CommaReplace2(str1, frm) 
{
	var kk, x, oChar, nChar;	
	var fname = eval("document."+frm+"."+str1);
	nChar = '';

	for (x = 0 ; x <= fname.value.length ; x++) {
		oChar = fname.value.charAt(x);
		if (oChar == ',') { oChar = '/'; }

		nChar = nChar + oChar;
	}

	fname.value = nChar;
}

function view_board(width,height,img)
{
	width = parseInt(width);
	window.open('../board/view_img.asp?img=' + img,'previewwin','directories=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no,width=' + width + ',height=' + height)
}

function view_board_etc(width,height,img, inIDX)
{
	width = parseInt(width)+45;

	height = parseInt(height)+30;
	window.open('../keycomm/view_etc.asp?img=' + img+'&IDX='+inIDX,'previewwin'+inIDX,'directories=no, location=no, menubar=no, resizable=no, scrollbars=yes, status=no, titlebar=no, toolbar=no,width=' + width + ',height=' + height)
}

	//레이어창
function _ID(obj){return document.getElementById(obj)}

function popupLayer(s,w,h)
{
	if (!w) w = 600;
	if (!h) h = 400;

	var pixelBorder = 3;
	var titleHeight = 12;
	w += pixelBorder * 2;
	h += pixelBorder * 2 + titleHeight;

	var bodyW = document.body.clientWidth;
	var bodyH = document.body.clientHeight;

	var posX = (bodyW - w) / 2;
	var posY = (bodyH - h) / 2;
	hiddenSelectBox('hidden');	
	var obj = document.createElement("div");
	with (obj.style){
		zIndex= 200;
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		height = document.body.scrollHeight;
		backgroundColor = "#ffffff";
		filter = "Alpha(Opacity=70)";
		opacity = "0.5";
	}
	obj.id = "objPopupLayerBg";
	document.body.appendChild(obj);

	var obj = document.createElement("div");
	with (obj.style){
		zIndex= 200;
		position = "absolute";
		left = posX + document.body.scrollLeft;
		top = posY + document.body.scrollTop;
		width = w;
		height = h;
		backgroundColor = "#FFFFFF";
		border = "3px solid #000000";
	}
	obj.id = "objPopupLayer";
	document.body.appendChild(obj);

	var bottom = document.createElement("div");
	with (bottom.style){
		zIndex= 200;
		position = "absolute";
		width = w+20;
		height = titleHeight;
		left = pixelBorder * -1;
		top = (pixelBorder * -8);
		padding = "2px 0 0 0";
		textAlign = "right";
		backgroundColor = "";
		color = "#ffffff";
		font = "bold 11px tahoma";
	}
	bottom.innerHTML = "<table width='20' height='20' border='0' cellpadding='0' cellspacing='2' bgcolor='#000000'><tr bgcolor='#FFFFFF'><td align='center' onclick='closeLayer();' style='cursor:hand;'><img src='../board/img/btn_x.jpg' border='0'></td></tr></table>";
	obj.appendChild(bottom);

	var ifrm = document.createElement("iframe");
	with (ifrm.style){
		width = w - 6;
		height = h - pixelBorder * 2;
	}
	ifrm.frameBorder = 0;
	ifrm.src = s;
	obj.appendChild(ifrm);
}

function closeLayer(){
	hiddenSelectBox('visible');
	_ID('objPopupLayer').parentNode.removeChild( _ID('objPopupLayer') );
	_ID('objPopupLayerBg').parentNode.removeChild( _ID('objPopupLayerBg') );
}

function popupw_Layer(s,ww,hh)
{
	if (!ww) ww = 600;
	if (!hh) hh = 400;

	var pixelBorder = 3;
	var titleHeight = 12;
	ww += pixelBorder * 2;
	hh += pixelBorder * 2 + titleHeight;

	var bodyW = document.body.clientWidth;
	var bodyH = document.body.clientHeight;	

	var posX = (bodyW - ww) / 2;
	var posY = (bodyH - hh) / 2;
	
	hiddenSelectBox('hidden');
	
	var obj_w = document.createElement("div");
	with (obj_w.style){
		position = "absolute";
		left = 0;
		top = 0;
		width = "100%";
		height = document.body.scrollHeight+50;	
		backgroundColor = "#000000";
		filter = "Alpha(Opacity=10)";
		opacity = "0.5";
	}
	obj_w.id = "objPopupLayerBg_w";
	document.body.appendChild(obj_w);

	var obj_w = document.createElement("div");
	with (obj_w.style){
		position = "absolute";
		left = posX + document.body.scrollLeft;
		top = posY + document.body.scrollTop;
		width = ww;
		height = hh;
		backgroundColor = "#FFFFFF";
		border = "3px solid #FA8707";
	}
	obj_w.id = "objPopupLayer_w";
	document.body.appendChild(obj_w);

	var bottom_w = document.createElement("div");
	with (bottom_w.style){
		position = "absolute";
		width = ww+20;
		height = titleHeight;
		left = pixelBorder * -1;
		top = (pixelBorder * -8);
		padding = "2px 0 0 0";
		textAlign = "right";
		backgroundColor = "";
		color = "#ffffff";
		font = "bold 11px tahoma";
	}
	bottom_w.innerHTML = "<table width='20' height='20' border='0' cellpadding='0' cellspacing='2' bgcolor='#FA8707'><tr bgcolor='#FFFFFF'><td align='center' onclick='closew_Layer();' style='cursor:hand;'><img src='../board/img/btn_x.jpg' border='0'></td></tr></table>";
	obj_w.appendChild(bottom_w);

	var ifrm_w = document.createElement("iframe");
	with (ifrm_w.style){
		width = ww - 6;
		height = hh - pixelBorder * 2;
	}
	ifrm_w.frameBorder = 0;
	ifrm_w.src = s;
	obj_w.appendChild(ifrm_w);
}

function closew_Layer(){
	hiddenSelectBox('visible');
	_ID('objPopupLayer_w').parentNode.removeChild( _ID('objPopupLayer_w') );
	_ID('objPopupLayerBg_w').parentNode.removeChild( _ID('objPopupLayerBg_w') );
}

function hiddenSelectBox(mode)
{
 var obj = document.getElementsByTagName('select');
 for (i=0;i<obj.length;i++){
  obj[i].style.visibility = mode;
 }
}


function moveLayer(s,tn, tk, w, h, x, y)
{
	var tn=dhtmlwindow.open(tn, "iframe", s, tk, "width="+w+"px,height="+h+"px,top="+y+", left="+x+",resize=1,scrolling=1,center=0", "recal")
	
	tn.onclose=function()
	{
		return true;
	}
}

/*즐겨찾기추가*/
function bookmark(strurl, strname){
window.external.AddFavorite(strurl, strname)
}


function printDiv() {
	if(document.all['idMenu']) document.all['idMenu'].style.display='none';
	printPage = window.open("../board/printPage.asp", "Print", "width=800,height=600,scrollbars=yes");
	

	printPage.document.write('<html>');
	printPage.document.write('<head>');
	printPage.document.write('<title>Dream Of Doll</title>');
	printPage.document.write('<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">');
	printPage.document.write('<LINK href="../css/style_noback.css" type="text/css" rel="stylesheet">');
	printPage.document.write('</head>');
	printPage.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');	
	printPage.document.write('<' + 'script>');
	printPage.document.write('function printArea()');
	printPage.document.write('{');
	printPage.document.write('window.print();');
	printPage.document.write('}');
	printPage.document.write('<'+'/script>');
	printPage.document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
	printPage.document.write('<tr height=30 bgcolor=#dddddd><td align=center><a href="#" OnClick="javascript:printArea();"><img src="../board/img/print.jpg" border=0></a></td></tr>'); 
	printPage.document.write('<tr>'); 
	printPage.document.write('<td valign=top align=center><br>');
	printPage.document.write(document.all['idPrint'].innerHTML);
	if(document.all['idPrint2']) printPage.document.write(document.all['idPrint2'].innerHTML);
	if(document.all['idPrint3']) printPage.document.write(document.all['idPrint3'].innerHTML);
	printPage.document.write('</td>'); 
	printPage.document.write('</tr>');
	printPage.document.write('</table>'); 
	printPage.document.write('</body>');	
	printPage.document.write('</html>');
	if(document.all['idMenu']) document.all['idMenu'].style.display='block';

	//printPage.document.all['PrRgn'].innerHTML = document.all['idPrint'].innerHTML;
	setTimeout("printPage.history.go(0);", 1000);
}

function printDiv_w() {
	if(document.all['idMenu']) document.all['idMenu'].style.display='none';
	printPage = window.open("../board/printPage.asp", "Print", "width=800,height=600,scrollbars=yes");
	

	printPage.document.write('<html>');
	printPage.document.write('<head>');
	printPage.document.write('<title>Dream Of Doll</title>');
	printPage.document.write('<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">');
	printPage.document.write('<LINK href="../admin/style_admin.css" type="text/css" rel="stylesheet">');
	printPage.document.write('</head>');
	printPage.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');	
	printPage.document.write('<' + 'script>');
	printPage.document.write('function printArea()');
	printPage.document.write('{');
	printPage.document.write('window.print();');
	printPage.document.write('}');
	printPage.document.write('<'+'/script>');
	printPage.document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
	printPage.document.write('<tr height=30 bgcolor=#dddddd><td align=center><a href="#" OnClick="javascript:printArea();"><img src="../board/img/print.jpg" border=0></a></td></tr>'); 
	printPage.document.write('<tr>'); 
	printPage.document.write('<td valign=top align=center><br>');
	printPage.document.write(document.all['idPrint'].innerHTML);
	if(document.all['idPrint2']) printPage.document.write(document.all['idPrint2'].innerHTML);
	if(document.all['idPrint3']) printPage.document.write(document.all['idPrint3'].innerHTML);
	printPage.document.write('</td>'); 
	printPage.document.write('</tr>');
	printPage.document.write('</table>'); 
	printPage.document.write('</body>');	
	printPage.document.write('</html>');
	if(document.all['idMenu']) document.all['idMenu'].style.display='block';

	//printPage.document.all['PrRgn'].innerHTML = document.all['idPrint'].innerHTML;
	setTimeout("printPage.history.go(0);", 1000);
}

//-->