
//---------------------------------------------
// ÆÄÀÏ Ã·ºÎ Çã¿ë, ±ÝÁö Ã¼Å©
// frmFile	: ÆÄÀÏÃ·ºÎ¸í
// fileMime	: Mime Çü½Ä(¾÷·Îµå ±ÝÁö ÆÄÀÏ¸í)
//---------------------------------------------
function file_upload_ext(frmFile, fileMime) {

	var img = new Image();
	
	if (frmFile.value != "") {
		img.dynsrc = frmFile.value;	
		imgFileSize = img.fileSize;	
		var str1 = frmFile.value;
		strlen = str1.length;
					
		for (i = 0;i < str1.length;i++) {
			ch = str1.charAt(i);
			if (ch == "\\"){
				   var last_i = i;
				   var fileyn = "Y" 
			}
		}
	
		last_i = last_i +1;
		endstr = strlen - last_i;
		str = str1.substr(last_i, endstr);
		var strlen = str.length;
		strlen = parseInt(strlen);
			
		str_file = str.substr(strlen-3,strlen-1);
		str_file = str_file.toUpperCase();
					
		if (fileMime == "") {
			fileMime = "JPG|GIF|PNG|PDF|ZIP|DOC|HWP|XLS|PPT|TXT|SWF|";
		}	else {
			fileMime = fileMime.toUpperCase();
		}	
		
		if (fileMime.indexOf(str_file) < 0) {
			alert("¾÷·Îµå°¡ ±ÝÁöµÈ ÆÄÀÏÀÔ´Ï´Ù.");
			return false;
		} else {
			return true;
		}		
	}
	
	return false;	
}


// ¼ýÀÚÃ¼Å©
function numberChk() {
	if ((event.keyCode < 48) || (57 < event.keyCode)) {
		event.returnValue=false;
		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä');	
	}
	/*  
	if(isNaN(num.value)) {
		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä');
		num.value = "";
		num.focus();
		return false;
	}
	*/	
}


// ÀüÃ¼¼±ÅÃ
var checkflag = "false";
function check(field) {
	if (field == undefined) return;
	
	if (checkflag == "false") {
		if (!field.length) { field.checked = true; }
		
		for (i = 0; i < field.length; i++) { field[i].checked = true;}
		checkflag = "true";
		//document.form3.but1.value="¼±ÅÃÇØÁ¦";
	} else {
		if (!field.length) { field.checked = false; }
		
		for (i = 0; i < field.length; i++) { field[i].checked = false; }
		checkflag = "false";
		//document.form3.but1.value="ÀüÃ¼¼±ÅÃ";			
	}
}

// ÄíÅ°±Á±â
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}


// À©µµ¿ì »ý¼º À§Ä¡ÀÎ left, topÀÇ °ªÀÌ 0 º¸´Ù ÀÛÀ» °æ¿ì ¸¶¿ì½º À§Ä¡·Î ÀÚµ¿ Ãâ·Â
function open_window(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
	var param;
	
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  
  if(left < 0) left = event.screenX - (width / 2);
  if(top < 0) top = event.screenY - (height / 2);

  param = 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str;

  window.open(url, name, param);
}

//--------------------------------------------------------------------------------------
// Á¦Ç°°ü¸®
//--------------------------------------------------------------------------------------
function MouseOutImg(name)
{
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name);
	if (name == '')
	return;
	if (img && img.altsrc) {
	img.src    = img.altsrc;
	img.altsrc = null;
	} 
}

function MouseOverImg(name, rpath)
{
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? 'document.'+name : 'document.all.'+name);
	if (name == '')
	return;
	if (img) {
	img.altsrc = img.src;
	img.src    = rpath;
	} 
}
//--------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------
// È¸¿ø°ü¸®
//--------------------------------------------------------------------------------------
function idChkPop(f){
	var asp="/Member/ID_Popup.asp?fname="+f;
	var conf="top=300,left=300,width=390,height=174,toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=no,scrolling=auto";
	var tit="ID_Check";
	var IDWindow = MM_open(asp,tit,conf);
}

function email_input(f)
{
	if ( f.sEmail.value == "Á÷Á¢ÀÔ·Â" )
	{
		f.mememail_2.readOnly = false;
		f.mememail_2.value = "";
		f.mememail_2.focus();

	} else {
		f.mememail_2.readOnly = true;
		f.mememail_2.value = f.sEmail.value;
	}

}
function zipcodePop(f)
{
	var asp="/Member/Zipcode_Popup.asp?fname="+f;
	var conf="top=300,left=300,width=390,height=230,toolbar=no,location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=no,scrolling=auto";
	var tit="Zipcode_Pop";
	var IDWindow = MM_open(asp,tit,conf);
}
//--------------------------------------------------------------------------------------
