﻿var _sonload=window.onload;
var arr =new Array();
var config = {
    content:'内容',
    keyword:'关键字 ',
    explain:'explain ',
    price:'价格',
    output:'产量 ',
    cmodel:'型号 ',
    tag_one:'tag_one ',
    tag_two:'tag_two ',
    tag_three:'tag_three ',
    begindate:'开始日期 ',
    enddate:'结束日期 ',
    titl:'标题 ',
    keyw:'关键字 ',
    des:'描述 ',
    uname:'联系人 ',
    uemail:'邮箱 ',
    utel:'电话 ',
    ufaxes:'传真 ',
    umobile:'手机',
    ucompany:'公司',
    name:'名称 '
    
};
window.onload=function(e){
    if(_sonload)
    {
        _sonload();
    }

 
        arr.push(new Validator('name',config.name,true)); 
     //   arr.push(new Validator('content',config.content,true)); 
     //   arr.push(new Validator('keyword',config.keyword,true));
       // arr.push(new Validator('explain',config.explain,true));
        //arr.push(new Validator('price',config.price,true,'float'));
        //arr.push(new Validator('output',config.output,true));
     //   arr.push(new Validator('cmodel',config.cmodel,true));
      ///  arr.push(new Validator('tag_one',config.tag_one,true));
     ///   arr.push(new Validator('tag_two',config.tag_two,true));
     //   arr.push(new Validator('tag_three',config.tag_three,true));
       // arr.push(new Validator('begindate',config.begindate,true));    
        //arr.push(new Validator('enddate',config.enddate,true));
      //  arr.push(new Validator('titl',config.titl,true));
      //  arr.push(new Validator('keyw',config.keyw,true));
      //  arr.push(new Validator('des',config.des,true));
       // arr.push(new Validator('uname',config.uname,true));
        //arr.push(new Validator('uemail',config.uemail,true));
       // arr.push(new Validator('utel',config.utel,true,'',isTel));
       // arr.push(new Validator('umobile',config.umobile,true));
       // arr.push(new Validator('ufaxes',config.ufaxes,true));
        //arr.push(new Validator('ucompany',config.ucompany,true));
     
};
var check=function(e){
   var a = checkArray(arr);
   var b = $('_flag_').value=='1';
   if(b){
   var c = $('begindate').value;
   var d = $('enddate').value;
   if(c.length<1){
     alert('请选择起始日期!');
     return false;
   }
   if(d.length<1){
     alert('请选择结束日期!');
     return false;
   }
  return a&&c.length>0&&d.length>0;}
  else{return true;}
};



