//var citynum=023;//
/**
*用户修改个人信息
*
*/

var usermodinfo={"load":function()
						{
							//给照片按扭添加事件
							//读取用户个人信息，回填表单，并给表单加验证代码
							$("#userInfomodFrom").unbind();
							usermodinfo.formvalie();
							 var url='/libs/models/user/UserCenter.php';
									$.ajax({
										 type: "POST",
										 url: url,
										 data:   "flag=readUserInfo",
										 success: function(msg){
										//	 alert(msg);
											 					try{ eval("ob=" +msg);} catch(e){}
																if(ob)
																{	
																
																
																    $("#user_mod_mod_lab").unbind();
							$("#user_mod_mod_lab").click(function() {
														 var lab1=$("#user_mod_mod_lab").html(); 
														 if("修改"==new String(lab1).toString())
														 {
															 $("#user_mod_mod_lab").html("取消");
															 $("#user_mod_photo_img").hide();
															 $("#user_mod_photo_input").show();
														 }
														 else
														 {
															 //$("#user_mod_isPhoto").clearInputs();
															 $("#user_mod_mod_lab").html("修改");
															 $("#user_mod_photo_img").show();
															 $("#user_mod_photo_input").hide();
														 }
														});
																	//给我的页面添加信息
																	$("#user_mod_Truename").val(ob[0].Truename);
																	$("#user_mod_email").val(ob[0].Email);
																	$("#user_mod_Qestion").val(ob[0].Qestion);
																	$("#user_mod_Answer").val(ob[0].Answer);
																	$("#user_mod_QQ").val(ob[0].QQ);
																	$("#user_mod_Mobile").val(ob[0].Mobile);
																	$("#user_mod_Telephone").val(ob[0].Telephone);
																	$("#user_mod_Address").val(ob[0].Address);
																	$("#user_mod_Birthday").val(ob[0].Birthday);
																	$("#user_mod_Diploma").val(ob[0].Diploma);
																	$("#user_mod_Http").val(ob[0].Http);
																	$("#user_mod_Interest").val(ob[0].Interest);
																	$("#user_mod_Info").val(ob[0].Info);
																	$("#user_mod_Profession").val(ob[0].Profession);
																	var checkedA="";
																	var checkedB="";
																	if(parseInt (ob[0].Sex)==0)
																		checkedA='checked="checked"';
																	else
																		checkedB='checked="checked"';
																	var str1='<input type="radio" name="user_mod_sex"  onclick="usermodinfo.radio_value(0)" id="RadioGroup1_0" '+checkedA+' value="0"/>男'+
																			 '<input type="radio" name="user_mod_sex" onclick="usermodinfo.radio_value(1)" id="RadioGroup1_1" '+checkedB+' value="1"/>女';
																	$("#user_mod_sexhtml").html(str1);
																	//是否有图片
																	
																	if(parseInt(ob[0].isPhoto)==1)
																	{
																		var str='<img width="50"  src="/image/023/userinfo/logo/'+ob[0].UID+'.jpg"/>';
																		$("#user_mod_photo_img").html(str);
																		$("#user_mod_mod_lab").html("修改");
																		$("#user_mod_mod_lab").show();
																		$("#user_mod_photo_img").show();
																		$("#user_mod_photo_input").hide();
																	}
																	else
																	{
																		$("#user_mod_photo_img").hide();
																		$("#user_mod_photo_input").show();
																		$("#user_mod_mod_lab").hide();
																	}
																}
																}
										});
								
									
							},
						"formvalie":function()
							{
								
								 $("#userInfomodFrom").validate({
										rules: {
												user_mod_Truename:{
																required:true
													},
												user_mod_email:{
														required:true,
														email:true													
													},
												user_mod_password2:{
															equalTo:"#user_mod_password1"
													},
												user_mod_QQ:{
														is_qq:true
													},
												user_mod_Mobile:{
														is_mobile:true
													},
												user_mod_Telephone:{
														is_phone:true
													},
												user_mod_Birthday:{
																	dateISO:true
																},
												user_mod_Http:{
																url:true
																},
												user_mod_Diploma:{
																	checkstr:true
															},
												user_mod_Interest:{
																	checkstr:true
																},
												user_mod_Info:{
																checkstr:true
															},
												user_mod_Profession:{
																		checkstr:true
																	}			
											
											},
									  messages: {
											user_mod_Truename:{
																required:"不能为空"
													},
												user_mod_email:{
														required:"不能为空",
														email:"请输入正确的EAMIL"													
													},
												user_mod_password2:{
															equalTo:"两次密码不一致"
													},
												user_mod_QQ:{
														is_qq:"请输入正确的QQ号码"
													},
												user_mod_Mobile:{
														is_mobile:"请输入正确的手机号码"
													},
												user_mod_Telephone:{
														is_phone:"请输入正确的电话号码"
													},
												user_mod_Birthday:{
																	dateISO:"请输入正确的日期,格式为1986-05-09"
																},
												user_mod_Http:{
																url:"请输入正确的URL"
																},
												user_mod_Diploma:{
																	checkstr:"不能输入特殊字符"
															},
												user_mod_Interest:{
																	checkstr:"不能输入特殊字符"
																},
												user_mod_Info:{
																checkstr:"不能输入特殊字符"
															},
												user_mod_Profession:{
																		checkstr:"不能输入特殊字符"
																	}				
										  }
									});
								
							},
						"radio_value":function(str)
										{
											$("#user_mod_sex_temp").val(str);
										}
						};
