//商家拓展提交验证
function postcheck(frm){
	var title=document.getElementById("atc_title");
	if(title.value==""){
		alert("请输入商家名称");
		title.focus();
		return false;
	}
	
	var telephone=document.getElementById("atc_telephone");
	var mobphone=document.getElementById("atc_mobphone");
	var email=document.getElementById("atc_email");
	if(telephone.value==""&&mobphone.value==""){
		alert("联系电话和手机您必须填写一个！");
		telephone.focus();
		return false;
	}
	if(telephone.value){
		var cellphone=/^([\d-+]*)$/;
		if(!cellphone.test(telephone.value)||telephone.value.length<6){
			alert('您输入有效电话号码！');
			telephone.focus();
			return false;
		}
	}
	
	if(mobphone.value){
		if(isNaN(mobphone.value)||mobphone.value.length!=11){
			alert("手机号格式不正确！");
			mobphone.focus();
			return false;
		}
	}
	if(email.value){
		if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(email.value)){
			alert("邮箱格式不正确！");
			email.focus();
			return false;
		}
	}
	
	var content=document.getElementById("atc_content");
	if(content.value==""){
		alert("请输入您的品牌介绍！");
		content.focus();
		return false;
	}
	
	return true;
}

//验证输入搜索内容
//add by 张梓宇
//add time at 2010-01-03 11:23
function ck_searchpage(){
	form=document.form_searchpage; 
	if(form.keyword.value==''){
		alert("关键字不能为空!!");
		return false;		
	}
	
}
//验证发布评论
//add by 张梓宇
//add time at 2010-01-03 15:26
function selsets(theinput) {
	if(document.getElementById("content").value!="") {
		document.getElementById("content").value += theinput;
	} else {
		document.getElementById("content").value=theinput;
	}
}

function vals(val) {
	return document.getElementById(val);
}

function chang_city(val,waa) {
	vals(val).value = vals(waa).options[vals(waa).selectedIndex].text;
}

function check_rabbit() {
	
	blogurltel = vals("blogurl").value;
	email = vals("email").value;
	username = vals("mynameis").value;
	weburl = vals("weburl").value;
	content = vals("content").value;
	
	if(username == "") {
		alert("姓名选项为必填项");
		return false;
	}
	
	if(blogurltel == "") {
		alert("手机号码选项为必填项");
		return false;
	}
	
	var cellphone=/^([\d-+]*)$/;
	
	if(!cellphone.test(blogurltel)||blogurltel.length !=11){
		alert('您输入有效电话号码,手机号码为11位！');
		return false;
	}
	
	
	
	/*
	if(email == "") {
		alert("邮箱选项为必填项");
		return false;
	}
	*/
	
	if(email!='') {
		if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(email)){
			alert("邮箱格式不正确！");
			return false;
		}
	}
	
	
	if(weburl == "") {
		alert("请选择地区");
		return false;
	}
	
	if(content == "") {
		alert("留言内容选项为必填项");
		return false;
	}						

}
