var SelRedball=0;
var SelBlueball=0;
var JCRedball=0;
var $xuang=0;
var $xuang1=0;
var $xuang2=0;
var m3 = new Array();//创建一个新的数组
m3[1] = "15-40";
m3[2] = "41-46";
m3[3] = "47-52";
m3[4] = "53-58";
m3[5] = "59-65";
m3[6] = "66-90";
var m4 = new Array();//创建一个新的数组
m4[1] = "首位奇数，尾位奇数";
m4[2] = "首位奇数，尾位偶数";
m4[3] = "首位偶数，尾位奇数";
m4[4] = "首位偶数，尾位偶数";
function Selhq(org){
	var obj=document.all("Selhq"+org).style.backgroundColor;
	if (org<10){
		m="0"+org;
	}else{
		m=org;
	}
	if(obj==""){
		$xuang1=1;
		SelRedball++;
		if(SelRedball>=3){
			alert("胆码最多只能选择2个！");
			SelRedball--;
			return;
		}
		document.all("Selhq"+org).style.backgroundColor="#f05000";
		document.all.hq.value=document.all.hq.value+" "+m;
	}else{
		$xuang1=0;
		document.all("Selhq"+org).style.backgroundColor="";
		document.all.hq.value=document.all.hq.value.replace(" "+m,""); 
		SelRedball--;
	}
}
function JChq(org){
	var obj=document.all("JChq"+org).style.backgroundColor;
	if (org<10){
		m="0"+org;
	}else{
		m=org;
	}
	if(org=="110"){
		$xuang1=0;
		JCRedball=0;
		for($i=1; $i<=20; $i++){
			document.all("JChq"+$i).style.backgroundColor="";
			document.all("JCh"+$i).style.backgroundColor="";
			document.all("JChqb"+$i).checked=false;
			document.all("JChb"+$i).checked=false;
		}//循环
		document.all.hq.value="";
	}else if(obj==""){
		$xuang1=1;
		JCRedball++;
		if(JCRedball>=11){
			alert("号码最多只能选择10个！");
			JCRedball--;
			return;
		}
		document.all("JChqb"+org).checked=document.all("JChqb"+org).checked==true?false:true;
		document.all("JChb"+org).checked=document.all("JChb"+org).checked==true?false:true;
		document.all("JChq"+org).style.backgroundColor="#f05000";
		document.all("JCh"+org).style.backgroundColor="#f05000";
		document.all.hq.value=document.all.hq.value+" "+m;
	}else{
		$xuang1=0;
		document.all("JChqb"+org).checked=document.all("JChqb"+org).checked==true?false:true;
		document.all("JChb"+org).checked=document.all("JChb"+org).checked==true?false:true;
		document.all("JChq"+org).style.backgroundColor="";
		document.all("JCh"+org).style.backgroundColor="";
		document.all.hq.value=document.all.hq.value.replace(" "+m,""); 
		JCRedball--;
	}
}

function Sellq(org){
	var obj=document.all("Sellq"+org).style.backgroundColor;
	if (org<10){
		m="0"+org;
	}else{
		m=org;
	}
	if(obj==""){
		$xuang2=1;
		SelBlueball++;
		if(SelBlueball>=6){
			alert("杀码最多只能选择5个！");
			SelBlueball--;
			return;
		}
		document.all("Sellq"+org).style.backgroundColor="#f05000";
		document.all.lq.value=document.all.lq.value+" "+m;
	}else{
		$xuang2=0;
		document.all("Sellq"+org).style.backgroundColor="";
		document.all.lq.value=document.all.lq.value.replace(" "+m,"");
		SelBlueball--;
	}
}

function Selqs(org){
	var obj=document.all("Selqs"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Selqs0").style.backgroundColor="";
		document.all("Selqs1").style.backgroundColor="";
		document.all("Selqs2").style.backgroundColor="";
		document.all("Selqs3").style.backgroundColor="";
		document.all("Selqs4").style.backgroundColor="";
		document.all("Selqs5").style.backgroundColor="";
		document.all("Selqs"+org).style.backgroundColor="#f05000";
		m2="奇偶比："+m+" ："+(5-m);
		document.all.qs.value=m2;
	}else{
		$xuang--;
		document.all("Selqs"+org).style.backgroundColor="";
		document.all.qs.value=document.all.qs.value.replace(m2,"");
	}
}

