//ajax_ballance
function ajax_ballance()
{
	var str = '/index.php?act=ajax-ballance';
	var ball = getAjax(str);
}
var xmlHttp;
function createXMLHttp()
{
	if(window.XMLHttpRequest)
	{ // Mozilla 浏览器
		xmlHttp = new XMLHttpRequest();
	}else if (window.ActiveXObject)
	{ // IE 浏览器
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
		try{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){}
		}
	}
}

function getAjax(str)
{
createXMLHttp();
var send_string=str;
send_string= encodeURI(encodeURI(send_string));
xmlHttp.open("GET",send_string,false);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.onreadystatechange =function(){
	if(xmlHttp.readyState==4)
	{
		if(xmlHttp.status == 200)
		{ 
				var ret = xmlHttp.responseText;
				return ret;
		}
	}
};
xmlHttp.send(null);
}
//购买积分弹出框
function pay_points()
{
}
function ser_rel_op2(div1,div2)
{
	var st = M(div1);
	var sa = M(div2);
	if(st.style.display == 'none')
	{
		st.style.display = 'block';
		sa.style.display = 'block';
	}
	else
	{
		st.style.display = 'none';
		sa.style.display = 'none';
	}
}
function ser_rel_open(div)
{
	M(div).style.display="block";
	M('reg-info').style.display="none";
	M('release_m').value=div;
}
function ser_rel_close(div)
{
	M(div).style.display="none";
	M('reg-info').style.display="block";
	M('release_m').value=1;
}
function select1() 
	{ 
	var x = [35]; 
	x[0]=""; 
	x[1]="北京,东城,西城,崇文,宣武,朝阳,丰台,石景山,海淀,门头沟,房山,通州,顺义,昌平,大兴,平谷,怀柔,密云,延庆"; 
	x[2]="上海,黄浦,卢湾,徐汇,长宁,静安,普陀,闸北,虹口,杨浦,闵行,宝山,嘉定,浦东,金山,松江,青浦,南汇,奉贤,崇明"; 
	x[3]="天津,和平,东丽,河东,西青,河西,津南,南开,北辰,河北,武清,红挢,塘沽,汉沽,大港,宁河,静海,宝坻,蓟县,大邱庄"; 
	x[4]="重庆,万州,涪陵,渝中,大渡口,江北,沙坪坝,九龙坡,南岸,北碚,万盛,双挢,渝北,巴南,黔江,长寿,綦江,潼南,铜梁,大足,荣昌,壁山,梁平,城口,丰都,垫江,武隆,忠县,开县,云阳,奉节,巫山,巫溪,石柱,秀山,酉阳,彭水,江津,合川,永川,南川"; 
	x[5]="石家庄,邯郸,邢台,保定,张家口,承德,廊坊,唐山,秦皇岛,沧州,衡水"; 
	x[6]="太原,大同,阳泉,长治,晋城,朔州,吕梁,忻州,晋中,临汾,运城"; 
	x[7]="呼和浩特,包头,乌海,赤峰,呼伦贝尔盟,阿拉善盟,哲里木盟,兴安盟,乌兰察布盟,锡林郭勒盟,巴彦淖尔盟,伊克昭盟,鄂尔多斯,通辽"; 
	x[8]="沈阳,大连,鞍山,抚顺,本溪,丹东,锦州,营口,阜新,辽阳,盘锦,铁岭,朝阳,葫芦岛"; 
	x[9]="长春,吉林,四平,辽源,通化,白山,松原,白城,延边"; 
	x[10]="哈尔滨,齐齐哈尔,牡丹江,佳木斯,大庆,绥化,鹤岗,鸡西,黑河,双鸭山,伊春,七台河,大兴安岭"; 
	x[11]="南京,镇江,苏州,南通,扬州,盐城,徐州,连云港,常州,无锡,宿迁,泰州,淮安"; 
	x[12]="杭州,宁波,温州,嘉兴,湖州,绍兴,金华,衢州,舟山,台州,丽水"; 
	x[13]="合肥,芜湖,蚌埠,马鞍山,淮北,铜陵,安庆,黄山,滁州,宿州,池州,淮南,巢湖,阜阳,六安,宣城,亳州"; 
	x[14]="福州,厦门,莆田,三明,泉州,漳州,南平,龙岩,宁德"; 
	x[15]="南昌市,景德镇,九江,鹰潭,萍乡,新馀,赣州,吉安,宜春,抚州,上饶"; 
	x[16]="济南,青岛,淄博,枣庄,东营,烟台,潍坊,济宁,泰安,威海,日照,莱芜,临沂,德州,聊城,滨州,菏泽,博兴"; 
	x[17]="郑州,开封,洛阳,平顶山,安阳,鹤壁,新乡,焦作,濮阳,许昌,漯河,三门峡,南阳,商丘,信阳,周口,驻马店,济源"; 
	x[18]="武汉,宜昌,荆州,襄樊,黄石,荆门,黄冈,十堰,恩施,潜江,天门,仙桃,随州,咸宁,孝感,鄂州"; 
	x[19]="长沙,常德,株洲,湘潭,衡阳,岳阳,邵阳,益阳,娄底,怀化,郴州,永州,湘西,张家界"; 
	x[20]="广州,深圳,珠海,汕头,东莞,中山,佛山,韶关,江门,湛江,茂名,肇庆,惠州,梅州,汕尾,河源,阳江,清远,潮州,揭阳,云浮"; 
	x[21]="南宁,柳州,桂林,梧州,北海,防城港,钦州,贵港,玉林,南宁地区,柳州地区,贺州,百色,河池"; 
	x[22]="海口,三亚"; 
	x[23]="成都,绵阳,德阳,自贡,攀枝花,广元,内江,乐山,南充,宜宾,广安,达川,雅安,眉山,甘孜,凉山,泸州"; 
	x[24]="贵阳,六盘水,遵义,安顺,铜仁,黔西南,毕节,黔东南,黔南"; 
	x[25]="昆明,大理,曲靖,玉溪,昭通,楚雄,红河,文山,思茅,西双版纳,保山,德宏,丽江,怒江,迪庆,临沧"; 
	x[26]="拉萨,日喀则,山南,林芝,昌都,阿里,那曲"; 
	x[27]="西安,宝鸡,咸阳,铜川,渭南,延安,榆林,汉中,安康,商洛"; 
	x[28]="兰州,嘉峪关,金昌,白银,天水,酒泉,张掖,武威,定西,陇南,平凉,庆阳,临夏,甘南"; 
	x[29]="银川,石嘴山,吴忠,固原"; 
	x[30]="西宁,海东,海南,海北,黄南,玉树,果洛,海西"; 
	x[31]="乌鲁木齐,石河子,克拉玛依,伊犁,巴音郭勒,昌吉,克孜勒苏柯尔克孜,博 尔塔拉,吐鲁番,哈密,喀什,和田,阿克苏"; 
	x[32]="香港,"; 
	x[33]="澳门,"; 
	x[34]="台北,高雄,台中,台南,屏东,南投,云林,新竹,彰化,苗栗,嘉义,花莲,桃园,宜兰,基隆,台东,金门,马祖,澎湖"; 
	var provinces=",北京,上海,天津,重庆, 河北,山西,内蒙古,辽宁,吉林,黑龙江,江苏,浙江,安徽,福建,江西,山东,河南,湖北,湖南,广东,广西,海南,四川,贵州,云南,西藏,陕西,甘肃,宁夏,青海,新疆,香港,澳门,台湾"; 

	var citys=x[document.getElementById("p1").value].split(",");
	for(var i=0;i<citys.length;i++) 
	document.getElementById("c1").options[i]=new Option(citys[i],citys[i]); 
	   

	var province = provinces.split(","); 
	document.getElementById("p2").innerHTML = province[document.getElementById("p1").value]; 
	document.getElementById("p22").value = province[document.getElementById("p1").value]; 
	document.getElementById("c2").innerHTML = document.getElementById("c1").value; 
	document.getElementById("c22").value = document.getElementById("c1").value; 
	} 
