<!--	
function jsCheckDate( dateVal )
{
     var isDate  = true ;
     if ( dateVal.length != 8 )
     {
          isDate = false ;
     }
     else
     {
           var yy = dateVal.substring(0,4) +"" ;
           var mm = dateVal.substring(4,6) +"" ;
           var dd = dateVal.substring(6,8) +"" ;
           if ( !jsCheckYYYY(yy) )
              isDate = false ;
           else if ( !jsCheckMM(mm) )
              isDate = false ;
           else if ( !jsCheckDD (yy,mm,dd) )
              isDate = false ;
     }
     return isDate ;
}
function jsCheckYYYY(toCheck)
{
   return ( ( toCheck.length == 4) && ( jsCheckNumber(toCheck)  ) && ( toCheck != "0000") );
}
function jsCheckMM(toCheck)
{
      return ((toCheck.length > 0) && (jsCheckNumber(toCheck)) && (0< eval(toCheck)) && (eval(toCheck) < 13));
}
function jsCheckDD(yyyy,mm,toCheck)
{
      var isYMD  = false;
      var monthDD= new jsMonthArray(31,28,31,30,31,30,31,31,30,31,30,31);
      var im     = eval(mm) - 1;
      if ( toCheck.length == 0 )  return false;
      if ( !jsCheckNumber(toCheck)  )  return false;
      var dd     = eval(toCheck);
      if ( ( (yyyy%4 == 0) && (yyyy%100 != 0) ) || (yyyy%400 == 0) )
      {
           monthDD[1] = 29;
      }
      if ( (0 < dd) && (dd <= monthDD[im]) ) isYMD = true;
           return isYMD;
}

function jsMonthArray(m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11)
{
      this[0] = m0;
      this[1] = m1;
      this[2] = m2;
      this[3] = m3;
      this[4] = m4;
      this[5] = m5;
      this[6] = m6;
      this[7] = m7;
      this[8] = m8;
      this[9] = m9;
      this[10] = m10;
      this[11] = m11;
}

function jsCheckNumber(toCheck)
{
     var chkstr = toCheck+"" ;
     var isNum = true ;
     if ( jsCheckNull(toCheck) )
          return false;
     for (j = 0 ; isNum && (j < toCheck.length) ; j++)
     {
          if ((toCheck.substring(j,j+1) < "0") || (toCheck.substring(j,j+1) > "9"))
          {
             if ( toCheck.substring(j,j+1) == "-" || toCheck.substring(j,j+1) == "+")
             {
                if ( j != 0 )
                {
                   isNum = false;
                }
             }
             else
       isNum = false;
     }
     }
     if (chkstr == "+" || chkstr == "-") isNum = false;
     return isNum;
}


function jsCheckNull( toCheck )
{
     var chkstr = toCheck + "";
     var is_Space = true ;
     if ( ( chkstr == "") || ( chkstr == null ) )
    return( true );
     for ( j = 0 ; is_Space && ( j < chkstr.length ) ; j++)
     {
      if( chkstr.substring( j , j+1 ) != " " )
         {
        is_Space = false ;
         }
     }
     return ( is_Space );
}

function checkKey(key)
{

    if ((key >= 48 && key <= 57) // 키보드 상단 숫자키
       || (key >= 96 && key <= 105) // 키패드 숫자키
       || key == 8  // 백스페이스 키
       || key == 37 // 왼쪽 화살표 키
       || key == 39 // 오른쪽 화살표 키
       || key == 46 // DEL 키
       || key == 13 // 엔터 키

       || key == 9  // Tab 키
       ) {
           return true;
      } else {
          // alert(key);
          return false;
     }
}

function radioSelect(form)
{
	for(var i=0; i < form.length; i++) {
		if (form[i].checked == true){
			return form[i].value;
			break;
		}
	}
	return false;
}

function GetSelectedTxt(objSelect){
	var i;
	var selectedtext;
	for(i=0;i<objSelect.options.length;i++){
	        if(objSelect.options[i].selected==true){
	                selectedtext= objSelect.options[i].text;
	                break;
	        }
	}
	return selectedtext;
}


