<!--/* icons */
var validates_ok = '<span style="vertical-align: middle; color:green; font-size:8pt;">●</span> ';
var validates_error = '<span style="vertical-align: middle; color:red; font-size:8pt;">*</span>';
var validates_info = '<span style="vertical-align: middle; color:blue; font-size:8pt;">*</span>';

Validator.register({
    "#email" : {
        "/^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/": validates_ok+" ＯＫ",
	"/^$/": validates_error, 
	"/.*/": validates_error+"正しいメールアドレスを入力してください。"
    },

    "#email2" : {
        "/^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/": validates_ok+" ＯＫ",
	"/^$/": validates_error, 
	"/.*/": validates_error+"正しいメールアドレスを入力してください"
    },
    
    ".validate_kata" : {
	"/[^ァ-ン゛゜ー 　]/": validates_error+"カタカナ以外は入力できません",
	"/^$/": validates_error,
	"/.*/": validates_ok+"ＯＫ"
    },

    ".validate_kana" : {
	"/[^ぁ-ん゛゜ー 　]/": validates_error+"ひらがな以外は入力できません",
	"/^$/": validates_error+"必ず入力してください",
	"/.*/": validates_ok
    },

    ".required" : {
	"/^$/": validates_error,
	"/.*/": validates_ok+"ＯＫ"
    },

    ".zipCode" : {
       "/[^0-9\-]/": validates_error+"半角の数字で入力してください",
       "/[0-9\-]/": validates_ok+"ＯＫ",
	   "/^$/": validates_error
    },


    ".phoneNumRequired" : {
       "/[^0-9\-]/": validates_error+"半角の数字で入力してください",
       "/[0-9\-]/": validates_ok+"ＯＫ",
	"/^$/": validates_error
    },

    ".over10" : {
	"/^[0-9]+$/": function(element) {
	    if(element.value>=10) return validates_ok;
	    return validates_error+"10以上を入力してください";
        },
	"/.*/": validates_info+"数字を入力してください"
    },

    ".eval" : function(element) {
	return eval(element.value);
    }
});


function dataCheck(f){
	var inText = document.getElementById("formTable").innerHTML;
	var msg="";
	var chkval="";
	var cnt="";
	var specialid="";
	var specialid2="";
	var specialid3="";
	var specialid4="";
	var specialid5="";
	var specialid6="";

if(document.jobwebForm.elements["specialID"].value){
	specialid = document.jobwebForm.elements["specialID"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}

if(chkval){
if(document.jobwebForm.elements["specialID2"].value){
	specialid = document.jobwebForm.elements["specialID2"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}
}
}
if(chkval){
if(document.jobwebForm.elements["specialID3"].value){
	specialid = document.jobwebForm.elements["specialID3"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}
}
}
if(chkval){
if(document.jobwebForm.elements["specialID4"].value){
	specialid = document.jobwebForm.elements["specialID4"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}
}
}
if(chkval){
if(document.jobwebForm.elements["specialID5"].value){
	specialid = document.jobwebForm.elements["specialID5"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}
}
}
if(chkval){
if(document.jobwebForm.elements["specialID6"].value){
	specialid = document.jobwebForm.elements["specialID6"].value;
	cnt = document.jobwebForm.elements[specialid].length;
	
	if(cnt){
	chkval="";
		outside:{
			for(ind=0; ind< cnt; ind++){
				if(document.jobwebForm.elements[specialid][ind].checked){
				chkval = "true";
				break outside;
				}
			}
		}
}
}
}

	
	if(inText.indexOf("*") == -1){
	
		if(chkval){
		
		return true;
		
		}else{
		msg="お問い合わせ内容が選択されていません。\n\n";
		alert(msg);
		return false;
		}
		
	}else{

		if(chkval){
		msg="正しく入力されていない項目があります。\n必須の項目を確認してください。";
		alert(msg);
		return false;
		}else{
		msg="お問い合わせ内容が選択されていません2。\n\n";
		alert(msg);
		return false;
		}
	}
	
}else{
	
		if(inText.indexOf("*") == -1){
		
		return true;
		
		}else{
		
		msg="正しく入力されていない項目があります。\n必須の項目を確認してください。";
		alert(msg);
		return false;
		
		}
}	
}


function reqSet(ids){
document.getElementById(ids).innerHTML = validates_ok + "ＯＫ";
}

function selCamId(id,val){
document.getElementById(id).value = val;
}