/**
*描述：用户登陆
*useroperator.formcheck();表单验证,
*useroperator.Login();登陆AJAX提交表单，
*useroperator.Logout();方法退出登陆
*作者：张军华
*时间:2008-1-25
**/
var useroperator={"userLoad":function()
								{

										//注册表单验证
										useroperator.ValidationRegisterForm();
										//区域的选择
										$("#city").change(function(){useroperator.city_area();});
										$("#logn_quit").hide();
										//登陆链接事件
										$("#viewLogn_a").click(function(){
																			$("#functionBlock").show();
																			$("#rule").hide();
																			$("#register").hide();
																			$("#loginBar").show();
																			$("#loginForm").unbind();
																			useroperator.formcheck(); 
																			});														
										//注册链接点击事件
/*										$("#viewReg_a").click(function(){
																	   		$("#functionBlock").show();
																			$("#loginBar").hide();
																			$("#rule").show();
																			//useroperator.rule_acc_buttion_time();
																		});*/
										//登陆按扭事件
										$("#login_close_buttion").click(function(){$("#functionBlock").hide();$("#loginBar").hide();});
										//注册规则同意按扭事件
										
										$("#rule_acc_buttion").click(function(){$("#rule").hide();$("#functionBlock").show();$("#register").show();
																				useroperator.ValidationCodeRegister();
																			//	useroperator.ValidationRegisterForm();
																				//当前的按扭复位
																				$("#rule_acc_buttion").attr("valueNum","9");
																				//$("#rule_acc_buttion").attr("disabled","disabled");
																				//$("#rule_acc_buttion").val("同意(9)");
																				
																		     });
										//注册规则不同意按扭事件
										$("#rule_not_buttion").click(function(){$("#functionBlock").hide();$("#rule").hide();});
										//刷新验证码
										$("#shaxing_code").click(function(){
																			useroperator.ValidationCodeRegister();
																		//	useroperator.ValidationRegisterForm();
																		 });
										//注册页面的关闭
										$("#Reg_close_buttion").click(function(){$("#register").hide();$("#functionBlock").hide();});
										//登陆页面的注册按扭
										//$("#Log_Reg_buttion").click(function(){$("#loginBar").hide();$("#rule").show();useroperator.rule_acc_buttion_time();});  		//older reg function								
										$("#Log_Reg_buttion").click(function(){ location.href=$("#viewReg_a").attr('href');});  							
										//注册页面的关闭按扭
										$("#Reg_close_buttion").click(function(){$("#register").hide();$("#functionBlock").hide();});
										//页面退出登陆链接事件
										$("#logn_quit").click(function(){
																	   	useroperator.Logout();
																		$("#logn_quit").hide();
																		$("#myD2dBox_username").html("");
																		$("#myD2dBox_Level").html("");
																		$("#UserInfoList_truename").html("");
																		$("#UserInfoList_email").html("");
																		$("#UserInfoList_sex").html("");
																		$("#UserInfoList_qq").html("");
																		$("#UserInfoList_mobile").html("");
																		$("#UserInfoList_telephone").html("");
																		$("#UserInfoList_address").html("");
																		$("#myD2dBox_Integral").html("");
																		$("#RegForm1").clearForm();
																		});
										//页面加载的时候运行
										useroperator.RefCheckLogStat();
									//	alert($("#banner_UID").val());
											
								},
					"RefCheckLogStat":function()//用户刷新网页后，如果用户是登陆，则在页面作处理
								{
									var url='/libs/models/user/UserCenter.php';
									$.ajax({
										 type: "POST",
										 url: url,
										 data:   "flag=RefCheckLogStat",
										 async:false,
										 success: function(msg){
											 					if(parseInt(msg)!=-1)
																{
																	try{ eval("ob=" +msg);} catch(e){}
																	if(ob){
																		$("#logn_quit").show();
																		$("#ViewuserName").html(ob.Truename);
																		$("#banner_UID").val(ob.UID);
																		$("#viewLogn_a").hide();
																		//alert(ob.Truename);
																		//alert($("#banner_UID").val());
																		}
																	
																}
											 					//alert( "Data Saved: " +   msg ); 
																} 
										}); 
								},			
					"self_Info":function()//显示我的信息
								{
									
									var ViewuserNameHtml=$("#ViewuserName").html();
									if(ViewuserNameHtml=="游客")
										return 0;
									Pagelink('myD2d');
								//	alert(ViewuserNameHtml);
									var url='/libs/models/user/UserCenter.php';
									$.ajax({
										 type: "POST",
										 url: url,
										 data:"flag=my_self_infp",
										 success: function(msg){
											 					//document.write(msg);
															//	alert(msg);
																var sumpersonintegral=0;
											 					try{ eval("ob2=" +msg);
																	ob=ob2.userinfo;
																	integral=ob2.Integral;
																	//alert(integral.length);
																	for(i=0;i<integral.length;i++)
																	{
																		//alert(integral[i].issuance);
																		if(new String(parseInt(integral[i].issuance)).toString()==new String("NaN").toString())
																			integral[i].issuance=0;
																		if(new String(parseInt(integral[i].review)).toString()==new String("NaN").toString())
																			integral[i].review=0;
																		if(new String(parseInt(integral[i].revert)).toString()==new String("NaN").toString())
																			integral[i].revert=0;
																		if(new String(parseInt(integral[i].accessing)).toString()==new String("NaN").toString())
																			integral[i].accessing=0;
																		sumpersonintegral+=parseInt(integral[i].issuance)+parseInt(integral[i].review)+parseInt(integral[i].revert)+parseInt(integral[i].accessing);
																		
																	}
																		//alert(sumpersonintegral);
																	} catch(e){}
																if(ob)
																{	//给我的页面添加信息
																	$("#myD2dBox_username").html(ob[0].Username);
																	$("#myD2dBox_Level").html(ob[0].Level);
																	
																	
																	$("#UserInfoList_truename").html(ob[0].Truename);
																	$("#UserInfoList_email").html(ob[0].Email);
																	$("#UserInfoList_sex").html(ob[0].Sex);
																	$("#UserInfoList_qq").html(ob[0].QQ);
																	$("#UserInfoList_mobile").html(ob[0].Mobile);
																	$("#UserInfoList_telephone").html(ob[0].Telephone);
																	$("#UserInfoList_address").html(ob[0].Address);
																	$("#UserInfoList_Birthday").html(ob[0].Birthday);
																	$("#UserInfoList_Diploma").html(ob[0].Diploma);
																	$("#UserInfoList_Http").html(ob[0].Http);
																	$("#UserInfoList_Interest").html(ob[0].Interest);
																	$("#UserInfoList_Info").html(ob[0].Info);
																	$("#UserInfoList_Profession").html(ob[0].Profession);
																	$("#myD2dBox_Integral").html(sumpersonintegral);
																	//是否有图片
																	if(parseInt(ob[0].isPhoto)==1)
																	{
																		var str='<img width="50"  src="/image/023/userinfo/logo/'+ob[0].UID+'.jpg"/>';
																		$("#UserInfoList_isphoto").html(str);
																	}
																	else
																	{
																		$("#UserInfoList_isphoto").html("无");
																	}
																					
																}
																} 
										});
								},	
						"my_xy":function()//显示我的信息
								{

									var url=phpbase+"/user/xy";;
									$.ajax({
										 type: "POST",
										 url: url,
										 data:"flag=my_self_infp",
										 success: function(msg){
										 eval("ob2=" +msg);
										 
										 if(ob2!=-1)
											 {
											 self_X=ob2[0].X;
											 self_Y=ob2[0].Y;
											 $("#X_temp").val(self_X);
											 $("#Y_temp").val(self_Y);
											 $("#X").val(self_X);
											 $("#Y").val(self_Y);
											 gocurapi({X:ob2[0].X,Y:ob2[0].Y});
											 }
										 }
										 });
								},							
					"rule_acc_buttion_time":function()//同意按扭的倒计时
								{
									var Num_temp=$("#rule_acc_buttion").attr("valueNum");
									Num_temp=parseInt(Num_temp);
										if(Num_temp==0)
										{
											$("#rule_acc_buttion").attr("disabled","");
											$("#rule_acc_buttion").val(" 同 意 ");
											clearTimeout(the_timeout);
										}
										else
										{
											Num_temp=parseInt(Num_temp)-1;
											//alert(Num_temp);
											$("#rule_acc_buttion").val("同意("+Num_temp+")");
											$("#rule_acc_buttion").attr("valueNum",Num_temp+"a");
											//alert($("#rule_acc_buttion").attr("valueNum"));
											the_timeout = setTimeout("useroperator.rule_acc_buttion_time();", 1000);
										}
								},			
					"ValidationName":function()
											{
												
												var str1=$("#loginname").val();
												var url='/libs/models/user/UserCenter.php';
												str1=str1.replace(/(^\s*)|(\s*$)/g, "");
												if(new String(str1).toString()==new String("").toString())//濡傛灉涓虹┖鍒欎笉鍘绘暟鎹煡璇㈡槸鍚﹂噸澶
												{
													$("#loginname").val("");
													$("#loginnameValidationMSG").html("");
													return false;
												}
												var cm = /[\\. <>;&,'?^#$*~%\+\|\(\)\{\}\[\]-]/ ;
												var text = str1 ;
												var result = text.match(cm) ;
												if (result != null){
													$("#loginnameValidationMSG").html("登陆名不能包含特殊字符！");
													return false;
												}
												if(new String(str1).length<3)
												{
													$("#loginnameValidationMSG").html("登陆名不能小于3个字符！");
													return false;
												}
												$.ajax({
														 type: "POST",
														 url: url,
														 data:  "loginname="+str1+"&flag=validatename",
														 success: function(msg){
																//alert(msg);
																 if(0==msg)
																 {
																 $("#loginnameValidationMSG").html(str1+"登陆名不可用！");
																 $("#loginname").val("");
																 }else
																 {
																	 $("#loginnameValidationMSG").html(str1+"登陆名可用！");
																	}
																 
															 } 
														}); 
											},
					"reg_message":function(msg)
						{//
							//alert(msg);
							//document.write(msg);
							if(new String(1).toString()==new String(parseInt(msg)).toString())//注册成功转入
								{
									alert("注册成功");
									$("#register").hide();
									$("#RegForm1").resetForm();
									//$("#functionBox").hide();
								}
								else//注册失败提示用户
								{ 	alert("注册失败");
									return 0;
								   try{ eval("ob=" +msg);} catch(e){}
								  if(ob){
									  
									  var strhtml="";
									  var i=1;
									 
										for (prop in ob)
										{   
											 strhtml=strhtml+""+i+ob[prop]+"";
											 i++;
										}
									}
								}
								
						},						
					"ValidationRegisterForm":function()
								{
									
									 $("#RegForm1").validate({

										rules: {
												
												loginname:{
															required:true
															//minLength: 2
														  },
												nickname:{
															required:true,
															checkstr:true,
															minLength: 2
														 },
												password1:{
															required:true,
															minLength: 6
														  },
												password2:{
															equalTo: "#password1",
															required:true
														  },		  
												email:{
														email:true,
														required:true,
														minLength: 2
													   },
												qq:{
													is_qq:true
													},
												mobile:{
														is_mobile:true
													},
												telephone:{
														is_phone:true
													},
												seccode:{
														required:true,
														equalTo: "#tempseccode"
														
													},
												reg_Birthday:{
																	dateISO:true
																},
												reg_Http:{
																url:true
																},
												reg_Diploma:{
																	checkstr:true
															},
												reg_Interest:{
																	checkstr:true
																},
												reg_Info:{
																checkstr:true
															},
												reg_Profession:{
																		checkstr:true
																	}
													
											},
									  messages: {
											loginname:{
														required:function(element, validator){return "登陆名不能为空!"}
														//minLength:function (element, validator){return "字符长度不能小2个!"}
													  },
											nickname:{
														required:function(element, validator){return "昵名不能为空!"},
														minLength:function (element, validator){return "字符长度不能小2个!"},
														checkstr:"昵名不能包含特殊字符！"
													 },
											password1:{
														required:function(element, validator){return "密码不能为空!"}	,
														minLength:function (element, validator){return "字符长度不能小6个!"}
													  },
											password2:{
														equalTo:function(element, validator){return "两次密码不一致!"},
														required:function(element, validator){return "确认密码不能为空!"}
													  },		  
											email:{
													  email:function(element, validator){return "请输入正确的邮件地址!"},
													  minLength:function (element, validator){return "字符长度不能小2个!"},
													  required:function (element, validator){return "电子邮件不能为空!"}
												   },
											qq:{
													is_qq:"请输入正确的QQ号码!"
												},
											mobile:{
													is_mobile:"请输入正确的手机号码!"
												},
											telephone:{
													is_phone:"请输入正确定的电话号码!"
												},
											seccode:{
													required:"验证码不能为空!",
													equalTo:"验证码错误!"
												},
											reg_Birthday:{
																	dateISO:"请输入正确的日期,格式为1986-05-09"
																},
											reg_Http:{
																url:"请输入正确的URL"
																},
											reg_Diploma:{
																	checkstr:"不能输入特殊字符"
															},
											reg_Interest:{
																	checkstr:"不能输入特殊字符"
																},
											reg_Info:{
																checkstr:"不能输入特殊字符"
															},
											reg_Profession:{
																		checkstr:"不能输入特殊字符"
																	}	
										  }
									});
								},
					"ValidationCodeRegister":function()
								{
								var url='/libs/models/user/UserCenter.php';
								$.ajax({
										 type: "POST",
										 url: url,
										 data:  "flag=ValidationCodeRegister",
										 success: function(msg){
											 var html="<img   width=60 height=20 src=/testImage.php?code="+msg+"></img>";
													//alert(html);
											$("#authnumcodeImage").html(html);
											$("#tempseccode").val(msg);
											 } 
										}); 
								
								},			
					"showdiv":function(type)//根据页面的类型显示对应的层,并调用对应的方法
										{
											
											switch (type) {
	
																   case "login" :
																	   		$("#loginBar").css("display","");
																			//useroperator.formcheck();
																			break;
																   case "logout":
																   			;break;
																   case "reg":
																   			$("#register").css("display","");break;
																}	
										},
					"formcheck":function(){			
										$("#loginForm").validate({
															   submitHandler: function() {
																				useroperator.Login();
																			},
																	rules: {
																			userName:{
																						required:true,
																						minLength: 2
																					 },
																			password:{
																							required:true
																						}
																		},
															  messages: {
																			userName:{
																					required:'<span   class=" color_6">用户名不能为空!</span>',
																					minLength:'<span   class=" color_6">字符长度不能小2个!</span>'
																					 },
																			password:{
																					required:'<span   class=" color_6">密码不能为空！</span>'
																				}
																	  }
													});
										},
				  "Login":function(){
					  				var userName=$("#userName").val(); 
									var passWord=$("#password").val(); 
									var CookieBoole=$("#CookieYN").attr('checked')==undefined?0:1
									var url='/libs/models/user/UserCenter.php';
								//	var strhtml='libs/models/user/UserCenter.php';
									var key;
									$.ajax({
											type: "POST",
											url: url,
											data:  "Username="+userName+"&Password="+passWord+"&cooKie="+CookieBoole+"&flag=logn",
											success: function(msg){
												//alert(msg);
											var ob;
											try{ eval("ob=" +msg);} catch(e){}
											if(ob){
												if(ob.action=="ok")
												{
													$("#logn_quit").show();
													try{ eval("FW=" + ob.json); } catch(e){}
													$("#banner_UID").val(FW.UID);
													//alert(FW.UID);
													$("#ViewuserName").html(FW.Truename);
													$("#viewLogn_a").hide();
													$("#loginBar").hide();
													//alert("登陆成功!");
													useroperator.my_xy();
													$("#functionBlock").hide();
													//同步论坛
													bbs_syn.Login(passWord);
													$("#loginForm").resetForm();
													
													//		
													$("#set_mapnotesdot").hide();
													$("#mapnotesdot").show();
													return 0;
												
												}else{
													alert("登陆失败!");
													return 0;
												for(key in ob)
												{
													
												if(ob[key]!='no')	alert(ob[key]);$("#Name").focus();
												}
												}
											}
																	
																  } 
										});
									
									},
					"Logout":function(){
										// url:/user/logout
											$("#ViewuserName").html("游客");
											$("#viewLogn_a").show();
											//return 0;
											var userName=$("#userName").val(); 

											var passWord=$("#password").val(); 
											var url='/libs/models/user/UserCenter.php';
											var strhtml='';
											var key;
											$.ajax({
												 type: "POST",
												 url: url,
												 data:   "flag=quit",
												 success: function(msg){ 
												 							$("#banner_UID").val("");
												 							//alert( "Data Saved: " +   msg );
																			//论坛同步
																			bbs_syn.Logout();
																			/////////////												 							
																			} 
												}); 
									},
					"city_area":function()//区域选择的控制
									{
										var url='/libs/models/user/UserCenter.php';
										
											$.ajax({
												 type: "POST",
												 url: url,
												 data:   "flag=city_area&city="+$("#city").val(),
												 success: function(msg){ 	//alert(msg);
												 							if(msg==-1)
																			{
																				alert("错误：目前还没有此数据库");
																				$("#area").html('<option value="">请选择</option>');
																				return 0;
																			}
												 							
												 							try{ eval("ob=" +msg);} catch(e){}
																			var temp_str="";
																			if(ob){
																					for(i=0;i<ob.length;i++)
																					{
																						temp_str+='<option value="'+ob[i].ID+'">'+ob[i].Name+'</option>';
																					}
																				  }
																			if(temp_str!="")
																					{
																						$("#area").html(temp_str);
																					}
																				else
																				{
																					alert("错误："+msg);
																				}
																		} 
												});
									}
				 };
				 
var userhouse={"houselist":function(page,key)//用户房源
							{
							if (page==null||page==0) page=1;
							if (key==null) key=-1;
							var url=phpbase+"/house/Pagination";
							var strhtml='';
							var i=0;
							$.ajax({
						 			type: "POST",
						 			url: url,
						 			data: "page="+page+"&type=9&action="+key,
								    success: function(msg){
									//alert(msg);
									if(msg==-1)
									{									
									strhtml=strhtml+'<tr bgcolor="#EAEAEA"><th width="40" align="center">选择</th><th width="40">类型</th><th>物业</th><th width="40">时间</th><th width="40">修改</th><th width="40">删除</th></tr>';
										strhtml=strhtml+'<tr ><th width="40" align="center"></th><th width="40"></th><th><BR>抱歉,没有找到相关的内容<BR><BR></th><th width="40"></th><th width="40"></th><th width="40"></th></tr>';
										$("#myd2dhouselist").html(strhtml);//把数据加载到页0页
										$("#myhouselistpagemore").hide();
									return;
									}else
									{
										$("#myhouselistpagemore").show();
									}
									var ob;
									var ob0;
									var Name="";
									try{eval("ob=" +msg);} catch(e){}
									if(ob){
									pageinfo=ob['pageinfo'];
									contents=ob['contents'];
									page=ob['pageinfo']['pagenow'];	
														
									strhtml='<tr bgcolor="#EAEAEA"><th width="40" align="center">选择</th><th width="40">类型</th><th>物业</th><th width="40">时间</th><th width="40">修改</th><th width="40">删除</th></tr>';
									for(counter=contents.length;i<counter;i++)//分解JSON数据
									{
												strhtml=strhtml+'<tr><td align="center"><input name="" type="checkbox" value="" class="f12"/></td><td align="center">'+contents[i].TypeName+'</td><td><a href="javascript:void(0);" onclick=\'posinfoapi('+contents[i].JosnValue+');\'">'+contents[i].Title+contents[i].Structure+'</a></td> <td align="center">'+contents[i].FTime+'</td>';
						                        strhtml=strhtml+' <td align="center">[<a href="'+phpbase+'/house/Modify/'+contents[i].HouseID+'"  target="_blank">修改</a>]</td>';
						                        strhtml=strhtml+'<td align="center">[<a href="javascript:void(0);" onclick="userhouse.housedelete('+contents[i].HouseID+')">删除</a>]</td></tr>';
												}
									pagecount=ob['pageinfo']['pagecount'];
									$("#leaseToPage").show();

									$("#myhouselisttotalPage").text('共'+pagecount+'页');
									$("#myd2dhouselist").html(strhtml);//把数据加载到页0页
																//$("#YPMore").focus();
									$("#myhouselistupdataup").unbind();
									$("#myhouselistnextdataup").unbind();
									$("#myhouselistupdataup").bind("click", function() {userhouse.houselist(parseInt(page)-1)});
									$("#myhouselistnextdataup").bind("click", function() {userhouse.houselist(parseInt(page)+1)});
									var curPages=$("#myhouselistcurPageSpan");
									option='<select id="myhouselistcurPage" onchange="userhouse.houselist($(this).val())" name="curPage" class="f12">';
									for (i=1; i<=pagecount; i++){
										if (i==page){
												option=option+'<option value="'+i+'"  selected="selected">'+i+'页</option>';
											}else{
													option=option+'<option value="'+i+'">'+i+'页</option>';
												}
													}
																
												curPages.html(option);
												}
														  } 
								});
							url=phpbase+"/house/FreshLimit";
							$.ajax({
						 			type: "POST",
						 			url: url,
						 			data: "",
								    success: function(msg){
										if( msg == -1 || msg == "" )
										{									
											return;
										}else
										{
											$("#myesflimit").html(msg);
											$("#myesflimit").show();
										}
									} 
								});								
							},
				"housedelete":function(id)//删除房源
				{
					var url=phpbase+"/house/deleteid";
					var strhtml='';
					var i=0;
					$.ajax({
						type: "POST",
						url: url,
						data: "id="+id,
					    success: function(msg){
							var ob;
							var ob0;
							var Name="";
							try{eval("ob=" +msg);} catch(e){}							
							if(ob.action=="Yes")
							{
								alert(ob.info);
								userhouse.houselist();
							}else if(ob.action=="no")
							{
								alert(ob.info);
							}else
							{
								alert('操作失败，请重试！');
							}
						}
						});
				}
			  };
/*********************************
描述:小地图搜索功能,用户输入值搜索
作者:zky
日期:2008-1-12
版本:1.0
**********************************/
function miniBoxSearch(page)
{
if (page==null||page==0) page=1;

	var YPSearchBoxSearchname=$("#miniBoxSmallmap").val(); 
	//alert(YPSearchBoxSearchname);
	var url=phpbase+"/yellowpage/Search";
	var strhtml='';
	var ahtml='';
	if (YPSearchBoxSearchname=="")
	{
										strhtml='<BR>抱歉您没有输入搜索信息，请输入搜索信息再试<BR><BR>';
										$("#miniBoxSmallmapTitle").html(strhtml);
										$("#miniBoxYPMorePage").hide();	
	}
	if(new String("").toString()==new String($.trim(YPSearchBoxSearchname)).toString())
		return false;
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "value="+YPSearchBoxSearchname+"&typeid=10&page="+page,
 			success: function(msg){
									var ob;
									var ob0;
									try{ eval("ob=" +msg);} catch(e){}
									//alert(msg);
									if(msg==-1 || ob['contents']==-1){
										strhtml='<li><span><BR>抱歉，本站没有找到与'+$("#miniBoxSmallmap").val()+' 相关的内容<BR><BR></span></li>';
										$("#miniBoxSmallmapTitle").html(strhtml);
										$("#miniBoxYPMorePage").hide();
										//return;
										}else
										{
										$("#miniBoxYPMorePage").show();						
										}
										if(ob['AIS'].length>0)
										{
												var acontent=ob['AIS'];
												ahtml="<li class='f14 list_h24'><span>您可以尝试使用智能搜索以下为您提供的快速搜索关键字进行搜索！</span></li><BR>";
												for(i=0,icount=acontent.length;i<icount;i++)
												{
													var strname=acontent[i].toString();
													ahtml=ahtml+'<li class="f14 list_h24"><span><a href="Javascript:" onclick=\'miniBoxMapSearchAI(0,"'+strname+'");\'>'+strname+'</a></span></li>';
												}
											$("#miniBoxSmallmapTitleAI").html(ahtml);	
										}else
										{
											$("#miniBoxSmallmapTitleAI").html(' ');
										}
																				
									if(ob){
										//alert(ob['Content'].contents[0].Name);
										pageinfo=ob['pageinfo'];
										contents=ob['contents'];
										strhtml='<ul>';
											for(i=0, counter=contents.length;i<counter;i++)//分解JSON数据
											{
			
                            strhtml=strhtml+'<li ><span><a href="javascript:void(0);"  onclick=\'showgetpospic('+contents[i].JosnValue+',"searchgo");\'  title='+contents[i].Titles+'>['+contents[i].typenamne+']·'+contents[i].Title+'</a></span></li>';
											}
										strhtml=strhtml+'</ul>';	
											//alert(strhtml);
											pagecount=pageinfo.pagecount;
											$("#miniBoxtotalPage").text('共'+pagecount+'页');
											//$("#SearcCount").text(pageinfo.count);
											page=pageinfo.pagenow;
											$("#miniBoxSmallmapTitle").html(strhtml);//把数据加载到页0页
											/****/
											$("#miniBoxupdataup").unbind();
											$("#miniBoxnextdataup").unbind();
											$("#miniBoxupdataup").bind("click", function() {miniBoxSearch(parseInt(page)-1)});
											$("#miniBoxnextdataup").bind("click", function() {miniBoxSearch(parseInt(page)+1)});
											
											//alert(page);
											var curPage=$("#miniBoxcurPageSpan");						
											//$("#curPage").remove();
											option='<select id="miniBoxcurPage" onchange="miniBoxSearch($(this).val())" name="curPage" class="f12">';
											for (i=1; i<=pagecount; i++){
												if (i==page){
													option=option+'<option value="'+i+'"  selected="selected">'+i+'页</option>';
												}else{
													option=option+'<option value="'+i+'">'+i+'页</option>';
												}
											}
											//alert(option);
											curPage.html(option);

											
									}
									
									
								  } 
		});
}
/*********************************
描述:小地图搜索功能,用户输入值搜索
作者:zky
日期:2008-1-12
版本:1.0
**********************************/
function jucheminiBoxSearch(page)
{
if (page==null||page==0) page=1;

	var YPSearchBoxSearchname=$("#miniBoxSmallmaps_zzd").val(); 
	//alert(YPSearchBoxSearchname);
	var url=phpbase+"/yellowpage/Search";
	var strhtml='';
	var ahtml='';
	if (YPSearchBoxSearchname=="")
	{
										strhtml='<BR>抱歉您没有输入搜索信息，请输入搜索信息再试<BR><BR>';
										$("#zzd_miniBoxSmallmapTitle").html(strhtml);
										$("#zzd_miniBoxYPMorePage").hide();	
	}
	if(new String("").toString()==new String($.trim(YPSearchBoxSearchname)).toString())
		return false;
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "value="+YPSearchBoxSearchname+"&typeid=10&page="+page,
 			success: function(msg){
									var ob;
									var ob0;
									try{ eval("ob=" +msg);} catch(e){}
									//alert(msg);
									if(msg==-1 || ob['contents']==-1){
										strhtml='<li><span><BR>抱歉，本站没有找到与'+$("#miniBoxSmallmap").val()+' 相关的内容<BR><BR></span></li>';
										$("#zzd_miniBoxSmallmapTitle").html(strhtml);
										$("#zzd_miniBoxYPMorePage").hide();
										//return;
										}else
										{
										$("#zzd_miniBoxYPMorePage").show();						
										}
										if(ob['AIS'].length>0)
										{
												var acontent=ob['AIS'];
												ahtml="<li class='f14 list_h24'><span>您可以尝试使用智能搜索以下为您提供的快速搜索关键字进行搜索！</span></li><BR>";
												for(i=0,icount=acontent.length;i<icount;i++)
												{
													var strname=acontent[i].toString();
													ahtml=ahtml+'<li class="f14 list_h24"><span><a href="Javascript:" onclick=\'miniBoxMapSearchAI(0,"'+strname+'");\'>'+strname+'</a></span></li>';
												}
											$("#zzd_miniBoxSmallmapTitleAI").html(ahtml);	
										}else
										{
											$("#zzd_miniBoxSmallmapTitleAI").html(' ');
										}
																				
									if(ob){
										//alert(ob['Content'].contents[0].Name);
										pageinfo=ob['pageinfo'];
										contents=ob['contents'];
										strhtml='<ul>';
											for(i=0, counter=contents.length;i<counter;i++)//分解JSON数据
											{
			
                            strhtml=strhtml+'<li ><span><a href="javascript:void(0);"  onclick=\'showgetpospic('+contents[i].JosnValue+',"searchgo");\'  title='+contents[i].Titles+'>['+contents[i].typenamne+']·'+contents[i].Title+'</a></span></li>';
											}
										strhtml=strhtml+'</ul>';	
											//alert(strhtml);
											pagecount=pageinfo.pagecount;
											$("#zzd_miniBoxtotalPage").text('共'+pagecount+'页');
											//$("#SearcCount").text(pageinfo.count);
											page=pageinfo.pagenow;
											$("#zzd_miniBoxSmallmapTitle").html(strhtml);//把数据加载到页0页
											/****/
											$("#zzd_miniBoxupdataup").unbind();
											$("#zzd_miniBoxnextdataup").unbind();
											$("#zzd_miniBoxupdataup").bind("click", function() {jucheminiBoxSearch(parseInt(page)-1)});
											$("#zzd_miniBoxnextdataup").bind("click", function() {jucheminiBoxSearch(parseInt(page)+1)});
											
											//alert(page);
											var curPage=$("#zzd_miniBoxcurPageSpan");						
											//$("#curPage").remove();
											option='<select id="miniBoxcurPage" onchange="jucheminiBoxSearch($(this).val())" name="curPage" class="f12">';
											for (i=1; i<=pagecount; i++){
												if (i==page){
													option=option+'<option value="'+i+'"  selected="selected">'+i+'页</option>';
												}else{
													option=option+'<option value="'+i+'">'+i+'页</option>';
												}
											}
											//alert(option);
											curPage.html(option);

											
									}
									
									
								  } 
		});
}