function check(){
	document.loginForm.user_id.value = trim(document.loginForm.user_id.value);
	
	antiauto = trim(document.joinForm.antiauto.value);
	user_id = trim(document.joinForm.user_id.value);
	overlap = trim(document.joinForm.overlap.value);
	pwd = trim(document.joinForm.pwd.value);	
	pwd_confirm = trim(document.joinForm.pwd_confirm.value);	
	email = trim(document.joinForm.email.value);
	
	if ( trim(document.joinForm.b_month.value).length == 1 ){
		document.joinForm.b_month.value = "0" + trim(document.joinForm.b_month.value);
	}
	if ( trim(document.joinForm.b_day.value.length) == 1 ){
		document.joinForm.b_day.value = "0" + trim(document.joinForm.b_day.value);
	}
	
	b_year = trim(document.joinForm.b_year.value);
	b_month = trim(document.joinForm.b_month.value);
	b_day = trim(document.joinForm.b_day.value);
	date = b_year + b_month + b_day;
	
	sex = radioSelect(document.joinForm.sex);
	post1 = trim(document.joinForm.post1.value);
	post2 = trim(document.joinForm.post2.value);
	document.joinForm.post.value = trim(document.joinForm.post1.value) + '-' + trim(document.joinForm.post2.value);
	addr1 = trim(document.joinForm.addr1.value);
	addr2 = trim(document.joinForm.addr2.value);
		
	if(document.joinForm.job.value != ''){
		document.joinForm.job_text.value = GetSelectedTxt(document.joinForm.job);
	}
	if(document.joinForm.reg_from.value != ''){
		document.joinForm.reg_from_text.value = GetSelectedTxt(document.joinForm.reg_from);
	}
			
	if(user_id == ''){
		alert('IDを入力してください。');
//		getMessage("err_msg_26");
		document.joinForm.user_id.focus();
	}
	else if(user_id.length < 4){
		alert('IDは4文字以上入力してください。');
//		getMessage("err_msg_27");
		document.joinForm.user_id.focus();
	}
	else if(user_id.length > 10){
		alert('IDは10文字以下入力してください。');
//		getMessage("err_msg_28");
		document.joinForm.user_id.focus();
	}
	else if(!chkEng_Num(user_id)){
		alert('IDは半角英数のみとなります。特殊記号は使用できません。');
		document.joinForm.user_id.focus();
	}
	else if(overlap == 'overlapped'){
		alert('IDの重複チェックをしてください。');
		//joinForm.overlap.focus();
	}
	else if(pwd == ''){
		alert('パスワードを入力してください。');
		document.joinForm.pwd.focus();
	}
	else if(pwd.length < 6){
		alert('パスワードは8文字以上入力してください。');
		document.joinForm.pwd.focus();
	}
	else if(pwd_confirm == ''){
		alert('パスワードの確認を入力してください。');
		document.joinForm.pwd_confirm.focus();			
	}
	else if(pwd != pwd_confirm ){
		alert('パスワードが一致しません。');
		document.joinForm.pwd_confirm.focus();			
	}
	else if(jsCheckDate(date) == false ){
		alert('生年月日を正しく入力して下さい。');
		document.joinForm.b_year.focus();			
	}
	else if(sex == false ){
		alert('性別のチェックをしてください。');
		document.joinForm.sex[0].focus();
	}
	else if(!MailCheck(email)) {
		alert('メールアドレスを正しく入力して下さい。');
		document.joinForm.email.focus();
	}
	else if(antiauto == ''){
		alert('文字/数字を入力してください。');
		document.joinForm.email.focus();
		document.joinForm.antiauto.focus();
	}
	//else if(antiauto == ''){
	//	alert('画像に含まれる文字列を入力してください。');
	//	joinForm.antiauto.focus();
	//}
	else if(joinForm.lastCheck.checked == false ){
		alert('利用規約に同意しないと登録できません。');
		document.joinForm.lastCheck.focus();
	}
	else {
		antiAuto();
		setTimeout("checkOk()",500);
		//setTimeout("userInfoReg()", 500);
		//window.setInterval("antiAuto()", 100);
	}
}

function antiAuto(){
	document.joinForm.antiauto.value = trim(document.joinForm.antiauto.value);
	antiauto = document.joinForm.antiauto.value;
	
	if(antiauto == ''){
		alert('文字/数字を入力してください。');
		document.joinForm.antiauto.focus();
	} else {
		document.joinForm.target = "ifrLogin";
		document.joinForm.action = "captchaCheck.action";
		document.joinForm.submit();
	}
}

function checkOk(){
	captchaCheck = trim(document.joinForm.captchaCheck.value);
	if(captchaCheck == 'gogo'){
		var b_year = document.getElementById("b_year").value;
		var b_month = document.getElementById("b_month").value;
		var b_day = document.getElementById("b_day").value;
		jQuery.ajax({
			type:"POST",
			url:"checkAdult.action",
			data:{"b_year":b_year , "b_month":b_month , "b_day":b_day},
			cache:false,
			success:function(msg){
				if(msg == "ok"){			
					document.joinForm.target = "_self";				
					document.joinForm.action = "memberInfoInput.action";
					document.joinForm.submit();
				}else{
					var checkAdult = document.getElementById("checkAdult");
					checkAdult.innerHTML = msg;
				}												
			}
		});
	}	
}