function result() 
{ 
document.getElementById("c2").innerHTML = document.getElementById("c1").value; 
document.getElementById("c22").value = document.getElementById("c1").value; 
} 
function show_menu(price)
   {
       var son1=M('k1');
	   var son2=M('k2');
	   var son3=M('k3');
	   if (price == 1)
		{	
			   M('sm1').style.background='#ade6ff';
			   M('sm1').style.fontSize='14px';
			   M('sm2').style.background='#ECF9FF';
			   M('sm2').style.fontSize='12px';
			   M('sm3').style.background='#ECF9FF';
			   M('sm3').style.fontSize='12px';
		       son1.style.display='block';
			   son2.style.display='none';
			   son3.style.display='none'
		}
		else if (price == 2)
		{	
		   M('sm2').style.background='#ade6ff';
		   M('sm2').style.fontSize='14px';
		   M('sm1').style.background='#ECF9FF';
		   M('sm1').style.fontSize='12px';
		   M('sm3').style.background='#ECF9FF';
		   M('sm3').style.fontSize='12px';
	
            son2.style.display='block';
			son1.style.display='none';
			son3.style.display='none';
		}
		
		else if (price == 3)
		{	
			M('sm3').style.background='#ade6ff';
			   M('sm3').style.fontSize='14px';
			   M('sm2').style.background='#ECF9FF';
			   M('sm2').style.fontSize='12px';
			   M('sm1').style.background='#ECF9FF';
			   M('sm1').style.fontSize='12px';
            son3.style.display='block';
			son2.style.display='none';
			son1.style.display='none';
		}
   }

   function show_service(service)
   {
       var ser1=M('ser1');
	   var ser2=M('ser2');
	   var ser3=M('ser3');
	   if (service == 1)
		{	
		      M('sm4').style.background='#ade6ff';
			   M('sm4').style.fontSize='14px';
			   M('sm5').style.background='#ECF9FF';
			   M('sm5').style.fontSize='12px';
			   M('sm6').style.background='#ECF9FF';
			   M('sm6').style.fontSize='12px';
		       ser1.style.display='block';
			   ser2.style.display='none';
			   ser3.style.display='none'
		}
		else if (service == 2)
		{	
			M('sm5').style.background='#ade6ff';
			   M('sm5').style.fontSize='14px';
			   M('sm4').style.background='#ECF9FF';
			   M('sm4').style.fontSize='12px';
			   M('sm6').style.background='#ECF9FF';
			   M('sm6').style.fontSize='12px';
            ser2.style.display='block';
			ser1.style.display='none';
			ser3.style.display='none';
		}
		
		else if (service == 3)
		{	
			M('sm6').style.background='#ade6ff';
			M('sm6').style.fontSize='14px';
			M('sm4').style.background='#ECF9FF';
			M('sm4').style.fontSize='12px';
			M('sm5').style.background='#ECF9FF';
			M('sm5').style.fontSize='12px';
            ser3.style.display='block';
			ser2.style.display='none';
			ser1.style.display='none';
		}
   }
   function M(yid)
   {
		return document.getElementById(yid);
   }
   function headerSub()
   {
	   var url = "?act="+M('sub_type').value+"search";
	   document.form_header.action=url;
	   document.form_header.submit();
   }
   function show_ques(ques)
   {
	   var ques1=M('question1');
	   var ques2=M('question2');
	   if (ques == 1)
	   {	
		       M('ques1').style.background='#ade6ff';
			   M('ques1').style.fontSize='14px';
			   M('ques2').style.background='#ECF9FF';
			   M('ques2').style.fontSize='12px';
		       ques1.style.display='block';
			   ques2.style.display='none';
		}
		if (ques == 2)
		{	
		       M('ques1').style.background='#ECF9FF';
			   M('ques1').style.fontSize='12px';
			   M('ques2').style.background='#ade6ff';
			   M('ques2').style.fontSize='14px';
		       ques1.style.display='none';
			   ques2.style.display='block';
		}
   }
   function onenter()
   {
		headerSub();
   }
   var W = screen.width;//取得屏幕分辨率宽度