function Selxs(org){
	var obj=document.all("Selxs"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Selxs0").style.backgroundColor="";
		document.all("Selxs1").style.backgroundColor="";
		document.all("Selxs2").style.backgroundColor="";
		document.all("Selxs3").style.backgroundColor="";
		document.all("Selxs4").style.backgroundColor="";
		document.all("Selxs5").style.backgroundColor="";
		document.all("Selxs"+org).style.backgroundColor="#f05000";
		m2="小大比："+m+" ："+(5-m);
		document.all.xs.value=m2;
	}else{
		$xuang--;
		document.all("Selxs"+org).style.backgroundColor="";
		document.all.xs.value=document.all.xs.value.replace(m2,"");	 
	}
}

	
function Seljchz(org){
	var obj=document.all("Seljchz"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Seljchz1").style.backgroundColor="";
		document.all("Seljchz2").style.backgroundColor="";
		document.all("Seljchz3").style.backgroundColor="";
		document.all("Seljchz4").style.backgroundColor="";
		document.all("Seljchz5").style.backgroundColor="";
		document.all("Seljchz6").style.backgroundColor="";
		document.all("Seljchz"+org).style.backgroundColor="#f05000";
		m2="和值在"+m3[m]+"之间";
		document.all.jchz.value=m2;
	}else{
		$xuang--;
		document.all("Seljchz"+org).style.backgroundColor="";
		document.all.jchz.value=document.all.jchz.value.replace(m2,"");
	}
}

function Seljcch(org){
	var obj=document.all("Seljcch"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Seljcch0").style.backgroundColor="";
		document.all("Seljcch1").style.backgroundColor="";
		document.all("Seljcch2").style.backgroundColor="";
		document.all("Seljcch3").style.backgroundColor="";
		document.all("Seljcch4").style.backgroundColor="";
		document.all("Seljcch"+org).style.backgroundColor="#f05000";
		m2="重号："+m+"个";
		document.all.jcch.value=m2;
	}else{
		$xuang--;
		document.all("Seljcch"+org).style.backgroundColor="";
		document.all.jcch.value=document.all.jcch.value.replace(m2,"");	 
	}
}


function Seljclh(org){
	var obj=document.all("Seljclh"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Seljclh0").style.backgroundColor="";
		document.all("Seljclh2").style.backgroundColor="";
		document.all("Seljclh3").style.backgroundColor="";
		document.all("Seljclh4").style.backgroundColor="";
		document.all("Seljclh"+org).style.backgroundColor="#f05000";
		m2="连号："+m+"连号";
		document.all.jclh.value=m2;
	}else{
		$xuang--;
		document.all("Seljclh"+org).style.backgroundColor="";
		document.all.jclh.value=document.all.jclh.value.replace(m2,"");	 
	}
}

function Seljctwh(org){
	var obj=document.all("Seljctwh"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Seljctwh0").style.backgroundColor="";
		document.all("Seljctwh1").style.backgroundColor="";
		document.all("Seljctwh2").style.backgroundColor="";
		document.all("Seljctwh"+org).style.backgroundColor="#f05000";
		m2="同尾号："+m+"组";
		document.all.jctwh.value=m2;
	}else{
		$xuang--;
		document.all("Seljctwh"+org).style.backgroundColor="";
		document.all.jctwh.value=document.all.jctwh.value.replace(m2,"");	 
	}
}


function Seljcsw(org){
	var obj=document.all("Seljcsw"+org).style.backgroundColor;
	m=org;
	if(obj==""){
		$xuang++;
		document.all("Seljcsw1").style.backgroundColor="";
		document.all("Seljcsw2").style.backgroundColor="";
		document.all("Seljcsw3").style.backgroundColor="";
		document.all("Seljcsw4").style.backgroundColor="";
		document.all("Seljcsw"+org).style.backgroundColor="#f05000";
		m2=m4[m];
		document.all.jcsw.value=m2;
	}else{
		$xuang--;
		document.all("Seljcsw"+org).style.backgroundColor="";
		document.all.jcsw.value=document.all.jcsw.value.replace(m2,"");	 
	}
}
