
//金额千位格式化
 function number_format(s){
         if(/[^0-9\.\-]/.test(s)) return "invalid value";
         s=s.replace(/^(\d*)$/,"$1.");
         s=(s+"").replace(/(\d*\.\d\d)\d*/,"$1");
         s=s.replace(".",",");
        var re=/(\d)(\d{3},)/;
        while(re.test(s))
                s=s.replace(re,"$1,$2");
        s=s.replace(/,(\d\d)$/,".$1");
       return s.replace(/^\./,"0.").replace(/.$/,"")
 }
 function checkvalue(obj,fenshu){      obj.value = obj.value.replace(/[^\d]/g, '');	  if (obj.value == 0)		obj.value = "";	  if(obj.value>parseInt(fenshu)){	       obj.value=fenshu;	  } } function sumMoney(obj) {	obj.value = obj.value.replace(/[^\d]/g, '');	if (obj.value == "")		return;}
function zOpen(url){
      var diag = new Dialog("Diag2");
      diag.Width = 500;
      diag.Height = 300;
      diag.Title = "查看号码";
      diag.URL = url;
      //diag.OKEvent = zAlert;//点击确定后调用的方法
      diag.show();
}

//点击确定后调用的方法
function zAlert(){
  //Dialog.alert("滤爸要来了，河谐你，河谐我，河谐二十一世纪的新一代");
}  function getGoucaihemaifangan() {	var xmlHttp = this.xmlHttp;	if (xmlHttp.readyState == 4) {		if (xmlHttp.status == 200) {		   var json = eval("(" + xmlHttp.responseText + ")");			if (json.result != "0000") {				if ("list_size_0" == json.result)					return;				return;			}			 			var s="";			s+="<table width='100%'height='100%' cellspacing='1'  cellpadding='1'><tbody align='center'>";			s+="<tr class='' height='26' valign='middle'>";		    s+="<td width='80' align='right'>彩种  </td><td width='50'>  期数  </td><td width='120'>发起人</td> <td width='40'>方案</td> <td width='80'>总金额</td> <td width='70'>	进度 </td> <td width='70'>剩余份数</td> <td width='60'>保底份数</td> <td width='85'>认购份数</td> <td width='61'>购买</td> ";		    s+="</tr>"      			for (var i = 0;i < json.items.length; i++) {		 				    s += (i % 2) ? "<tr height='25' align='center' valign='middle'>" : "<tr height='27' align='center' valign='middle'  class='bg_bule'>";				s+="<td width='80'><img src='images/left_gendan_tb2.gif'>"+" "+json.items[i].lotname+"</td>";				s+="<td width='50'>"+json.items[i].issue+"</td>";				s+="<td width='120' style='overflow: hidden'>"+json.items[i].faqiren+"</td>";
				s+="<td width='40'> <a style='cursor :hand' onclick=zOpen('"+document.getElementById('path').value+"/Letousky/vote/ssq/join/ballNumberView.jsp?manner="+json.items[i].manner+"&lotName="+json.items[i].lot+"&chipinNums="+json.items[i].baodifenshu+"')> <img src='images/left_gendan_fdj.gif'/> </a> </td>";				// s+="<td width='40'><a  target='_blank' href="+document.getElementById('path').value+"/Letousky/vote/ssq/join/ballNumberView.jsp?manner="+json.items[i].manner+"&lotName="+json.items[i].lot+"&chipinNums="+json.items[i].baodifenshu+"><img src='images/left_gendan_fdj.gif'><a/></td>";				s+="<td width='80' style='text-align: right; color:red'>"+"￥"+json.items[i].zongjinger+"</td>";			    s+="<td width='70' style='text-align: right'>  "+json.items[i].jindu+'%'+"</td>";				s+="<td width='70'>"+json.items[i].shenyufenshu +"</td>";				s+="<td width='60'>"+json.items[i].fanan +"</td>";				s+="<td width='85' align='center'><input size='7' height='27' type='test' id='"+i+"' onblur='checkvalue(this,"+json.items[i].shenyufenshu+");'/></td>";				s+="<td width='61'><a style='cursor :hand' onclick=submit('"+json.items[i].lot+"','"+json.items[i].issue+"','"+ json.items[i].serialNo.toString()+"','"+i+"');>购买</a></td>";				s+="</tr>";		    			}			 s+="</tbody><table>"			 document.getElementById("hemailist_1").innerHTML=s;		} else {			window.alert("ajax提示 ! 网络不稳定请 刷新");		}					}}/*要传递 4个参数到 Action  玩法类型  交易号   参与份数 */function submit(lotname,issue,serialNo,ID){    if(document.getElementById(ID).value==''){         alert("请输入认购份数");        return;    }    if(document.getElementById("goodUse").value==''){        alert("对不起 您还没登陆 请先登陆 谢谢");        return;    }    document.getElementById("buy").value=document.getElementById(ID).value;    document.getElementById("lotName").value=lotname;    document.getElementById("serialNo").value=serialNo;    document.form.submit(); 
}/** function getADListCallback() {	var xmlHttp = this.xmlHttp;			if(xmlHttp.readyState == 4){				if(xmlHttp.status == 200){					//alert(xmlHttp.responseText);					var json = eval("(" + xmlHttp.responseText + ")");					//alert("items.length="+json.items.length);					var s="";					s+="<table width='600' cellpadding='0' cellspacing='0'' style='display:none;position:absolute; top:520px; left:300px}' id='adtableList'><tbody>";					s+="<tr height='20' class='titleHeroList' align='center' valign='middle''>";                    s+="<td colspan='5' height='20'><div style='border-top:1px dashed #CCCCCC;margin-top:8px;width:200px;float:left;height:1px;padding-left:0px;padding-bottom:0px;'></div><div style='width:200px;height:20px;float:left;'>本站最赢利专家推荐精选单推荐</div><div style='width:200px;float:left;border-top:1px dashed #CCCCCC;margin-top:8px;height:1px;padding-left:0px;padding-bottom:0px;'></div></td></tr>";					s+="<tr height='30'><td colspan='5''>";					s+="<DIV style='height: 30px;' id='icefable1'>";					s+="<table id='box1left' cellpadding='0' cellspacing='0'><tbody>";										for (var i = 0;i < json.items.length; i++) {						s+="<tr height='20' align='center' valign='middle'>";						s+="<td width='100'>"+json.items[i].faqiren+"</td>";						s+="<td width='100'>"+json.items[i].author+"</td>";						s+="<td width='110'>"+json.items[i].lotName+"</td>";						s+="<td width='110'><span>"+json.items[i].account+"</span></td>";						s+="<td width='200'>"+json.items[i].description+"</td>";						s+="<td width='110'><a href='../../Letousky/numberLetou/ssq/index.jsp?lot="+json.items[i].title+"&serialNo="+json.items[i].serialNo+"'>入伙</a></td>";						s+="</tr>";					}					s+="</tr>";					s+="</tbody></table>";					s+="</DIV>"; 					s+="</td></tr>";					s+="</tbody></table>";					//document.getElementById("kaijiangTt_ad").innerHTML=s;				  //	document.getElementById("kaijiangTt_ad").innerHTML=<img src="images/fucai.jpg"></img>;					//alert(ma.xmlHttp.responseText);				}else{					alert("xmlHttp.status="+xmlHttp.status);				}				//marque(600,25,"icefable1","box1left");//adList滚动			}else{				//alert("ma.xmlHttp.readyState="+ma.xmlHttp.readyState);			}	}	*/