var H = screen.height;//取得屏幕分辨率高度
function M(id){
    return document.getElementById(id);//用M()方法代替document.getElementById(id)
}
function MC(t){
   return document.createElement(t);//用MC()方法代替document.createElement(t)
};
//判断浏览器是否为IE
function isIE(){
      return (document.all && window.ActiveXObject && !window.opera) ? true : false;
} 
//取得页面的高宽
function getBodySize(){
   var bodySize = [];
   with(document.documentElement) {
   bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;//如果滚动条的宽度大于页面的宽度，取得滚动条的宽度，否则取页面宽度
   bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;//如果滚动条的高度大于页面的高度，取得滚动条的高度，否则取高度
//   bodySize[0] =clientWidth;
//   bodySize[1] =clientHeight;
   }
   return bodySize;
}
//创建遮盖层
function popCoverDiv(){
   if (M("cover_div")) {
   //如果存在遮盖层，则让其显示 
    M("cover_div").style.display = 'block';
   } else {
   //否则创建遮盖层
    var coverDiv = MC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    with(coverDiv.style) {
     position = 'absolute';
     background = '#333';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 0;
     if (isIE()) {
      filter = "Alpha(Opacity=60)";//IE逆境
     } else {
      opacity = 0.6;
     }
    }
   }
}


