function search() {
	var frm = document.getElementById("searchform");
	if (frm.value.length==0) {
		alert('검색어를 입력하세요');
		return false;
	}
}

function openWinCenter(url, wname, wopt) {
	var newopt = "", wHeight = 0, wWidth = 0;
	if (wopt != undefined) {
		var woptlist = wopt.replace(/ /g, "").split(",");
		for (var i in woptlist) {
			if (woptlist[i].match(/^height=/i)) {
				wHeight = parseInt(woptlist[i].substr(7),10);
				if (!isNaN(wHeight)) newopt += "top=" + Math.floor((screen.availHeight - wHeight) / 2) + ",";
			}
			if (woptlist[i].match(/^width=/i)) {
				wWidth = parseInt(woptlist[i].substr(6),10);
				if (!isNaN(wWidth)) newopt += "left=" + Math.floor((screen.availWidth - wWidth) / 2) + ",";
			}
		}
	}
	return window.open(url, wname, newopt + wopt);
}


function join(){
	var frm = document.getElementById("form");

	//Id검사
	if (frm.id.value.length==0) {
		alert("ID를 입력하세요.");
		frm.id.focus();
		return false;
	}
	if (frm.id.value.length<4)
	{
		alert("ID를 4자 이상 입력하세요.");
		frm.id.focus();
		return false;
	}
	if (frm.id.value.length>12)
	{
		alert("ID를 12자 이하로 입력하세요.");
		frm.id.focus();
		return false;
	}
	//이름 검사
	if (frm.name.value.length==0) {
		alert("이름을 입력하세요.");
		frm.name.focus();
		return false;
	}

	//주민등록번호 검사
	if (frm.resno1.value.length==0) {
		alert("주민등록번호를 입력하세요.");
		frm.resno1.focus();
		return false;
	}
	if (frm.resno2.value.length==0) {
		alert("주민등록번호를 입력하세요.");
		frm.resno2.focus();
		return false;
	}

	//주민등록번호 자리수 검사
	resno1 = frm.resno1.value;
	resno2 = frm.resno2.value;
	if ((resno1+resno2).length!=13) {
		alert("주민번호의 자릿수가 맞지 않습니다.");
		frm.resno1.focus();
		return false;
	}
	else {
		for (i=0;i<13;i++) {
			if (isNaN(parseInt((resno1+resno2).substring(i,i+1)))) {
				alert("주민 번호에 숫자가 아닌 데이터가 있습니다.");
				frm.resno1.focus();
				return false;
			}
		}

	}

		//주민등록 번호가 제대로 입력되었는지 검사.
		resno1 = new Array(6);
		resno2 = new Array(7);
		resno1 = frm.resno1.value.split("");

		resno2 = frm.resno2.value.split("");
		num=(resno1[0]*2)+(resno1[1]*3)+(resno1[2]*4)+(resno1[3]*5)+(resno1[4]*6)+(resno1[5]*7)+(resno2[0]*8)+(resno2[1]*9)+(resno2[2]*2)+(resno2[3]*3)+(resno2[4]*4)+(resno2[5]*5)
		num=11-(num%11);
		check = num%10;

		if(check!=resno2[6]) {
			alert("주민등록번호를 잘못 입력하셨습니다.");
			frm.resno1.focus();
			return false;
		}


	//비밀번호 입력 검사.
	if (frm.password.value.length==0){
		alert('비밀번호를 입력하세요.');
		frm.password.focus();
		return false;
	}
	if (frm.password.value.length!=0 && (frm.password.value!=frm.repassword.value)) {
		alert("비밀번호가 서로 틀립니다.");
		frm.password.focus();
		return false;
	}

	//메일주소 입력검사
	if (frm.mail.value.length==0){
		alert('메일주소를 입력하세요.');
		frm.mail.focus();
		return false;
	}

	//전화번호 입력검사
	if (frm.phone1.value.length==0){
		alert('전화번호를 입력하세요.');
		frm.phone1.focus();
		return false;
	}
	if (frm.phone2.value.length==0){
		alert('전화번호를 입력하세요.');
		frm.phone2.focus();
		return false;
	}
	if (frm.phone3.value.length==0){
		alert('전화번호를 입력하세요.');
		frm.phone3.focus();
		return false;
	}
	
	//핸드폰 입력검사
	if (frm.portable1.value.length==0){
		alert('핸드폰번호를 입력하세요.');
		frm.portable1.focus();
		return false;
	}
	if (frm.portable2.value.length==0){
		alert('핸드폰번호를 입력하세요.');
		frm.portable2.focus();
		return false;
	}
	if (frm.portable3.value.length==0){
		alert('핸드폰번호를 입력하세요.');
		frm.portable3.focus();
		return false;
	}

}


// FLASH EMBED noTransparent//
function FlashEmbed(fid,fn,wd,ht,para)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain">');
document.write('<param name="movie" value="' + fn + para + '">');
document.write('<param name="loop" value="true">');
document.write('<param name="menu" value="false">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="opaque">');
document.write('<param name="scale" value="noscale">');
document.write('<param name="salign" value="lt">');
document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="opaque" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}

// FLASH EMBED Transparent//
function FlashEmbedTrans(fid,fn,wd,ht,para)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain">');
document.write('<param name="movie" value="' + fn + para + '">');
document.write('<param name="loop" value="true" />');
document.write('<param name="menu" value="false">');
document.write('<param name="quality" value="high">');
document.write('<param name="scale" value="scale" />');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="transparent" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');document.write('</object>');
}


// --popup
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 "";
}


//콤마 붙여주기
	function comma(x) {
		  var txtNumber = '' + x;
		  var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
		  var arrNumber = txtNumber.split('.');
		  arrNumber[0] += '.';
		  do {
		  arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
		  } while (rxSplit.test(arrNumber[0]));
		  if (arrNumber.length > 1) {
		  return arrNumber.join('');
		  }else {
		  return arrNumber[0].split('.')[0];
		  }
	}
