
function chknn(o,c){
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(s.length==0){alert('"'+c+'" empty!');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+'" wrong!');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+'" must be a date(like 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+'" length must below:'+l);return(false);}
	return(true);
}

function chkemail(o,c)
{
	var s=$('#' + o).attr('value');
	s=s.replace(/(^\s*)|(\s*$)/g,"");
	if(!s.match(/^.+@.+$/)){alert('"'+c+'" wrong!');return(false);}
	return(true);
}