//让登陆层显示为块 
function showLogin(div)
{
		var login=M(div);
		login.style.display = "block";
}
//设置DIV层的样式
function change(div,left,top){
          var login = M(div);
      login.style.position = "absolute";
      login.style.border = "1px solid #CCCCCC";
      login.style.background ="#fff";
      var i=0;
          var bodySize = getBodySize();
      login.style.left = left+"px";
      login.style.top = top+"px";
      login.style.width =      i*i*4 + "px";
      login.style.height = i*i*1.5 + "px";
     
      popChange(i,div,left,top);
}
//让DIV层大小循环增大
function popChange(i,div,left,top){
      var login = M(div);
          var bodySize = getBodySize();
      login.style.left = left+"px";
      login.style.top = top+"px";
      login.style.width =      i*i*4 + "px";
      login.style.height = i*i*1.5+ "px";
      if(i<=10){
           i++;
           setTimeout("popChange("+i+")",10);//设置超时10毫秒
      }
}
//打开DIV层
function open(div,left,top)
{
        change(div,left,top);
        showLogin(div);
        popCoverDiv();
        void(0);
}
//关闭DIV层
function close(){
         M('divc').style.display = 'none';
         M("cover_div").style.display = 'none';
        void(0);
}


function M(id)
{
     return document.getElementById(id);
}


 function is_registered()
	  {
         var username=document.getElementById('username').value;
		 if(username=='')
		 {
		    M('name_notice').innerHTML='<font  color="red">用户名不能为空</font>';
			M('submit').disabled = true;
		 }
		 else if(username.length>=4 &username.length<=20)
		 {
					var url='?act=check-username';
					var query='action=check&username='+username;
					$.post(url,query,function(data)
					{
					   if(data==1)
					   {
						 M('name_notice').innerHTML='<font  color="red">该会员名已被注册</font>';
						 M('username').focus();
						   M('username').value="";
						 M('submit').disabled = true;
					   }
					   else
					   {
						 M('name_notice').innerHTML='<font color="green">该会员名可以注册</font>';
						
						 M('submit').disabled = false;
					   }
					});
			}
			else
			{
			   M('name_notice').innerHTML='<font  color="red">用户名必须在4-20位,一个汉字代表一个字符</font>';
			}
	}

		 
	function is_password()
	{
       var password=M('password').value;
       //var name=M('name_notice').innerHTML;
		       if(password=="")
			   {
                   M('password_notice').innerHTML='<font  color="red">请输入密码</font>';
				   M('submit').disabled = true;
			   }
			   else 
			   {
			        if(password.length>=4&password.length<=20)
					{
		               M('password_notice').innerHTML='<font  color="green">密码输入正确</font>';
					 }
					 else
					 {
					    M('password_notice').innerHTML='<font  color="red">由4到20个字符、数字组成，不得包含非法字符(例如:\,@)！</font>';
					 }
			   }
	}

	function is_rpassword()
	{
	     var password_notice=M('password_notice').innerHTML;
	     var rpassword=M('rpassword').value;
	     var password=M('password').value;
	         if(rpassword!=password)
			 {
			      M('rpassword_notice').innerHTML='<font  color="red">请重复输入上面的密码</font>';
			 }
			 else
			 {
			     M('rpassword_notice').innerHTML='<font  color="green">重复密码输入正确</font>';
			 }
	}
	function check_email()
	{
	   var email=M('email').value;
		if(email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	   { 
			M('email_notice').innerHTML='<font  color="green">输入正确</font>';
	   }
	   else
	   {
		   M('email_notice').innerHTML='<font  color="red">请输入正确的邮箱地址</font>';
	   }
	}
	function is_submit()
	{
		var username = M('username').value;
		var password = M('password').value;
		var rpassword = M('rpassword').value;
		var email = M('email').value;
		var rols = M('rols').value;
		var code = M('code').value;
		var checkbox = M('checkbox').value;
		 if(username=='')
		 {
		    alert("用户名不能为空");
			M('username').focus();
			M('username').value="";
			return false;
		 }
		 else if(username.length<4 &username.length>20)
		 {
			 alert('用户名必须在4-20位,一个汉字代表一个字符');
			 M('username').value="";
			 M('username').focus();
			 return false;
		 }
		 if(password.length<4&password.length>20)
		{
		   alert("由4到20个字符、数字组成，不得包含非法字符(例如:\,@)！");
			M('password').value="";
			 M('password').focus();
			 return false;
		 }
		 if(rpassword!=password)
		 {
			  alert("请重复输入上面的密码");
				M('rpassword').value="";
			 M('rpassword').focus();
			 return false;
		 }
		 if(email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		   { 
				alert("请输入正确的邮箱地址");
				M('email').value="";
				 M('email').focus();
				 return false;
		   }
		   if(code=='')
		  {
			   alert("验证码错误！");
			   return false;
		   }
		return true;
	}