function miniBoxMapSearchAI(page,Data)
{	//alert(page);
	if (page==null||page==0) page=1;
	var url=phpbase+"/yellowpage/Search";
	var strhtml='';
	var ahtml="";
	//alert(url);
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "value="+Data+"&typeid=12&page="+page,
 			success: function(msg){
			//alert(msg);
									var ob;
									var ob0;
									if(msg==-1)
									{
										
										strhtml='<li><span><BR>抱歉，本站没有找到与'+$("#BS_Write").val()+' 相关的内容<BR><BR></span></li>';
										$("#miniBoxSmallmapTitle").html(strhtml);
										$("#miniBoxYPMorePage").hide();									
									}
									else
									{
									$("#miniBoxYPMorePage").show()
									}
									try{ eval("ob=" +msg);} catch(e){}

												//var acontent=ob;
										pageinfo=ob['pageinfo'];
										contents=ob['contents'];	
										strhtml=strhtml+'</ul><ul>';
												for(i=0,icount=contents.length;i<icount;i++)
												{
                            strhtml=strhtml+'<li><span><a href="javascript:void(0);"  onclick=\'posinfoapi('+contents[i].JosnValue+');\'  title='+contents[i].Titles+'>['+contents[i].typenamne+']·'+contents[i].Title+'</a></span></li>';
													}
											strhtml=strhtml+'</ul>';
											pagecount=pageinfo.pagecount;
											$("#miniBoxtotalPage").text('共'+pagecount+'页');
											//$("#miniBoxCount").text(pageinfo.count);
											page=pageinfo.pagenow;
											$("#miniBoxSmallmapTitle").html(strhtml);//把数据加载到页0页
											/****/
											$("#miniBoxupdataup").unbind();
											$("#miniBoxnextdataup").unbind();
											$("#miniBoxupdataup").bind("click", function() {miniBoxMapSearchAI(parseInt(page)-1,Data)});
											$("#miniBoxnextdataup").bind("click", function() {miniBoxMapSearchAI(parseInt(page)+1,Data)});
											
											//alert(page);
											var curPage=$("#miniBoxcurPageSpan");						
											//$("#curPage").remove();
											option='<select id="miniBoxcurPage" onchange="miniBoxMapSearchAI($(this).val(),'+Data+')" name="curPage" class="f12">';
											for (i=1; i<=pagecount; i++){
												if (i==page){
													option=option+'<option value="'+i+'"  selected="selected">'+i+'页</option>';
												}else{
													option=option+'<option value="'+i+'">'+i+'页</option>';
												}
											}
											//alert(option);
											curPage.html(option);
																	
								  }
			})
}			  




