//全角チェック
function ZenCheck(str){

	for(i=0; i<str.length; i++){
		if(escape(str.charAt(i)).length>=4){
			te = escape(str.charAt(i)).length;
			alert(te+"error");
			return false;
		}
	}

	return true;

}
//半角チェック
function HanCheck(str){

	for(i=0; i<str.length; i++){
		if(escape(str.charAt(i)).length<4){
			return false;
		}

		if(str.match(/[ｶﾞ,ｷﾞ,ｸﾞ,ｹﾞ,ｺﾞ,ｻﾞ,ｼﾞ,ｽﾞ,ｾﾞ,ｿﾞ,ﾀﾞ,ﾁﾞ,ﾂﾞ,ﾃﾞ,ﾄﾞ,ﾊﾞ,ﾋﾞ,ﾌﾞ,ﾍﾞ,ﾎﾞ,ﾊﾟ,ﾋﾟ,ﾌﾟ,ﾍﾟ,ﾎﾟ,ｦ,ｧ,ｨ,ｩ,ｪ,ｫ,ｬ,ｭ,ｮ,ｯ,ｰ,ｱ,ｲ,ｳ,ｴ,ｵ,ｶ,ｷ,ｸ,ｹ,ｺ,ｻ,ｼ,ｽ,ｾ,ｿ,ﾀ,ﾁ,ﾂ,ﾃ,ﾄ,ﾅ,ﾆ,ﾇ,ﾈ,ﾉ,ﾊ,ﾋ,ﾌ,ﾍ,ﾎ,ﾏ,ﾐ,ﾑ,ﾒ,ﾓ,ﾔ,ﾕ,ﾖ,ﾗ,ﾘ,ﾙ,ﾚ,ﾛ,ﾜ,ﾝ]+/)){
			return false;
		}
	}

	return true;

}
//ひらがなチェック
function HiraKanaCheck(str){

	if(str.match(/[あ-ん,"ー","ぁ","ぃ","ぅ","ぇ","ぉ","ゃ","ゅ","ょ","ゎ","ゐ","ゑ"]/)){
		return false;
	}

	return true;

}

//カタカナチェック
function KataKanaCheck(str){

	if(str.match(/[ア-ン,"ー","ヴ","ァ","ィ","ゥ","ェ","ォ","ャ","ュ","ョ","ヮ","ヰ","ヱ"]/)){
		return false;
	}

	if(str.match(/[ｶﾞ,ｷﾞ,ｸﾞ,ｹﾞ,ｺﾞ,ｻﾞ,ｼﾞ,ｽﾞ,ｾﾞ,ｿﾞ,ﾀﾞ,ﾁﾞ,ﾂﾞ,ﾃﾞ,ﾄﾞ,ﾊﾞ,ﾋﾞ,ﾌﾞ,ﾍﾞ,ﾎﾞ,ﾊﾟ,ﾋﾟ,ﾌﾟ,ﾍﾟ,ﾎﾟ,ｦ,ｧ,ｨ,ｩ,ｪ,ｫ,ｬ,ｭ,ｮ,ｯ,ｰ,ｱ,ｲ,ｳ,ｴ,ｵ,ｶ,ｷ,ｸ,ｹ,ｺ,ｻ,ｼ,ｽ,ｾ,ｿ,ﾀ,ﾁ,ﾂ,ﾃ,ﾄ,ﾅ,ﾆ,ﾇ,ﾈ,ﾉ,ﾊ,ﾋ,ﾌ,ﾍ,ﾎ,ﾏ,ﾐ,ﾑ,ﾒ,ﾓ,ﾔ,ﾕ,ﾖ,ﾗ,ﾘ,ﾙ,ﾚ,ﾛ,ﾜ,ﾝ]+/)){
		return false;
	}

	return true;

}

//英語チェック
function EiCheck(str){

	if(str.match(/[a-z]/i)){
		return false;
	}

	return true;
}

//数字チェック
function SuuCheck(str){

	if(str.match(/^[0-9]+$/)){
		return false;
	}

	return true;

}

