function ccfnw_news_comment(z) {
	var username = $("#username1").val();
    var password = $("#password1").val();
	var comment = $("#comment").val();
	var classid = $("#classid").val();
	var id = $("#id").val();
	var all = $("#all").val();
	var fname = $('input[name=fname][@type=checkbox][@checked]').val(); 
	//alert(fname);
    $.ajax({
          url: "/ajax/comment.php",
	      type:"post", 
		  dataType:"text", 
          data: "username="+username+
			    "&password="+password+
			    "&comment="+comment+
			    "&classid="+classid+
			    "&id="+id+
			    "&all="+all+
			    "&fname="+fname+"",
		  beforeSend: function(){
              tb_show('新增评论','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.reload();
			  }
			  //tb_remove();
              //alert( "Data Saved: " + msg);
			  //tb_remove();
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
		  ///complete : function(){
			  //alert("该用户名不可用，请更换用户名")
		  //}
	});
}

function ccfnw_userinfo_add(z) {
	var aname = $("#aname").val();
    var bname = $("#bname").val();
	var sex = $("#sex").val();
	var odate = $("#odate").val();
	var atplace = $("#atplace").val();
	var married = $("#married").val();
	var education = $("#education").val();
	var jobtype = $("#jobtype").val();
	var sallary = $("#sallary").val();
	var email = $("#email").val();
	var tel = $("#tel").val();
	var icq = $("#icq").val();
	var qq = $("#qq").val();
	var msn = $("#msn").val();
	var zip = $("#zip").val();
	var insurcom = $("#insurcom").val();
	var scontent = $("#scontent").val();
    $.ajax({
          url: "/ajax/userinfo.php",
	      type:"post", 
		  dataType:"text", 
          data: "aname="+aname+
			    "&bname="+bname+
			    "&sex="+sex+
			    "&odate="+odate+
			    "&atplace="+atplace+
			    "&married="+married+
			    "&education="+education+
			    "&jobtype="+jobtype+
			    "&sallary="+sallary+
			    "&email="+email+
			    "&tel="+tel+
			    "&icq="+icq+
			    "&qq="+qq+
			    "&msn="+msn+
			    "&zip="+zip+
			    "&insurcom="+insurcom+
			    "&scontent="+scontent+"",
		  beforeSend: function(){
              tb_show('处理个人停息','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
			  //$("#ook").html("<img src=\"/images/loading.gif\">数据正在提交...");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
			  //tb_remove();
              //alert( "Data Saved: " + msg);
			  //tb_remove();
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
		  ///complete : function(){
			  //alert("该用户名不可用，请更换用户名")
		  //}
	});
}

function ccfnw_user_apply_eco(z) {
	var content = $("#content").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/apply_eco.php",
	      type:"post", 
		  dataType:"text", 
          data: "content="+content+"",
		  beforeSend: function(){
              tb_show('申请成为经济学专家','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  //if (update[1]=="login")
			  //{
				//location.href=update[2];
			  //}
			  //tb_remove();
              //alert( "Data Saved: " + msg);
			  //tb_remove();
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
		  ///complete : function(){
			  //alert("该用户名不可用，请更换用户名")
		  //}
	});
}


function ccfnw_user_point(z) {
	var newstitle = $("#newstitle").val();
	var blogclass = $("#blogclass").val();
	var writer = $("#writer").val();
	var classid = $("#classid").val();
	var pid = $("#pid").val();
	var isjj = $("#isjj").val();
	var content = FCKeditorAPI.GetInstance('content').GetXHTML(); //$("#content").val();
	//alert(content);
    $.ajax({
          url: "/ajax/point.php?action=addedit",
	      type:"post", 
		  dataType:"text", 
          data: "newstitle="+newstitle+
			    "&blogclass="+blogclass+
			    "&writer="+writer+
			    "&classid="+classid+
			    "&pid="+pid+
			    "&isjj="+isjj+
			    "&content="+encodeURIComponent(content)+"",
		  beforeSend: function(){
              tb_show('发布修改观点','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_user_point_del(z) {
    $.ajax({
          url: "/ajax/point.php?action=del",
	      type:"post", 
		  dataType:"text", 
          data: "pid="+z+"",
		  beforeSend: function(){
              tb_show('删除观点','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_user_house(z) {
	var isjj = $("#isjj").val();
	var nid = $("#nid").val();
	var price = $("#price").val();
	var timeout = $("#timeout").val();
	var cityid = $("#cityid").val();
	var pcode = $("#pcode").val();
	var mainsection = $("#mainsection").val();
	var housetypeid = $("#housetypeid").val();
	var housestyleid = $("#housestyleid").val();

	var contactname = $("#contactname").val();
	var contactphone1 = $("#contactphone1").val();
	var contactphone1_ext = $("#contactphone1_ext").val();
	var contactphone2 = $("#contactphone2").val();
	var contactphone2_ext = $("#contactphone2_ext").val();
	var contactemail = $("#contactemail").val();
	var houseaddress = $("#houseaddress").val();
	var content = FCKeditorAPI.GetInstance('content').GetXHTML(); //$("#content").val();

	var bedroom = $("#bedroom").val();
	var washroom = $("#washroom").val();
	var kitchen = $("#kitchen").val();
	var lotsize = $("#lotsize").val();
	var houseage = $("#houseage").val();
	var tax = $("#tax").val();
	var basement = $('input[name=basement][@type=radio][@checked]').val();
	var basementoptions = $("#basementoptions").val();
	var basementoptions2 = $('input[name=basementoptionse][@type=checkbox][@checked]').val();
	var adminfee = $("#adminfee").val();
	var fee_water = $('input[name=water][@type=checkbox][@checked]').val();
	var fee_electric = $('input[name=electric][@type=checkbox][@checked]').val();
	var fee_gas = $('input[name=gas][@type=checkbox][@checked]').val();
	var fee_cable = $('input[name=cable][@type=checkbox][@checked]').val();
	alert(fee_cable);
    $.ajax({
          url: "/ajax/house.php?action=addedit",
	      type:"post", 
		  dataType:"text", 
          data: "isjj="+isjj+
			    "&nid="+nid+
			    "&price="+price+
			    "&timeout="+timeout+
			    "&cityid="+cityid+
			    "&pcode="+pcode+
			    "&mainsection="+mainsection+
			    "&housetypeid="+housetypeid+
			    "&housestyleid="+housestyleid+
			    "&contactname="+contactname+
			    "&contactphone1="+contactphone1+
			    "&contactphone1_ext="+contactphone1_ext+
			    "&contactphone2="+contactphone2+
			    "&contactphone2_ext="+contactphone2_ext+
			    "&contactemail="+contactemail+
			    "&houseaddress="+houseaddress+
			    "&bedroom="+bedroom+
			    "&washroom="+washroom+
			    "&kitchen="+kitchen+
			    "&lotsize="+lotsize+
			    "&houseage="+houseage+
			    "&tax="+tax+
			    "&basement="+basement+
			    "&basementoptions="+basementoptions+
			    "&basementoptions2="+basementoptions2+
			    "&adminfee="+adminfee+
			    "&fee_water="+fee_water+
			    "&fee_electric="+fee_electric+
			    "&fee_gas="+fee_gas+
			    "&fee_cable="+fee_cable+
			    "&content="+encodeURIComponent(content)+"",
		  beforeSend: function(){
              tb_show('发布修改房屋中介信息','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_house_img_del(z) {
    $.ajax({
          url: "/ajax/houseimgdel.php?action=a",
	      type:"post", 
		  dataType:"text", 
          data: "id="+z+"",
		  beforeSend: function(){
              tb_show('删除图片','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_house_img_del(z) {
    $.ajax({
          url: "/ajax/houseimgdel.php?action=b",
	      type:"post", 
		  dataType:"text", 
          data: "id="+z+"",
		  beforeSend: function(){
              tb_show('删除房产','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_house_fav(z) {
    $.ajax({
          url: "/ajax/housefav.php?action=add",
	      type:"post", 
		  dataType:"text", 
          data: "nid="+z+"",
		  beforeSend: function(){
              tb_show('收藏中介房屋','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_house_fav_del(z) {
    $.ajax({
          url: "/ajax/housefav.php?action=del",
	      type:"post", 
		  dataType:"text", 
          data: "nid="+z+"",
		  beforeSend: function(){
              tb_show('删除收藏中介房屋','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_north_american_search(z) {
    var northid = $("#northid").val();
	if(northid!=""){
			window.open('http://ca.finance.yahoo.com/q?s='+northid+'');
		}else{
			alert('请选择北美股市！');
			return false;
		}
}

function ccfnw_stock_user(z) {
	var reguser = $("#reguser").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/apply_stock_user.php",
	      type:"post", 
		  dataType:"text", 
          data: "reguser="+reguser+"",
		  beforeSend: function(){
              tb_show('申请开设股票户头','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.reload();
			  }
          },
		  error:function(){
			  tb_remove();
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_stock_buy(z) {
	var stockid = $("#stockid").val();
	var sections = $("#sections").val();
	var stockcode = $("#stockcode").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/apply_stock_buy.php",
	      type:"post", 
		  dataType:"text", 
          data: "stockid="+stockid+
			    "&sections="+sections+
			    "&stockcode="+stockcode+"",
		  beforeSend: function(){
              tb_show('申请开设股票户头','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  tb_remove();
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_stock_sale(z) {
	var stockid = $("#stockid").val();
	var sections = $("#sections").val();
	var stockcode = $("#stockcode").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/apply_stock_sale.php",
	      type:"post", 
		  dataType:"text", 
          data: "stockid="+stockid+
			    "&sections="+sections+
			    "&stockcode="+stockcode+"",
		  beforeSend: function(){
              tb_show('申请开设股票户头','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.href=update[2];
			  }
          },
		  error:function(){
			  tb_remove();
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}

function ccfnw_stock_list(z) {
    var stockid = $("#stockid").val();
	if(stockid!=0){
			location.href='/user/mystock.php?stockid='+stockid+'';
	}
}

function ccfnw_insurance_life(z) {
	var state = $("#state").val();
    var category = $("#category").val();
	var faceamount = $("#faceamount").val();
	var sex = $("#sex").val();
	var smoker = $("#smoker").val();
	var health = $("#health").val();
	var birthday = $("#birthday").val();
	var birthmonth = $("#birthmonth").val();
	var birthyear = $("#birthyear").val();
	var modeused = $("#modeused").val();
	var firstname = $("#firstname").val();
	var lastname = $("#lastname").val();
	var telephone = $("#telephone").val();
	var tocall = $("#tocall").val();
	var email = $("#email").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/add_insurance_life.php",
	      type:"post", 
		  dataType:"text", 
          data: "state="+state+
			    "&category="+category+
			    "&faceamount="+faceamount+
			    "&sex="+sex+
			    "&smoker="+smoker+
			    "&health="+health+
			    "&birthday="+birthday+
			    "&birthmonth="+birthmonth+
			    "&birthyear="+birthyear+
			    "&modeused="+modeused+
			    "&firstname="+firstname+
			    "&lastname="+lastname+
			    "&telephone="+telephone+
			    "&tocall="+tocall+
			    "&email="+email+"",
		  beforeSend: function(){
              tb_show('add life insurance','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
			  if (update[1]=="login")
			  {
				location.reload();
			  }
          },
		  error:function(){
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
	});
}


function ccfnw_dingyue() {
	var dymail = $("#dymail").val();
	//alert(fname);
    $.ajax({
          url: "/ajax/dymail.php",
	      type:"post", 
		  dataType:"text", 
          data: "dymail="+dymail+"",
		  beforeSend: function(){
              tb_show('订阅本站的邮件新闻','/ajax/1.php?height=100&amp;width=200&t=处理中',"thickbox");
          },
          success: function(msg){
			  tb_remove();
			  update = msg.split('|');
			  alert(update[0]);
          },
		  error:function(){
			  tb_remove();
			  alert("服务器没有返回数据，可能服务器忙，请重试")
		  }
		  ///complete : function(){
			  //alert("该用户名不可用，请更换用户名")
		  //}
	});
}
