// JavaScript Document
function check_fill(obj,msg){
	if (!obj.disabled && obj.value==""){
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}

function check_fill_num(obj,name){
	if (obj.disabled ||obj.value.match(/[0-9]{1,}$/))
		return true
	else
	{
		alert(name+'格式必需為數字');
		obj.focus();
		return false;
	}
}
/*	 /^.+@.+\..{2,3}$/ 	*/

function check_email_format(obj){
        if (obj.value.match(/^.+@.+\..{2,3}$/))
                return true
        else
        {
                alert('E-mail格式錯誤');
                obj.focus();
                return false;
        }
}


function check_en_str(obj,name){
	if (obj.disabled || obj.value.match(/[A-Za-z0-9_]{1,}$/))
		return true
	else
	{
		alert(name+'格式必需為英文與數字的集合');
		obj.focus();
		return false;
	}
}
function check_nonen_str(obj,name){
	if (obj.disabled || !obj.value.match(/[A-Za-z0-9_]{1,}$/))
		return true
	else
	{
		alert(name+'不能包合英文與數字的集合');
		obj.focus();
		return false;
	}
}

function check_select(obj,Name){
	var val = obj.value;
	if (val=="" || val==null || val=="false"){
		alert(Name + "必需選取有效的項目");
		obj.focus();
		return false;
	}
	else
		return true;
}

function check_chkbox(obj,Name){
	if (obj){
		for(i=0 ; i < obj.length ; i++){
			if (obj[i].checked)
				return true;
		}
	}
	alert(Name+'未選取');
	return false;		
}
