
function chknn(o,c){
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(s.length==0){alert('“'+c+'”不能为空');return(false);}
	return(true);
}

function chkf(o,c)
{
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(s.length==0){return(true)}
	if(isNaN(s)){alert('请在“'+c+'”内输入有效的数字');return(false);}
	return(true);
}
function chkd(o,c)
{
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(s.length==0){return(true)}
	ss = s.replace('-','/');
	sss = ss.replace('-','/');
	var xxx = new Date(sss);
	if(isNaN(xxx)){alert('请在“'+c+'”内输入有效的日期(例如2008-8-18)');return(false);}
	return(true);
}
function chklen(o,l,c)
{
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(s.length > l){alert('"'+c+'"超出最大长度'+l);return(false);}
	return(true);
}
function ConfirmDel(){
	if(confirm("确定要删除吗？"))
		return true;
	else
		return false;
}
function sel(a,srco){
    $("input[@type=checkbox][@name='"+a+"']").each(function(){
        $(this).attr("checked",$(srco).attr('checked'));
    });
}
