/*
Author Name: rockyxia
design time:2010-10-26
author QQ:543152889
*/

function initAjax(){
	var ajax=false;
		var msxmlhttp = new Array('Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0',
		'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP');
	for (var i = 0; i < msxmlhttp.length; i++)
	{
		try
		{
			ajax = new ActiveXObject(msxmlhttp[i]);
		}
		catch (e)
		{
			ajax = null;
		}
	}
	if(!ajax && typeof XMLHttpRequest!="undefined"){
		ajax=new XMLHttpRequest();
	}
	if (!ajax)
	{
		alert("创建XMLHttp请求对象错误!");
		return false;
	}
	return ajax;
}

function chname(x)<!--用户名-->
{
	if(x==""){
		alert("请输入用户名");
		form1.uname.focus();
		return false;
		}
	
	
xxl.style.display="none";
xml.style.display="";
xmlHttp=initAjax();		//初始华ajax
xmlHttp.onreadystatechange=function()
{
	  if(xmlHttp.readyState == 1)//表示正在加载
         {
            document.getElementById("xml").innerHTML ="查询中...";
        }
	 if(xmlHttp.readyState==4 && xmlHttp.status == 200)//readState == 4 数据操作结束可以
	 {
	 	document.getElementById("xml").innerHTML=xmlHttp.responseText;
	 }
}	
url = "ajax.asp?id=1&name="+x+"&num="+Math.floor(Math.random()*1000);
	//alert(url);
	xmlHttp.open("get",url,true);	
	xmlHttp.send(null)

}


function second(x)<!--用户名-->
{
	if(x==""){
		alert("请选择");
		form1.base_id.focus();
		return false;
		}
	

xmlHttp=initAjax();		//初始华ajax
xmlHttp.onreadystatechange=function()
{
	  if(xmlHttp.readyState == 1)//表示正在加载
         {
            document.getElementById("sec").innerHTML ="<select name='second_id' id='second_id'><option value=''>查询中</option></select>";
        }
	 if(xmlHttp.readyState==4 && xmlHttp.status == 200)//readState == 4 数据操作结束可以
	 {
	 	document.getElementById("sec").innerHTML=xmlHttp.responseText;
	 }
}	
url = "ajax.asp?id=2&base_id="+x+"&num="+Math.floor(Math.random()*1000);
	//alert(url);
	xmlHttp.open("get",url,true);	
	xmlHttp.send(null)

}

function asecond(x)<!--用户名-->
{
	if(x==""){
		alert("请选择");
		form1.abase_id.focus();
		return false;
		}
	

xmlHttp=initAjax();		//初始华ajax
xmlHttp.onreadystatechange=function()
{
	  if(xmlHttp.readyState == 1)//表示正在加载
         {
            document.getElementById("sec").innerHTML ="<select name='asecond_id' id='asecond_id'><option value=''>查询中</option></select>";
        }
	 if(xmlHttp.readyState==4 && xmlHttp.status == 200)//readState == 4 数据操作结束可以
	 {
	 	document.getElementById("sec").innerHTML=xmlHttp.responseText;
	 }
}	
url = "ajax.asp?id=3&base_id="+x+"&num="+Math.floor(Math.random()*1000);
	//alert(url);
	xmlHttp.open("get",url,true);	
	xmlHttp.send(null)

}


function yz(){
	
	if(document.getElementById("uname").value==""){
		alert("请输入用户名");
		document.getElementById("uname").focus();
		return false;
		}
	if(document.getElementById("tname").value==""){
		alert("请输入商家名称");
		document.getElementById("tname").focus();
		return false;
		}
		
	if(document.getElementById("pass").value==""){
		alert("请输入密码");
		document.getElementById("pass").focus();
		return false;
		}
		
	if(document.getElementById("pass1").value==""){
		alert("请重复输入密码");
		document.getElementById("pass1").focus();
		return false;
		}
	if(document.getElementById("pass").value==""||document.getElementById("pass").value!=document.getElementById("pass1").value){
		alert("密码不能为空或两次密码不一致");
		document.getElementById("pass").focus();
		return false;
		}
	if(document.getElementById("type").value==""){
		alert("请选择分类");
		document.getElementById("type").focus();
		return false;
		}
	
	if(document.getElementById("base_id").value==""||document.getElementById("second_id").value==""){
		alert("请选择正确的地址");
		document.getElementById("base_id").focus();
		return false;
		}
	
	if(document.getElementById("yysj").value==""){
		alert("请输入营业时间");
		document.getElementById("yysj").focus();
		return false;
		}
		
	if(document.getElementById("about").value==""){
		alert("请输入相关内容");
		document.getElementById("about").focus();
		return false;
		}
	if(document.getElementById("fwcn").value==""){
		alert("请输入服务承诺");
		document.getElementById("fwcn").focus();
		return false;
		}
	
	
	
	
	
	}



<!-- 
//屏蔽js错误 
function ResumeError() { 
return true; 
} 
window.onerror = ResumeError; 
// --> 