//記号チェック
function KigouCheck(str){

//	if(str.match(/[-|_|#|$|^|~|@|:|;|\]|\[|\*|\\|\<|\>|\/|\?|\.]/)){
	if(str.match(/[\\|\"|\']/)){
		return false;
	}

	return true;

}

function DateCheck(str){

	if(!str.match(/^[0-9]{8}$/)){
		if(!str.match(/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}$/)){
			return false;
		}
	}

	return true;

}

//Byteチェック
function ByteCheck(str,intLen){

	var len = 0;
	var str = escape(str);

	for(j = 0; j < str.length; j++,len++){
		if(str.charAt(j) == "%"){
			if(str.charAt(++j) == "u"){
				j += 3;
				len++;
			}
			j++;
		}
	}

	if(intLen < len){ return false; }

	return true;

}

function DateAdjustCheck(str){

	st_Year = eval(str.substring(0,4));
	st_m = eval(str.substring(4,6));
	st_d =  eval(str.substring(6,8));
	st_Month = parseInt(st_m); //先頭の0を取り除くため、数値に変換させる
	st_Day = parseInt(st_d); //先頭の0を取り除くため、数値に変換させる

	if(st_Month == 4 || st_Month == 6 || st_Month == 9 || st_Month == 11){
		if(st_Day > 30){
			return false;
		}
	}

	else if(st_Month == 2){
		if(st_Year % 4 == 0){
			if(st_Year % 100 == 0){
				if(st_Year % 400 == 0){
					if(st_Day > 28){
						return false;
					}
				}
				else{
					if(st_Day > 29){
						return false;
					}
				}
			}
			else{
				if(st_Day > 29){
					return false;
				}
			}

		}
		else{
			if(st_Day > 28){
				return false;
			}
		}
	}

	else if(st_Month == 1 || st_Month == 3 || st_Month == 5 || st_Month == 7 || st_Month == 8 || st_Month == 10 || st_Month == 12){
		if(st_Day > 31){
			return false;
		}
	}

	else{
		return false;
	} 

	return true;

}

function ZipCheck(str){

	if(str.match(/^[0-9]{3}-[0-9]{4}$/)){
		return false;
	}

	return true;

}

//ページが移動します。
function pageMove(ofs){
	document.page.ofs.value=ofs;
	document.page.submit();
}

//ページが移動します。2
function pageChange(page){
	document.page.page.value=page;
	document.page.submit();
}

//全角カタカナチェック
function ZenKataKanaCheck(str){

	if(!str.match(/^[ア-ン,"ー","ヴ","ァ","ィ","ゥ","ェ","ォ","ャ","ュ","ョ","ヮ","ヰ","ヱ"]+$/)){
		return false;
	}

	return true;

}

function DateAdjustCheck(str){

	st_Year = eval(str.substring(0,4));
	st_m = eval(str.substring(4,6));
	st_d =  eval(str.substring(6,8));
	st_Month = parseInt(st_m); //先頭の0を取り除くため、数値に変換させる
	st_Day = parseInt(st_d); //先頭の0を取り除くため、数値に変換させる

	if(st_Month == 4 || st_Month == 6 || st_Month == 9 || st_Month == 11){
		if(st_Day > 30){
			return false;
		}
	}

	else if(st_Month == 2){
		if(st_Year % 4 == 0){
			if(st_Year % 100 == 0){
				if(st_Year % 400 == 0){
					if(st_Day > 28){
						return false;
					}
				}
				else{
					if(st_Day > 29){
						return false;
					}
				}
			}
			else{
				if(st_Day > 29){
					return false;
				}
			}

		}
		else{
			if(st_Day > 28){
				return false;
			}
		}
	}

	else if(st_Month == 1 || st_Month == 3 || st_Month == 5 || st_Month == 7 || st_Month == 8 || st_Month == 10 || st_Month == 12){
		if(st_Day > 31){
			return false;
		}
	}

	else{
		return false;
	} 

	return true;

}

//文字数チェック
function strNumCheck(str,intLen){

	if(str.length > intLen){
		return false;
	}

	return true;

}