//论坛同步对象
var bbs_syn={Login:function(pwd)
									 {						
										var url='http://'+window.location.hostname+'/libs/models/user/synch_dz_lib.php';
										var get=window.location.search;
										var f_key='forward=';
										eval('var ptn=/'+f_key+'/i');
										var fwd_st=get.search(ptn);
										var fwd=fwd_st==-1? '' : '&forward='+encodeURIComponent(get.substr(fwd_st+f_key.length));
									 	$.ajax({
														type: "POST",
														url: url,
														data: 'norefresh=1&pwd='+pwd+'&action=login'+fwd,
														success: function(msg)
														{
															//alert(123);
														//	alert(msg);
														//	eval("var msg="+msg);
														 //	window.location=msg.loc;
														}
													 }
													)
									 },						
						Logout:function()
									 {
										var url='http://'+window.location.hostname+'/libs/models/user/synch_dz_lib.php';
										var get=window.location.search;
										var f_key='forward=';
										eval('var ptn=/'+f_key+'/i');
										var fwd_st=get.search(ptn);
										var fwd=fwd_st==-1? '' : '&forward='+encodeURIComponent(get.substr(fwd_st+f_key.length));
									 	$.ajax({
														type: "POST",
														url: url,
														data: 'norefresh=1&action=logout'+fwd,
														success: function(msg)
														{
														//	eval("var msg="+msg);
														// 	window.location=msg.loc;
														}
													 }
													)
									 }
}