function doExtraLogin(){
	document.loginForm.user_id.value = trim(document.loginForm.user_id.value);
	var user_id = document.loginForm.user_id.value;
	document.loginForm.user_pass.value = trim(loginForm.user_pass.value);
	var user_pass = document.loginForm.user_pass.value;
	
	if(user_id=='id' || user_id ==''){
		alert('IDを入力してください。');
		document.loginForm.user_id.focus();
	}
	else if(user_pass=='password' || user_pass==''){
		alert('パスワードを入力してください。');
		document.loginForm.user_pass.focus();
	}
	else{
		document.loginForm.target = "ifrLogin";
		document.loginForm.action = "memberLogin.action";
		document.loginForm.submit();
		//document.location.reload();
		//this.close();
		//updateByPost("memberLogin.action", "loginWoohoo", "loginForm");
	}
}

function doExtraLogout(){
	//loginForm.target = "ifrLogin";
	if(confirm("ログアウトしますか？")){
		//logoutForm.target = "ifrLogout";
		//document.getElementById("myPage").close();
		document.loginForm.target = "ifrLogin";
		//document.loginForm.action = "http://www.arario.jp/memberLogout.action";
		document.loginForm.action = "memberLogout.action";
		document.loginForm.submit();
	}
	//this.close();
	//updateByPost("memberLogin.action", "loginWoohoo", "loginForm");
}
	
function q_init(){
	//updateByGet("getCode.action", "hint", "c_val=CM005&obj_type=selecbox&obj_name=pwd_hint");
	updateByGet("getCode.action", "divJob", "c_val=CM004&obj_type=selecbox&obj_name=job");
	updateByGet("getCode.action", "divReg_from", "c_val=CM003&obj_type=selecbox&obj_name=reg_from");
}

function trim(text) {
 if (text == "") {
  return text;
 }
 var len = text.length;
 var st = 0;
 while ((st < len) && (text.charAt(st) <= ' ')) {
  st++;
 }
 while ((st < len) && (text.charAt(len - 1) <= ' ')) {
  len--;
 }
 return ((st > 0) || (len < text.length)) ? text.substring(st, len) : text;
}

function filterKey(event) {
  var filter = '[0-9a-z]';
  if(filter){
      var sKey = String.fromCharCode(event.keyCode);
      var re = new RegExp(filter);
      if(!re.test(sKey)) event.returnValue=false;   
  }    
}

function filterKeyPW(){
	  var str = document.getElementById("filterCheck").value;
	  var justEng = str.match(/[a-z]+/i);
	  var justNum = str.match(/[0-9]+/);
	  var warn = document.getElementById("pwAlert");  
		if(str.length==0){
			warn.innerHTML = "";  
			  document.getElementById("filterkey").value="no";
			return;    
		}	
		if(str.length<8){ //글자수 6자 이하 체크    
			warn.innerHTML = "短すぎます";
		    warn.color = "red";   
		    document.getElementById("filterkey").value="no";
			return;  
		}else{
			if(str == justNum || str == justEng){
				warn.innerHTML = "英/数字を組み合わせて";
				warn.color = "orange";
				document.getElementById("filterkey").value="no";
				return;
			}else{  
				warn.innerHTML = "OK！です";
				warn.color = "skyblue";
				document.getElementById("filterkey").value="filterOK";
				return;
			}
		}
}


function viewHelp(){	
	window.open('page/memHelp.html', 'Rules', 'width=580,height=129,statusbar=no,scrollbars=no,toolbar=no,resizable=no,top=20,left=20;');
}

function idOverlapCheck(){

	document.joinForm.user_id.value = document.joinForm.user_id.value.replace(/\s/g, "");

	user_id = trim(document.joinForm.user_id.value);
	overlap = trim(document.joinForm.overlap.value);
	
	if(user_id == ''){
		alert('IDを入力してください。');
		document.joinForm.user_id.focus();
	}
	else if(user_id.length < 4){
		alert('IDは4文字以上入力してください。');
		document.joinForm.user_id.focus();
	}
	else if(user_id.length > 10){
		alert('IDは10文字以下入力してください。');
		document.joinForm.user_id.focus();
	}
	else if(!chkEng_Num(user_id)){
		alert('IDは半角英数のみとなります。特殊記号は使用できません。');
		document.joinForm.user_id.focus();
	}
	 else {
		ifrLogin.location.href = "idOverlapCheck.action?user_id=" + user_id;
		//document.joinForm.target = "ifrLogin";
		//document.joinForm.action = "idOverlapCheck.action";
		//document.joinForm.submit();
	}
	
}

function chkEng_Num(str){
	var isID = /^[a-zA-Z0-9]{4,10}$/;
	if(!isID.test(str)){
		return false;
	} else {
		return true;
	}
}

