
function checkNumber(mytd,num,col)
	{
	
	var num = num.toString();
 
		 if(mytd.innerHTML=="&nbsp;")
		 {	  
			  switch (col) {
              case "#ff0000":
              	if (document.all("rednum").value >= 25) {
               		alert("红球数目不能大与25个");
               	 	return;
               	}
              	mytd.className = "ball_r_selected";
              	document.all("rednum").value++;                      
              	break;
              case "#1201FF":
            	mytd.className = "ball_b_selected";
            	document.all("bluenum").value++;
	          }
	          	
	      		mytd.style.backgroundColor=col; 
			  	mytd.style.color="#fff";
			  	mytd.innerHTML=num;    		  		 	
		 }
		 else
		 {
			  mytd.style.backgroundColor="#FFF"; 
			  mytd.style.color="#fff";
			  mytd.innerHTML="&nbsp;";
			  	
			  switch (col) {
              case "#ff0000":
              	mytd.className = "ball_r";
              	document.all("rednum").value--;             
              	break;
              case "#1201FF":
            	mytd.className = "ball_b";
            	document.all("bluenum").value--;
	          }			 	
		 }    
    }

function checkNumber2(mytd2,col2)
	{
		 if(mytd2.innerHTML=="&nbsp;")
		 {
			  mytd2.style.backgroundColor=col2; 
			  mytd2.style.color="#000";
			 mytd2.innerHTML="●";		 	
		 }
		 else
		 {
			  mytd2.style.backgroundColor="#FFF"; 
			  mytd2.style.color="#fff";
			  mytd2.innerHTML="&nbsp;";		 	
		 }

	}
	
function checkNumber3(mytd3,m,col3)
	{		
		 if(mytd3.innerHTML=="&nbsp;")
		 {
			  mytd3.style.backgroundColor=col3; 
			  mytd3.style.color="#fff";
			  mytd3.innerHTML=m;		 	
		 }
		 else
		 {
			  mytd3.style.backgroundColor="#e9e9e9"; 
			  mytd3.style.color="#fff";
			  mytd3.innerHTML="&nbsp;";			 	
		 }

	}
	
function SortNum(codes) {
    var arrCodes;
    arrCodes = codes.split(",");
		//alert(arrCodes.length);
    for (var ii = 0; ii < arrCodes.length; ii++) {
        var chg;
        var exchange = false;
        for (var jj = arrCodes.length; jj > ii; jj--) {
            if (Number(arrCodes[jj]) < Number(arrCodes[jj - 1])) {
                chg = arrCodes[jj];
                arrCodes[jj] = arrCodes[jj - 1];
                arrCodes[jj - 1] = chg;
                exchange = true;
            }
        }
        if (!exchange) {
            return arrCodes;
        }
    }
    return arrCodes;
}	
	

function display()
{
 document.getElementById("check_box").style.display="block";
}
function hidden()
{
 document.getElementById("check_box").style.display="none";
 document.getElementById("select_but").style.background="url(../images/select_03.gif) 0 0 no-repeat";
}


function init(){
//parent.document.all("table").style.height=document.body.scrollHeight; 
//parent.document.all("table").style.width=document.body.scrollWidth;
}

//锟斤拷锟斤拷锟斤拷
function show(i)
	{
		if(i==1)
		{
			document.getElementById("hm").style.display="none";
		}
		else
		{
			document.getElementById("hm").style.display="block";
		}
	 	}