function reg_merch_form()
{
	if (document.reg_merchant.userpassword.value.length<5) 
		{alert("密码没有填写或过短！");
		 return false;
		}
		
	else if (document.reg_merchant.userpassword.value.length>8)
		{alert("密码不能超过8位");
		return false;
		}
		
	else if ((document.reg_merchant.userpassword.value) != (document.reg_merchant.confirmpassword.value))
		{alert("密码不一致！");
		return false;
		}
		
	else if (document.reg_merchant.question.value.length<1) 
		{alert("密码提示问题必须填写!");
		return false;
		}
	
	else if (document.reg_merchant.answer.value.length<1) 
		{alert("密码提示问题答案必须填写!");
		return false;
		}
			
	else if (document.reg_merchant.email.value.length<1) 
		{alert("Email必须填写!");
		return false;
		}
		
	else if (document.reg_merchant.name.value.length<1) 
		{alert("公司注册名称必须填写!");		
		return false;
		}
	else if (document.reg_merchant.products.value.length<1) 
		{alert(document.reg_merchant.products.value);
		alert("公司主营业务必须填写!");		
		return false;
		}
	else if (document.reg_merchant.country.value.length<1) 
		{alert("国家必须填写!");	
		return false;
		}
	else if (document.reg_merchant.province.value.length<1) 
		{alert("所在省份必须填写!");	
		return false;
		}
	else if (document.reg_merchant.city.value.length<1) 
		{alert("所在城市必须填写!");	
		return false;
		}
	else if (document.reg_merchant.address.value.length<1) 
		{alert("公司地址必须填写!");	
		return false;
		}
	else if (document.reg_merchant.telephone.value.length<1) 
		{alert("联系电话必须填写!");			
		return false;
		}
	else if (document.reg_merchant.linkman.value.length<1) 
		{alert("联系人必须填写!");
		return false;
		}
	else
		return true;
}



//参数shopcateid为商品类别
function getcheck(vpage,v_formname,subcateid,querykey,keyword,cateid,manu_id,shopcateid,shopid)
{
var curvalue;
curvalue="";
j=v_formname.length-1;

for (i=0;i<j;i++)
{
if (v_formname[i].checked)
        {
                curvalue=curvalue+v_formname[i].value+";";
        }
        
}

str="controller_product.php?controller=sele_goods&";
str += 'page='+vpage;
str += '&subcateid='+subcateid;
str += '&querykey='+querykey;
str += '&keyword='+keyword;
str += '&cateid='+cateid;
str += '&manu_id='+manu_id;
str += '&shopcateid='+shopcateid;
str += '&shopid='+shopid;
str += '&curvalue='+document.form2.allvalue.value+curvalue;
window.location.href=str;
}



//得到所有被选定的产品
//subcateid,shopcateid,shopid三个参数为组成连接服务
//vformname是复选框所在表单名称
function getallvalue(subcateid,v_formname,shopcateid,shopid)
{
var comvalue,checkvalue;
comvalue="";
j=v_formname.length;
for (i=0;i<j;i++)
	{
	if (v_formname[i].checked)
	        {
	                comvalue=comvalue+v_formname[i].value+";";
	        }
	}
checkvalue=document.form2.allvalue.value+comvalue;
checkvaluearray=checkvalue.split(";");
checkvalue=checkvaluearray.join("");
if (checkvalue=="")
	{
	alert("对不起，您还没有选择产品！");
	}
else
	{
	str="controller_product.php?controller=add_price&";
	str += '?subcateid='+subcateid;
	str += '&shopcateid='+shopcateid;
	str += '&shopid='+shopid;
	str += '&curvalue='+document.form2.allvalue.value+comvalue;
	window.location.href=str;
	}
}





