function deleteWarn()   
{ 
var mess ="你确定要执行吗？执行后无法恢复!"; 
var question = confirm(mess); 
if(question=='0 ') 
{ 
      return   false; 
} 
else 
{ 
      return  true; 
} 
} 

function deleteWarntwo()   
{ 
var mess ="你确定要执行吗？执行后无法恢复!"; 
var question = confirm(mess); 
if(question=='0 ') 
{ 
	
      return   false; 
} 
else 
{ 	
	document.from.action="?Action=list_del";
	document.from.submit();
} 
} 


function ifChecked(chkboxname){
    var AC = false;
    var myValue = "";
    var myCount = 0;
    for (var i = 0; i < document.getElementsByName(chkboxname).length; i++) {
        var e = document.getElementsByName(chkboxname)[i];
        if (e.checked) {
            myValue = e.value + "," + myValue
            myCount = myCount + 1;
        };
            }
    if (myCount != 0) {
        AC = true;
    }
    else {
        AC = false;
    }
    if (!AC) {
        //alert("请先选定后再操作！");
        return false;
    }
    else {
        return myValue;
    }
    
}
function checkAll(name)
{
	var n;
	n=document.getElementsByName(name).length;
	for (var i = 0; i < n; i++)
	{
	document.getElementsByName(name)[i].checked = true;
	}
}

function unCheckAll(name)
{
	if(ifChecked(name)!=false)
	{
		var n;
		n=document.getElementsByName(name).length;
		for (var i = 0; i < n; i++)
		{
			document.getElementsByName(name)[i].checked = false;
		}
	}
}

function switchAll(name)
{
	var n;
	n=document.getElementsByName(name).length;
	for (var i = 0; i < n; i++) {
        var e = document.getElementsByName(name)[i];
        if (e.checked) {
            e.checked = false;
        }
        else {
            e.checked = true;
        }
    }
}
