
function CreateXMLHTTPObject()
{
	var xObject = null;

	try 
	{
		xObject = new ActiveXObject("Msxml2.xmlhttp.4.0");
	}
	catch (e)
	{
		try
		{
			xObject = new XMLHttpRequest(); 
			if (xObject.overrideMimeType) {//设置MiME类别
				xObject.overrideMimeType('text/xml');
			}
		}
		catch (e)
		{
			try 
			{
				xObject = new ActiveXObject("Msxml2.xmlhttp");
			} 
			catch (e) 
			{
				try 
				{
					xObject = new ActiveXObject("Microsoft.xmlhttp");
				} 
				catch (e) 
				{
					alert("Error: Unable to create XML HTTP object!");
				}
			}
		}
	}

	return xObject;
}






function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
}
}


function validate_comment()
{
	var obj = document.getElementById('user_contents');
	if(obj.value==''){
		alert("请填写评论内容!");
		obj.focus();
		return false;
	}

}












function validate()
{
	var obj = document.getElementById('user_realname');
	if(obj.value==''){
		alert("You did not complete all of the required fields or input data is incorrect.");
		obj.focus();
		return false;
	}

	var obj = document.getElementById('user_email');
	if(obj.value==''){
		alert("You did not complete all of the required fields or input data is incorrect.");
		obj.focus();
		return false;
	}
	var obj = document.getElementById('user_contents');
	if(obj.value==''){
		alert("You did not complete all of the required fields or input data is incorrect.");
		obj.focus();
		return false;
	}
	 var obj = document.getElementById('title');
	if(obj.value==''){
		alert("You did not complete all of the required fields or input data is incorrect.");
		obj.focus();
		return false;
	}
}




/*  用户登陆 */	

	function CheckForm()
	{
		if(document.UserLogin.username.value=="")
		{
			alert("请输入用户名");
			document.UserLogin.username.focus();
			return false;
		}
		if(document.UserLogin.password.value == "")
		{
			alert("请输入密码");
			document.UserLogin.password.focus();
			return false;
		}
	}




   function CheckfeedForm()


	{
		
		if(document.myform.title.value == "")
		{
			alert("请填写标题.");
			document.myform.title.focus();
			return false;
		}



	if(document.myform.name.value == "")
		{
			alert("请填写联系人.");
			document.myform.name.focus();
			return false;
		}


	if(document.myform.email.value == "")
		{
			alert("请填写Email.");
			document.myform.email.focus();
			return false;
		}

				if(document.myform.content.value == "")
		{
			alert("请填写留言内容.");
			document.myform.content.focus();
			return false;
		}

	}








/*  =====================================================================会员注册 */	
	function CheckuregForm()
	{
		if(document.myform.UserName.value=="")
		{
			alert("对不起,用户名必须填写.");
			document.myform.UserName.focus();
			return false;
		}
		if(document.myform.PassWord.value == "")
		{
			alert("对不起,密码必须填写");
			document.myform.PassWord.focus();
			return false;
		}
		if(document.myform.RePassWord.value == "")
		{
			alert("对不起,请再次输入密码");
			document.myform.RePassWord.focus();
			return false;
		}

	}


/*  =====================================================================会员注册 */	
	function Checkinfoadd()
	{
		if(document.myform.title.value=="")
		{
			alert("对不起,请输入信息标题.");
			document.myform.title.focus();
			return false;
		}

		if(document.myform.x_compang_name.value == "")
		{
			alert("对不起,请输入公司名称");
			document.myform.x_compang_name.focus();
			return false;
		}
		if(document.myform.x_company_add.value == "")
		{
			alert("对不起,请输入公司地址");
			document.myform.x_company_add.focus();
			return false;
		}
		if(document.myform.x_photo.value == "")
		{
			alert("对不起,请输入联系电话");
			document.myform.x_photo.focus();
			return false;
		}
		if(document.myform.x_lianxi.value == "")
		{
			alert("对不起,请输入联系人");
			document.myform.x_lianxi.focus();
			return false;
		}



	}




	function CheckpfForm()
	{
		if(document.myform.firstname.value=="")
		{
			alert("对不起,请输入联系人");
			document.myform.firstname.focus();
			return false;
		}
		
		if(document.myform.address.value == "")
		{
			alert("对不起,请输入联系地址");
			document.myform.address.focus();
			return false;
		}

		
		if(document.myform.mobile.value == "")
		{
			alert("对不起,请输入联系电话");
			document.myform.mobile.focus();
			return false;
		}







		if(document.myform.product_name.value == "")
		{
			alert("对不起,请输入产品名称");
			document.myform.product_name.focus();
			return false;
		}

	}

















