var all_inputMsgs = new Array();
all_inputMsgs[9]='company_en;英文公司名称';
all_inputMsgs[10]='comp_address_en;英文公司地址';
all_inputMsgs[11]='logoname_en;英文品牌名';
all_inputMsgs[12]='company_info;500字以下';
all_inputMsgs[13]='logoinfo;500字以下';


function check_apply(f){
	if(!isNotEmpty(f.company)) {
		alert("请填写公司名称！");
		return false;
	}
	if(!isNotEmpty(f.comp_address)) {
		alert("请填写公司地址！");
		return false;
	}
	if(!isNotEmpty(f.logoname)) {
		alert("请填写品牌名！");
		return false;
	}
	if(!isNotEmpty(f.contact)) {
		alert("请填写联系人！");
		return false;
	}
	
	
	
	doinputMsg(all_inputMsgs);
}

function check_self(f) {
	/*if(!isNotEmpty(f.contact)) {
		alert("请填写负责人姓名！");
		return false;
	}
	if(!isNotEmpty(f.contact_mobile)) {
		alert("请填写负责人手机！");
		return false;
	}
	if(!isNotEmpty(f.ex_contact)) {
		alert("请填写展会现场负责人姓名！");
		return false;
	}
	if(!isNotEmpty(f.ex_mobile)) {
		alert("请填写展会现场负责人手机！");
		return false;
	}*/
	if(!isNotEmpty(f.company)) {
		alert("请填写公司名称！");
		return false;
	}
	if(!isNotEmpty(f.comp_address)) {
		alert("请填写公司地址！");
		return false;
	}
	if(!isNotEmpty(f.logoname)) {
		alert("请填写品牌名！");
		return false;
	}

	
	if(f.company_info.value.length>500) {
		alert("公司中文介绍应在500个字内！");
		//f.company_info.focus();
		return false;
	}
	if(f.company_info_en.value.length>1000) {
		alert("公司英文介绍应在1000个字内！");
		//f.company_info_en.focus();
		return false;
	}
	if(f.logoinfo.value.length>500) {
		alert("品牌中文介绍应在500个字内！");
		//f.logoinfo.focus();
		return false;
	}
	if(f.logoinfo_en.value.length>1000) {
		alert("品牌英文介绍应在1000个字内！");
		//f.logoinfo_en.focus();
		return false;
	}
	doinputMsg(all_inputMsgs);
}

function check_logoname(logoname) {
	if(logoname.value != '') {
		var contant = "logoname="+logoname.value;
		send_request('index.php?module=exhibitor&act=CheckLogoName','post',contant,'CheckLogoName_do');
	}
}


function CheckLogoName_do() {
	context=parseInt(http_request.responseText);
	if(context==1) {
		$id('logoname_notice').innerHTML = '<img src=\"images/error.gif\"> 该品牌已存在，请勿重复添加！';
	}else{
		$id('logoname_notice').innerHTML = '<img src=\"images/valid.gif\">';
	}
	
}


function admin_check_self(f) {
	if(!isNotEmpty(f.booth_no)) {
		alert("请填写展位编号！");
		return false;
	}
	if(!isNotEmpty(f.floor)) {
		alert("请选择展位楼层！");
		return false;
	}
	if(!isNotEmpty(f.company)) {
		alert("请填写公司名称！");
		return false;
	}
	if(!isNotEmpty(f.comp_address)) {
		alert("请填写公司地址！");
		return false;
	}
	if(!isNotEmpty(f.logoname)) {
		alert("请填写品牌名！");
		return false;
	}
	if(f.company_info.value.length>500) {
		alert("公司中文介绍应在500个字内！");
		f.company_info.focus();
		return false;
	}
	if(f.company_info_en.value.length>1000) {
		alert("公司英文介绍应在1000个字内！");
		f.company_info_en.focus();
		return false;
	}
	if(f.logoinfo.value.length>500) {
		alert("品牌中文介绍应在500个字内！");
		f.logoinfo.focus();
		return false;
	}
	if(f.logoinfo_en.value.length>1000) {
		alert("品牌英文介绍应在1000个字内！");
		f.logoinfo_en.focus();
		return false;
	}
	doinputMsg(all_inputMsgs);
}


function admin_check_list(f) {
	
	
	if(!isNotEmpty(f.booth_no)) {
		alert("请填写展位编号！");
		return false;
	}
	
	if(!isNotEmpty(f.floor)) {
		alert("请选择展位楼层！");
		return false;
	}
	if(!isNotEmpty(f.company)) {
		alert("请填写公司名称！");
		return false;
	}

	
	if(!isNotEmpty(f.comp_address)) {
		alert("请填写公司地址！");
		return false;
	}
	
	if(!isNotEmpty(f.logoname)) {
		alert("请填写品牌名！");
		return false;
	}

	
	if(f.company_info.value.length>500) {
		alert("公司中文介绍应在500个字内！");
		f.company_info.focus();
		return false;
	}
	if(f.company_info_en.value.length>1000) {
		alert("公司英文介绍应在1000个字内！");
		f.company_info_en.focus();
		return false;
	}
	if(f.logoinfo.value.length>500) {
		alert("品牌中文介绍应在500个字内！");
		f.logoinfo.focus();
		return false;
	}
	if(f.logoinfo_en.value.length>1000) {
		alert("品牌英文介绍应在1000个字内！");
		f.logoinfo_en.focus();
		return false;
	}
	
	doinputMsg(all_inputMsgs);
}


function doinputMsg(all_inputMsgs) {
	for(i=0;i<all_inputMsgs.length;i++) {
		obj=all_inputMsgs[i].split(';');
		objid = obj[0];
		if($id(objid) && $id(objid).value==findvalue(objid,all_inputMsgs)){		
			$id(objid).value="";
		}
	}

}


function check(id)
{
	if(confirm("你确定要审核通过该项么?")){//"+chknum+"
		send_request('admin.php?module=exhibitor&act=list&act2=check&id='+id,'get','','check_do');
	}
	
}


function check_do() {
	context=http_request.responseText.split('|');
	if(context[0]==1) {
		alert('审核成功！');
		$('check_'+context[1]).innerHTML = '已审核';	
	}else{
		alert('审核失败！');
	}

}

function check_mod_pass(f) {
	if(!isNotEmpty(f.password)) {
		alert("请输入原始密码！");
		return false;	
	}
	if(!isNotEmpty(f.new_password)) {
		alert("请输入新密码！");
		return false;	
	}
	if(!isNotEmpty(f.new_password_confirm)) {
		alert("请确认新密码！");
		return false;	
	}
	if(f.new_password.value!=f.new_password_confirm.value) {
		alert("您两次输入的密码不一致，请重新输入！");
		return false;	
	}
}

function wjpass() {
	alert("若您忘记密码，请致电：020 3995 3969联系我们的工作人员获取帮助，谢谢！");
}
