﻿//中奖查询　　　　王立峰



//初始化数组100
var checkflag0 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//给数组全部为FALSE   FALSE  
function qk(zdm)
{
	
	for(var i=1;i<zdm;i++)
	{
		checkflag0[i] = "false";
		
		document.getElementById(i).background="../images/ballGray.gif";
        document.getElementById(i).style.color="#000000";
	}
	document.lottery_number.redball.value="";
	document.lottery_number.blueball.value="";
}


//小球变色
function down(value,col)
{
	//alert(col);
	//alert("/zjlotto/mtc/images/ball"+col+".gif");
        //alert(document.getElementById(value).style.color);
	if (checkflag0[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
        document.getElementById(value).style.color="#FFFFFF";
        //document.getElementById("c_1").color="#FFFFFF";
	checkflag0[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
        document.getElementById(value).style.color="#000000";
        //document.getElementById("c_1").color="#000000";
	checkflag0[value] = "false";
	}
	ball(value);
}

//统计红球和蓝球都那些球被选中
function ball(value)
{
	var redballs="";//红球被选中串
	var blueballs="";//蓝球被选中串
	var redcount=0;//红球被选中个数
	var bluecount=0;//蓝球被选中个数
	var blue=0;
	for(var p=1;p<=33;p++)
	{
		if(checkflag0[p]=="true")
		{
			if(p<10)
			{
				redballs=redballs+"0"+p+"";
			}
			else
			{
				redballs=redballs+p+"";
			}
			redcount=redcount+1;
		}
		
	}
	document.lottery_number.redball.value=redballs;
	for(var p=34;p<=50;p++)
	{
		if(checkflag0[p]=="true")
		{
			blue=p-33;
			if(blue<10)
			{
				blueballs=blueballs+"0"+blue+"";
			}
			else
			{
				blueballs=blueballs+blue+"";
			}
			bluecount=bluecount+1;
		}
	}
	document.lottery_number.blueball.value=blueballs;
	//判断是复式还是直选 
	var lotwf="";
	for(var i = 0; i < document.all.lottery_number.lot_cx.length; i++) 
 	{
		if(document.all.lottery_number.lot_cx[i].checked) 
		{
			lot_wf = document.all.lottery_number.lot_cx[i].value;
			break;
		}
	}
	if(lot_wf=="zx")
	{
		if(redcount>6)
		{
			alert("直选玩法红球投注数应等于6个");			
			document.getElementById(value).background="../images/ballGray.gif";
            document.getElementById(value).style.color="#000000";
			checkflag0[value] = "false";
		}
		if(bluecount>1)
		{
			alert("直选玩法蓝球投注数应等于1个");
			document.getElementById(value).background="../images/ballGray.gif";
                        document.getElementById(value).style.color="#000000";
			checkflag0[value] = "false";
		}
	}
	else if(lot_wf=="fs")
	{
		if(redcount>20)
		{
			alert("复式玩法红球投注数应小于20个");			
			document.getElementById(value).background="../images/ballGray.gif";
                        document.getElementById(value).style.color="#000000";
			checkflag0[value] = "false";
		}
	}
}

//期号校验
function qhsub() 
{
	var qhz=document.lottery_number.qh.value;
	for(p=0;p<qhz.length;p++)
	{
	    var q=qhz.charAt(p);
		if(q!='0'&&q!='1'&&q!='2'&&q!='3'&&q!='4'&&q!='5'&&q!='6'&&q!='7'&&q!='8'&&q!='9')
		{
		 document.all.lottery_number.qh.value="200";
		}
	}
}

//提交
function doublecolorSearch()
{
	ball(0,"");//重新组串
	var redcount=0;//红球被选中个数
	var bluecount=0;//蓝球被选中个数
	var blue=0;
	var qhz=document.lottery_number.qh.value;
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		//统计红球蓝球各被选中数
		for(var p=1;p<=33;p++)
		{
			if(checkflag0[p]=="true")
			{
				redcount=redcount+1;
			}
			
		}
		for(var p=34;p<=50;p++)
		{
			if(checkflag0[p]=="true")
			{
				bluecount=bluecount+1;
			}
		}
		//判断是复式还是直选 
		var lotwf="";
		for(var i = 0; i < document.all.lottery_number.lot_cx.length; i++) 
	 	{
			if(document.all.lottery_number.lot_cx[i].checked) 
			{
				lot_wf = document.all.lottery_number.lot_cx[i].value;
				break;
			}
		}
		if(lot_wf=="zx")
		{
			if(redcount==6)
			{
				if(bluecount==1)
				{
					document.lottery_number.action="ToSearchLot.do";
					document.lottery_number.submit();
				}
				else
				{
					alert("蓝球投注非法");
				}
			}
			else
			{
				alert("红球投注非法");
			}
		}
		else if(lot_wf=="fs")
		{
			if(redcount==6)
			{
				if(bluecount>1)
				{
					document.lottery_number.action="ToSearchLot.do";
					document.lottery_number.submit();
				}
				else if(bluecount==1)
				{
					alert("您选择的玩法为复式！");
				}
				else
				{
					alert("蓝球投注非法");
				}
			}
			else if(redcount>6)
			{
				if(bluecount>=1)
				{
					document.lottery_number.action="ToSearchLot.do";
					document.lottery_number.submit();
				}
				else
				{
					alert("蓝球投注非法");
				}
			}
			else
			{
				alert("红球投注非法");	
			}
		}
	}
}

////////////////////////////////////////////////////////3D单选组选//////////////////////////////////////////////////////

//3D初始化数组100
var checkflag =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//给数组全部为FALSE   FALSE  
function qk3D(zdm)
{
	
	for(var i=0;i<zdm;i++)
	{
		checkflag[i] = "false";
		document.getElementById(i).background="../images/ballGray.gif";
	}
	//document.lottery_number.redball.value="";
	//document.lottery_number.blueball.value="";
}

//3D小球变色
function down3D(value,col)
{
	//alert(col);
	//alert(temp);
	if (checkflag[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag[value] = "false";
	}
	dxzx3Djy(value);
}

//3D号码校验
function dxzx3Djy(value)
{
	var bball="";//百位球串
	var bcount=0;//百位个数
	var sball="";//十位球串
	var scount=0;//十位个数
	var gball="";//个位球串
	var gcount=0;//个位个数
	//百位校验
	for(var p=0;p<=9;p++)
	{
		if(checkflag[p]=="true")
		{	
			bball=bball+p+"";
			bcount=bcount+1;
		}	
	}
	if(bcount>1)
	{
		alert("只能选1个号码！");			
		document.getElementById(value).background="../images/ballGray.gif";
		checkflag[value] = "false";
	}
	document.all.lottery_number.bball.value=bball;
	//十位校验
	for(var p=10;p<=19;p++)
	{
		if(checkflag[p]=="true")
		{
			sball=sball+(p-10)+"";
			scount=scount+1;
		}	
	}
	if(scount>1)
	{
		alert("只能选1个号码！");			
		document.getElementById(value).background="../images/ballGray.gif";
		checkflag[value] = "false";
	}
	document.all.lottery_number.sball.value=sball;
	//个位校验
	for(var p=20;p<=29;p++)
	{
		if(checkflag[p]=="true")
		{
			gball=gball+(p-20)+"";
			gcount=gcount+1;
		}	
	}
	if(gcount>1)
	{
		alert("只能选1个号码！");			
		document.getElementById(value).background="../images/ballGray.gif";
		checkflag[value] = "false";
	}
	document.all.lottery_number.gball.value=gball;
}

//3D提交
function tj3D()
{
	dxzx3Djy(0,"");//重新组串
	var wf3d="";//3D玩法
	var qhz=document.lottery_number.qh.value;
	//判断是单选还是组选 
	for(var i = 0; i < document.lottery_number.dxzx3d_cx.length; i++) 
 	{
		if(document.lottery_number.dxzx3d_cx[i].checked) 
		{
			wf3d = document.lottery_number.dxzx3d_cx[i].value;
			break;
		}
	}
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		document.lottery_number.wf.value = wf3d;
		document.lottery_number.action = "ToSearch3D.do";
		document.lottery_number.submit();
	}
}

////////////////////////////////////////////////////////3D组三组六复式//////////////////////////////////////////////////

//3D初始化数组100
var checkflag1 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//给数组全部为FALSE   FALSE  
function qk3Dz3z6(zdm)
{
	
	for(var i=0;i<zdm;i++)
	{
		checkflag1[i] = "false";
		document.getElementById(i).background="../images/ballGray.gif";
	}
}

//3D小球变色
function down3Dz3z6(value,col)
{
	if (checkflag1[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag1[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag1[value] = "false";
	}
}

//3D组三组六提交
function z3z6tj()
{
	var wf3d="";//3D玩法
	var z3z6ball="";
	var z3z6count=0;
	var qhz=document.lottery_number.qh.value;
	//alert(qhz);
	//判断是组三还是组六 
	for(var i = 0; i < document.lottery_number.z3z6_cx.length; i++) 
 	{
		if(document.lottery_number.z3z6_cx[i].checked) 
		{
			wf3d = document.lottery_number.z3z6_cx[i].value;
			break;
		}
	}
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		if(wf3d=="z3")
		{
			for (var i=0;i<10;i++)
			{
				if(checkflag1[i]=="true")
				{
					z3z6ball=z3z6ball+i+"";
					z3z6count=z3z6count+1;
				}	
			}
			document.all.lottery_number.z3z6ball.value=z3z6ball;
			if(z3z6count<2)
			{
				alert("您选择的号码数少于２个！");
			}
			else
			{
				document.lottery_number.wf.value = wf3d;
				document.lottery_number.action = "ToSearchZ3Z6.do";
				document.lottery_number.submit();
			}
		}
		else if(wf3d=="z6")
		{
			for (var i=0;i<10;i++)
			{
				if(checkflag1[i]=="true")
				{
					z3z6ball=z3z6ball+i+"";
					z3z6count=z3z6count+1;
				}	
			}
			document.all.lottery_number.z3z6ball.value=z3z6ball;
			if(z3z6count<4)
			{
				alert("您选择的号码数少于4个！");
			}
			else
			{
				document.lottery_number.wf.value = wf3d;
				document.lottery_number.action = "ToSearchZ3Z6.do";
				document.lottery_number.submit();
			}
		}
	}
}

////////////////////////////////////////////////////////3D和值//////////////////////////////////////////////////

function hztj()
{
	var hz=document.lottery_number.hz.value;
	var qhz=document.lottery_number.qh.value;
	var wf3d="";//3D玩法
	//判断是直选和值还是组选和值
	for(var i = 0; i < document.lottery_number.hz_cx.length; i++) 
 	{
		if(document.lottery_number.hz_cx[i].checked) 
		{
			wf3d = document.lottery_number.hz_cx[i].value;
			break;
		}
	}
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		if(hz=="0")
		{
			alert("请选择和值数！");
		}
		else
		{
			document.lottery_number.wf.value = wf3d;
			document.lottery_number.action = "ToSearchHz.do";
			document.lottery_number.submit();
		}
	}
}

////////////////////////////////////////////////////////3D直选组合复式胆拖//////////////////////////////////////////////

//初始化数组100
var checkflag2 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//小球变色
function down3Dfs(value,col)
{
	//alert(col);
	//alert(temp);
	if (checkflag2[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag2[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag2[value] = "false";
	}
	ballfs(value);
}

function ballfs(value)
{
	var count=0;
	var Scount="";
	var wf3d="";//3D玩法
	//判断是直选组合复式还是直选组合胆拖
	for(var i = 0; i < document.lottery_number.fs_cx.length; i++) 
 	{
		if(document.lottery_number.fs_cx[i].checked) 
		{
			wf3d = document.lottery_number.fs_cx[i].value;
			break;
		}
	}
	//如果是直选组合胆拖
	if(wf3d=="dtfs")
	{
		for(var i=0;i<10;i++)
		{
			if(checkflag2[i]=="true")
			{
				count=count+1;
				if(count>2)
				{
					alert("您选择的胆码数大于２个！");
					count=count-1;
					document.getElementById(value).background="../images/ballGray.gif";
					checkflag2[value] = "false";
				}
			}
		}	
	}
}

//提交
function fstj()
{
	var count=0;
	var Scount="";
	var wf3d="";//3D玩法
	var dmjl=0;//胆码记录
	var tmjl=0;//拖码记录
	var tmSjl=0;
	var dmS="";//胆码记录串
	var tmS="";//拖码记录串
	var dmcount=0;//胆码选中数
	var tmcount=0;//拖码选中数
	var error=0;//出错提示
	//判断是直选组合复式还是直选组合胆拖
	for(var i = 0; i < document.lottery_number.fs_cx.length; i++) 
 	{
		if(document.lottery_number.fs_cx[i].checked) 
		{
			wf3d = document.lottery_number.fs_cx[i].value;
			break;
		}
	}
	for(var i=0;i<10;i++)
	{
		if(checkflag2[i]=="true")
		{
			dmjl=i;
			for(var j=10;j<20;j++)
			{
				if(checkflag2[j]=="true")
				{
					tmjl=j-10;
					if(dmjl==tmjl)
					{
						alert("您选择拖码"+tmjl+"与胆码重复");
						document.getElementById(j).background="../images/ballGray.gif";
						checkflag2[j] = "false";
						error=1;
					}
				}
			}
		}
	}
	for(var i=0;i<10;i++)
	{
		if(checkflag2[i]=="true")
		{
			dmcount=dmcount+1;
		}
		if(checkflag2[i+10]=="true")
		{
			tmcount=tmcount+1;
		}
	}
	if(wf3d=="dtfs")
	{
		if(dmcount==0)
		{
			alert("请选择胆码！");
			error=1;
		}
	}
	if(dmcount+tmcount<4)
	{
		alert("您选择的号码有误，胆码数加拖码数要大于４。请重新选择！");
		error=1;
	}
	if(error==0)
	{
		for(var i=0;i<10;i++)
		{
			if(checkflag2[i]=="true")
			{
				dmS=dmS+i+"";;
			}
			if(checkflag2[i+10]=="true")
			{
				tmS=tmS+i+"";
			}
		}
		document.all.lottery_number.dmball.value=dmS;
		document.all.lottery_number.tmball.value=tmS;
		document.lottery_number.wf.value = wf3d;
		document.lottery_number.action = "ToSearchFs.do";
		document.lottery_number.submit();
	}
}

function Show()
{
	var obj=eval(this.tblHideInfo);
	obj.style.display='';
	for(var i=0;i<20;i++)
	{
	   document.getElementById(i).background="../images/ballGray.gif";
		checkflag2[i] = "false";
    }
}
function Hide()
{
	var obj=eval(this.tblHideInfo);
	obj.style.display='none';
	for(var i=0;i<20;i++)
	{
	   document.getElementById(i).background="../images/ballGray.gif";
		checkflag2[i] = "false";
    }
}

////////////////////////////////////////////////////////3D定位复式//////////////////////////////////////////////

//初始化数组100
var checkflag3 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//小球变色
function down3Ddwfs(value,col)
{
	//alert(col);
	//alert(temp);
	if (checkflag3[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag3[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag3[value] = "false";
	}
}

function tj3Ddwfs()
{
	var bw="";//百位串
	var bwcount=0;//百位选中数
	var sw="";//十位串
	var swcount=0;//十位选中数
	var gw="";//个位串
	var gwcount=0;//个位选中数
	var qhz=document.lottery_number.qh.value;
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		for(var i=0;i<10;i++)
		{
			if(checkflag3[i]=="true")
			{
				bw=bw+i+"";
				bwcount=bwcount+1;
			}
			if(checkflag3[i+10]=="true")
			{
				sw=sw+i+"";
				swcount=swcount+1;
			}
			if(checkflag3[i+20]=="true")
			{
				gw=gw+i+"";
				gwcount=gwcount+1;
			}
		}
		document.all.lottery_number.dbball.value=bw;
		document.all.lottery_number.dsball.value=sw;
		document.all.lottery_number.dgball.value=gw;
		if(bwcount==0)
		{
			alert("请选择百位号码");
		}
		else if(swcount==0)
		{
			alert("请选择十位号码");
		}
		else if(gwcount==0)
		{
			alert("请选择个位号码");
		}
		else
		{
			document.lottery_number.action = "ToSearchDwFs.do";
			document.lottery_number.submit();
		}
	}
}

////////////////////////////////////////////////////////c522c736dlt中奖查询//////////////////////////////////////////////
//初始化数组100
var checkflag4 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//给数组全部为FALSE   FALSE  
function qk3(zdm)
{
	
	for(var i=1;i<zdm;i++)
	{
		checkflag4[i] = "false";
		document.getElementById(i).background="../images/ballGray.gif";
	}
	document.lottery_number.ball.value="";
}


//小球变色
function down3(value,col)
{
	if (checkflag4[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag4[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag4[value] = "false";
	}
	cwf(value);
}

function cwf(value)
{
	var xh=document.lottery_number.xh.value;//玩法选出几个号码
	var jbhm=document.lottery_number.jbhm.value;//玩法基本投注数
	var max=document.lottery_number.max.value;//玩法最大投注数
	var count=0;
	for(var i=1;i<=jbhm;i++)
	{
		if(checkflag4[i]=="true")
		{
			count=count+1;
		}
	}
	if(count>max)
	{
		alert("投注数大于规定！");
		document.getElementById(value).background="../images/ballGray.gif";
		checkflag4[value] = "false";
	}
	//判断是单式还是复式
	var wf="";
	for(var i = 0; i < document.lottery_number.c522c736dlt_cx.length; i++) 
 	{
		if(document.lottery_number.c522c736dlt_cx[i].checked) 
		{
			wf = document.lottery_number.c522c736dlt_cx[i].value;
			break;
		}
	}
	if(wf=="dx")
	{
		if(parseInt(count)>parseInt(xh))
		{
			alert("投注数大于规定！");
			document.getElementById(value).background="../images/ballGray.gif";
			checkflag4[value] = "false";
		}
	}
}

function tj3()
{
	var xh=document.lottery_number.xh.value;//玩法选出几个号码
	var jbhm=document.lottery_number.jbhm.value;//玩法基本投注数
	var balls="";//选中号码串
	var count=0;//选中号码个数
	//alert(xh);
	//alert(jbhm);
	for(var i=1;i<=jbhm;i++)
	{
		if(checkflag4[i]=="true")
		{
			if(i<10)
			{
				balls=balls+"0"+i+"";
				count=count+1;
			}
			else
			{
				balls=balls+i+"";
				count=count+1;
			}
		}
	}
	var qhz=document.lottery_number.qh.value;
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
	}
	else
	{
		if(balls.length<(xh*2))
		{
			alert("号码输入数少于规定！");
		}
		else
		{
			document.lottery_number.ball.value = balls;
			document.lottery_number.action = "ToSearchC522C736DLT.do";
			document.lottery_number.submit();
		}
	}
}

////////////////////////////////////////////////////////c522c736dlt胆拖中奖查询/////////////////////////////////////////

//初始化数组100
var checkflag5 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//小球变色
function down5(value,col)
{
	if (checkflag5[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag5[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag5[value] = "false";
	}
	kz(value);
}

function kz(value)
{
	var xh=document.lottery_number.xh.value;//玩法选出几个号码
	var jbhm=document.lottery_number.jbhm.value;//玩法基本投注数
	var dmcount=0;//胆码个数
	var tmcount=0;//拖码个数
	for(var i=1;i<=jbhm;i++)
	{
		if(checkflag5[i]=="true")
		{
			dmcount=dmcount+1;
		}
		if(dmcount>xh-1)
		{
			dmcount=dmcount-1;
			alert("胆码数量大于规定！");
			document.getElementById(value).background="../images/ballGray.gif";
			checkflag5[value] = "false";
		}
	}
}

//提交
function dttj()
{
	var xh=document.lottery_number.xh.value;//玩法选出几个号码
	var jbhm=document.lottery_number.jbhm.value;//玩法基本投注数
	var dms="";//胆码串
	var tms="";//拖码串
	var dmcount=0;//胆码个数
	var tmcount=0;//拖码个数
	var jl=0;
	for(var i=1;i<=jbhm;i++)
	{
		if(checkflag5[i]=="true")
		{
			dmcount=dmcount+1;
			if(i<10)
			{
				dms=dms+"0"+i;
			}
			else
			{
				dms=dms+i+"";
			}
		}
		jl=parseInt(i)+parseInt(jbhm);
		//alert(jl);
		if(checkflag5[jl]=="true")
		{
			if(checkflag5[i]=="true")
			{
				alert("胆码和拖码重复");
				document.getElementById(jl).background="../images/ballGray.gif";
				checkflag5[jl] = "false";
				return;
			}
			else
			{
				if(i<10)
				{
					tms=tms+"0"+i;
				}
				else
				{
					tms=tms+i+"";
				}
				tmcount=tmcount+1;
			}
		}
	}
	if(dmcount+tmcount<=xh)
	{
		alert("投注非法，没有大于最小投注数");
		return;
	}
	var qhz=document.lottery_number.qh.value;
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
		return;
	}
	else
	{
		document.lottery_number.dm.value = dms;
		document.lottery_number.tm.value = tms;
		document.lottery_number.action = "ToSearchC522C736DLTdt.do";
		document.lottery_number.submit();
	}
}

////////////////////////////////////////////////////////p62中奖查询/////////////////////////////////////////

//初始化数组100
var checkflag6 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//小球变色
function downp62(value,col)
{
	var jl="false";
	var count=0;
	var tbcount=0;
	if (checkflag6[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag6[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag6[value] = "false";
	}
	for(var i=0;i<6;i++)
	{
		for(var j=0;j<10;j++)
		{
			if(checkflag6[i*10+j]=="true")
			{
				jl="true";
				count=count+1;
			}
			if(jl=="true")
			{
				if(count>1)
				{
					alert("一个位置只能投一个号码！");
					document.getElementById(value).background="../images/ballGray.gif";
					checkflag6[value] = "false";
					break;
				}
			}
		}
		jl="false";
		count=0;
	}
	for(var i=60;i<=61;i++)
	{
		if(checkflag6[i]=="true")
		{
			tbcount=tbcount+1;
		}
		if(tbcount>1)
		{
			alert("特别号只能投一个号码！");
			document.getElementById(value).background="../images/ballGray.gif";
			checkflag6[value] = "false";
			break;
		}
	}
}

function tjp62()
{
	var qhz=document.lottery_number.qh.value;
	var count=0;
	var tbcount=0;
	var str="";
	for(var i=0;i<6;i++)
	{
		for(var j=0;j<10;j++)
		{
			if(checkflag6[i*10+j]=="true")
			{
				count=count+1;
				str=str+j+"";
			}
		}
		if(count<1)
		{
			alert("请正确选择号码！")
			return;
			break;
		}
		count=0;
	}
	for(var i=60;i<=61;i++)
	{
		if(checkflag6[i]=="true")
		{
			tbcount=tbcount+1;
			str=str+(parseInt(i)-parseInt(60))+"";
		}
	}
	if(tbcount<1)
	{
		alert("请正确选择特别码！");
		return;
	}
	//alert(str);
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
		return;
	}
	else
	{
		document.lottery_number.str.value = str;
		document.lottery_number.action = "ToSearchP62.do";
		document.lottery_number.submit();
	}
}

////////////////////////////////////////////////////////p5+1中奖查询/////////////////////////////////////////

//初始化数组100
var checkflag7 =new Array("false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false","false");

//小球变色
function downp41(value,col)
{
	var jl="false";
	var count=0;
	var tbcount=0;
	if (checkflag7[value] == "false") {
	document.getElementById(value).background="../images/ball"+col+".gif";
	checkflag7[value] = "true";
	}
	else {
	document.getElementById(value).background="../images/ballGray.gif";
	checkflag7[value] = "false";
	}
	for(var i=0;i<6;i++)
	{
		for(var j=0;j<10;j++)
		{
			if(checkflag7[i*10+j]=="true")
			{
				jl="true";
				count=count+1;
			}
			if(jl=="true")
			{
				if(count>1)
				{
					alert("一个位置只能投一个号码！");
					document.getElementById(value).background="../images/ballGray.gif";
					checkflag7[value] = "false";
					break;
				}
			}
		}
		jl="false";
		count=0;
	}
}

function tjp41()
{
	var qhz=document.lottery_number.qh.value;
	var count=0;
	var tbcount=0;
	var str="";
	for(var i=0;i<6;i++)
	{
		for(var j=0;j<10;j++)
		{
			if(checkflag7[i*10+j]=="true")
			{
				count=count+1;
				str=str+j+"";
			}
		}
		if(count<1)
		{
			alert("请正确选择号码！")
			return;
			break;
		}
		count=0;
	}
	if(qhz.length!=7)
	{
		alert("期号输入非法，请正确输入.如：2006001");
		return;
	}
	else
	{
		document.lottery_number.str.value = str;
		document.lottery_number.action = "ToSearchP41.do";
		document.lottery_number.submit();
	}
}





  	
  	