/*  =====================================================================会员资料修改 */	
	function CheckumodForm()
	{
		if(document.frm.Email.value=="")
		{
			alert("对不起,邮局必须填写.");
			document.frm.Email.focus();
			return false;
		}
		if(document.frm.RealName.value == "")
		{
			alert("对不起,用户名必须填写");
			document.frm.RealName.focus();
			return false;
		}
		if(document.frm.userphone.value == "")
		{
			alert("对不起,电话必须填写");
			document.frm.userphone.focus();
			return false;
		}
		if(document.frm.userzip.value == "")
		{
			alert("对不起,邮编必须填写");
			document.frm.userzip.focus();
			return false;
		}
		if(document.frm.selstate.value == "")
		{
			alert("对不起,省份必须选择");
			document.frm.selstate.focus();
			return false;
		}

		if(document.frm.useraddress.value == "")
		{
			alert("对不起,地址必须填写");
			document.frm.useraddress.focus();
			return false;
		}

	}

/*  =====================================================================忘记密码 */	
	function Checksendpw()
	{
		if(document.myform.name.value=="")
		{
			alert("请输入用户名");
			document.myform.name.focus();
			return false;
		}
		if(document.myform.Question.value == "")
		{
			alert("请输入注册时填写的问题");
			document.myform.Question.focus();
			return false;
		}
		if(document.myform.Answer.value == "")
		{
			alert("请输入注册时填写的答案");
			document.myform.Answer.focus();
			return false;
		}

	}


function check_add_zcj(form,pid){
u_name=myform.pid.value;
action=myform.action.value;
myurl=location.protocol+"//"+location.hostname+"/sc.php?pid="+u_name+"&action="+action;
checkm.location.href=myurl;
return;
}


function checkinput() { 

	if(document.myform.oldpassword.value=='' || document.myform.newpassword.value=='' || document.myform.newpassword2.value==''){
		alert("请输入密码");
		document.myform.oldpassword.focus();
		return false;
	}
	if(document.myform.newpassword.value != document.myform.newpassword2.value){
		alert("请确定新密码输入是否正确");
		document.myform.newpassword.focus();
		return false;
	}
	return true;
}








	function check_payform()
	{
		if(document.frm.r_name.value=="")
		{
			alert("请填写收货人姓名");
			document.frm.r_name.focus();
			return false;
		}
	
		if(document.getElementById("selstate").value == "" || document.getElementById("selstate").value == "0")
		{
			alert("请选择地区");
			document.frm.selstate.focus();
			return false;
		}

			if(document.getElementById("selcity").value == "" || document.getElementById("selcity").value == "0")
		{
			alert("请选择城市");
			document.frm.selcity.focus();
			return false;
		}

			if(document.frm.r_detailaddr.value == "")
		{
			alert("请填写详细地址");
			document.frm.r_detailaddr.focus();
			return false;
		}

	
			if(document.frm.r_zipcode.value == "")
		{
			alert("请填写邮政编码");
			document.frm.r_zipcode.focus();
			return false;
		}




			if(document.frm.r_mobile.value == "" & document.frm.r_hphone.value == "")
		{
			alert("请填写固定电话或手机");
			document.frm.r_mobile.focus();
			return false;
		}
	
	}