function doAraLogin(){

	document.loginForm.user_id.value = trim(document.loginForm.user_id.value);
	var user_id = document.loginForm.user_id.value;
	document.loginForm.user_pass.value = trim(document.loginForm.user_pass.value);
	var user_pass = document.loginForm.user_pass.value;
	
	if(user_id=='id' || user_id ==''){
		alert('IDを入力してください。');
		document.loginForm.user_id.focus();
	}
	else if(user_pass=='password' || user_pass==''){
		alert('パスワードを入力してください。');
		document.loginForm.user_pass.focus();
	}
	else{
		document.loginForm.target = "ifrLogin";
		document.loginForm.action = "memberLogin.action";
		document.loginForm.submit();
	}
}

function goNextStep(step_no){
	
	var tomail = document.getElementById("tomail");
	var confirm_tomail = document.getElementById("confirm_tomail");
	
	if(step_no == 'step2'){
		ctomail = trim(tomail.value);
		confirm_ctomail = trim(confirm_tomail.value);
		
		if(ctomail == ''){
			alert('メールアドレスを入力してください。');
			document.getElementById("tomail").focus();
		} else if(!MailCheck(ctomail)){
			alert('正しいメールアドレスを入力してください。');
			document.getElementById("confirm_tomail").focus();
		} else if(ctomail != confirm_ctomail){
			alert('メールアドレスに間違いがあります。');
			//tomailForm.tomail.focus();
		} else {
			document.getElementById("tomailForm").action = "sendMail.action";
			document.getElementById("tomailForm").submit();
		}
	}
	
}

function searchIDCheck(){
	document.ipsForm.email.value = trim(ipsForm.email.value);
	var email = ipsForm.email.value;
	
	document.ipsForm.b_year.value = trim(ipsForm.b_year.value);
	document.ipsForm.b_month.value = trim(ipsForm.b_month.value);
	if ( ipsForm.b_month.value.length == 1 ){
		document.ipsForm.b_month.value = "0" + ipsForm.b_month.value;
	}
	document.ipsForm.b_day.value = trim(ipsForm.b_day.value);
	if ( ipsForm.b_day.value.length == 1 ){
		document.ipsForm.b_day.value = "0" + ipsForm.b_day.value;
	}
	date = ipsForm.b_year.value + ipsForm.b_month.value + ipsForm.b_day.value;
			
	if(!MailCheck(email)) {
		alert('メールアドレスが正しくありません。\nご確認ください。');
		ipsForm.email.focus();
	}
	else if(date < '19000101' ){
		alert('生年月日を正しく入力して下さい。');
		ipsForm.b_year.focus();			
	}
	else if(date > '20080101' ){
		alert('生年月日を正しく入力して下さい。');
		ipsForm.b_year.focus();			
	}
	else{
		document.ipsForm.date.value = date;
		//alert(email);
		//alert(date);
		ipsForm.submit();
		//updateByPost('searchIDPass.action', 'search_result', 'ipsForm');
		//document.ipsForm.date.value = "";
		//document.ipsForm.email.value = "";
		//document.ipsForm.user_id.value = "";
		//document.ipsForm.b_year.value = "";
		//document.ipsForm.b_month.value = "";
		//document.ipsForm.b_day.value = "";
	}
}

function searchPassCheck(){
	document.ipsForm.email.value = trim(ipsForm.email.value);
	var email = ipsForm.email.value;
	
	document.ipsForm.user_id.value = trim(ipsForm.user_id.value);
	var user_id = ipsForm.user_id.value;
					
	if(!MailCheck(email)) {
		alert('メールアドレスが正しくありません。\nご確認ください。');
		ipsForm.email.focus();
	}
	else if(user_id ==''){
		alert('IDを入力してください。');
		ipsForm.user_id.focus();
	}
	else{
		//alert(email);
		//alert(user_id);
		//alert(date);
		ipsForm.submit();
		//updateByPost('searchIDPass.action', 'search_result', 'ipsForm');
		//document.ipsForm.date.value = "";
		//document.ipsForm.email.value = "";
		//document.ipsForm.user_id.value = "";
		//document.ipsForm.b_year.value = "";
		//document.ipsForm.b_month.value = "";
		//document.ipsForm.b_day.value = "";
		//ipsForm.submit();
	}
}

function MailCheck(ObjMail){
	ObjMail = trim(ObjMail);

	if (ObjMail.search(/(\S+)@(\S+)\.(\S+)/) == -1 ) 
	{
	    return false;
	}
	return true;
}

function pwdChecker(){  
	if(document.getElementById("filterCheck").value==document.getElementById("pwd_confirm").value && document.getElementById("filterkey").value =="filterOK"){
		document.getElementById("passCheckSame").innerHTML="OK";
	}else{     
		document.getElementById("passCheckSame").innerHTML="";
	}
}  
/*
function GetRadioSelectedTxt(form){

	for(var i=0; i < form.length; i++) {

		if (form[i].checked == true){
			return form[i].id;					
			break;		
		}
	}
}
*/

//-->