var send_chk = false;	// Send 2ÁßÃ³¸® ¹æÁö

// »ç¿ëÀÚ ÇØ»óµµ
var c_w = screen.width;
var c_h = screen.height;

function checkedchk(str) { 	// ¼±ÅÃµÈ°ÍÀÌ ÀÖ´ÂÁö È®ÀÎ
//	alert(str);
	var f = eval("window.document."+ str);
	var chk_cidx = false;
	if (f.c_idx != null) {
		no = f.c_idx.length;
	} else {
		return true;
	}
	if (no > 1) { // Ã¤Å©¹Ú½º°¡ ¿©·¯°³ ÀÖ´Â°æ¿ì
		for(i=0,j=0; i <= (no-1) ; i++) {
			if(f.c_idx[i].checked == true) j++;
		}
		if (j == 0) return true;
	} else if (no != 0) { // Ã¤Å©¹Ú½º°¡ ÇÑ°³ ÀÖ´Â °æ¿ì
		if(f.c_idx.checked == false) return true;
	} else { // Ã¤Å©¹Ú½º°¡ ÇÏ³ªµµ ¾ø´Â°æ¿ì
		return true;
	}
}

function chkspace(str) {	// ºñ¿© ÀÖ°Å³ª °ø¹é ÀÔ·Â È®ÀÎ
	if ( (str.length == 0) || (str.search(/\S/) < 0) )
		return false;
	else
		return true;
}

function ImageCheck(str) {	// ÀÌ¹ÌÁö ÆÄÀÏÀÎ°¡?
	var idx1 = str.lastIndexOf(".") + 1;
	var exec = str.substring(idx1);
	exec = exec.toLowerCase();
	if (exec != "gif" && exec != "jpg" && exec != "bmp" && exec != "png") {	return false; }
	else { return true; }
}

function EnterCheck() {	// ¸®ÅÏ Ã³¸®
	if (event.keyCode == 13) return false;
}

function NumerCheck() {	// ¼ýÀÚ¸¸ ÀÔ·Â Ã³¸®
	/*
	49 - 58 : ¼ýÀÚ
	65 - 90 : a - z
	97 - 106: number pad ¼ýÀÚ
	8  : ¹é½ºÆäÀÌ½º
	9  : ÅÇ
	20 : Num Lock
	35 : HOME
	36 : END
	37 : <- (ÁÂÈ­»ìÇ¥)
	39 : -> (¿ìÈ­»ìÇ¥)
	46 : DEL
	109: -
	189: - (number pad)
	191: /
	111: / (number pad)
	190: . (¼Ò¼ýÁ¡)
	110: . (number pad ¼Ò¼ýÁ¡)
	229:ÇÑ/¿µ/ÇÑÀÚ Å°
	*/
	//alert(event.keyCode);
	if (
		event.keyCode == 8 ||
		event.keyCode == 9 ||
		event.keyCode == 35 ||
		event.keyCode == 36 ||
		event.keyCode == 37 ||
		event.keyCode == 39 ||
		event.keyCode == 46 ||
		event.keyCode == 109 ||
		event.keyCode == 189 ||
		event.keyCode == 191 ||
		event.keyCode == 111 ||
		event.keyCode == 110 ||
		event.keyCode == 190
	   ) {	return true; }

	if ( ( 94 < event.keyCode && event.keyCode < 106 ) || (46 < event.keyCode && event.keyCode < 58) )
		return true;
	alert("¼ýÀÚ  .   /  -  ¹®ÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
	return false;
}

function EmailCheck(s) {	// ÀÌ¸ÞÀÏ Ã³¸®
	var isEmail1 = /^\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w+$/;
	var isEmail2 = /^.*@[^_]*$/;
	var isEmail3 = /^.*@hanmail.net/;
	var isEmail4 = /^.*@daum.net/;
	var result = (isEmail1.test(s) && isEmail2.test(s) && !isEmail3.test(s) && !isEmail4.test(s));
	return result;
}

// POPÄíÅ° °ü¸®
function setCookie( strvalue, value, expiredays ) {
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = strvalue + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" + "coffee.ddoi.net"
}
function getCookie( strvalue ) {
	var strvalueOfCookie = strvalue + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+strvalueOfCookie.length);
		if ( document.cookie.substring( x, y ) == strvalueOfCookie ) { 
			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 goURL(url) {
	location.href=url;
}

// »õÃ¢¿­±â
function openWIN(url,box,scroll,i,j) {
	// È­¸éÀ§Ä¡ ±¸ÇÏ±â
	var Full_w = parseInt(c_w / 2) - parseInt(i / 2)
	var Full_h = parseInt(c_h / 2) - parseInt(j / 2)
	window.open(url,box,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+ scroll +",resizable=no,top="+ Full_h +",left="+ Full_w +",width="+ i +",height="+ j);
}

function chk_juso(i) {	// ÁÖ¼ÒÃ¢ ¿­±â
	window.open("/inc/zip.asp?chkid="+ i,"zipcode","width=370,height=166,scrollbars=no,resizable=no");
	return;
}

function upload_bar() {
	document.all["UPLOADIMG"].src="/images/upload_bar.gif";
	document.all["UPLOADBAR"].style.display="";
}

function OpenAnotherWin(szhref){
        AnotherWin = window.open(szhref,"AnotherWin", 
        "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyistory=0,resizable=no,width=640,height=720");
}

function OpenAnotherWin2(szhref){
        AnotherWin = window.open(szhref,"AnotherWin", 
        "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyistory=0,resizable=no,width=640,height=650");
}

function OpenAnotherWin3(szhref){
        AnotherWin = window.open(szhref,"AnotherWin", 
        "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyistory=0,resizable=no,width=640,height=505");
}


// µå¸²À§¹ö
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_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];}
}

// ¿À¸¥ÂÊ ¹öÆ° Å¬¸¯À» ¸øÇÏ°Ô ÇÏ´Â ºÎºÐ

if (window.Event) // ³Ý½ºÄÉÀÌÇÁ¿¡¼­¸¸ ´ë¹®ÀÚ E.
  document.captureEvents(Event.MOUSEUP); // mouse up ÀÌº¥Æ®¸¦ ÀâÀ½

function nocontextmenu() // IE4¿¡¼­¸¸ Àû¿ë, ´Ù¸¥ ºê¶ó¿ìÀú´Â ¹«½Ã
{
   event.cancelBubble = true
   event.returnValue = false;

   return false;
}

function norightclick(e)   // ´Ù¸¥ ¸ðµç ºê¶ó¿ìÀú¿¡¼­ ÀÛµ¿
{
   if (window.Event)   // ´Ù½Ã, IE ¶Ç´Â NAV ?
   {
      if (e.which == 2 || e.which == 3)
         return false;
   }
   else
      if (event.button == 2 || event.button == 3)
      {
         event.cancelBubble = true
         event.returnValue = false;
         return false;
      }
   
}

document.oncontextmenu = nocontextmenu;      // IE5+ ¿ë
document.onmousedown = norightclick;      // ´Ù¸¥ ºê¶ó¿ìÀú ¿ë
