<html>
<head>
<title>test.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function hidOrShow(obj){
var pobj = obj.parentNode.parentNode;
var cobj = pobj.childNodes[1];
if(cobj.style.display == "")
cobj.style.display = "none";
else if(cobj.style.display == "none")
cobj.style.display = "";
}
function hidOrShow2(pobj){
var cobj = pobj.childNodes[1];
if(cobj.style.display == "none")
cobj.style.display = "";
}
// start checkSel
function selAll(cobj){
var obj = cobj.parentNode.parentNode.parentNode;
var innerTabObj = obj.rows[1].childNodes[0].childNodes[0];
hidOrShow2(obj);
var len = innerTabObj.rows.length;
if(cobj.checked){
for(var i = 0;i < len;i++){
var checkObj = innerTabObj.rows[i].childNodes[1].childNodes[0];
checkObj.checked = cobj.checked;
}
}else{
for(var i = 0;i < len;i++){
var checkObj = innerTabObj.rows[i].childNodes[1].childNodes[0];
checkObj.checked = cobj.checked;
}
}
return true;
}
function unselAll(cobj){
var ck = true;
var innerTabObj = cobj.parentNode.parentNode.parentNode;
var pobj = innerTabObj.parentNode.parentNode.parentNode.parentNode;
var len = innerTabObj.rows.length;
var pCheckObj = pobj.rows[0].childNodes[1].childNodes[0];
var j = 0;
for(var i=0;i<len;i++){
var cCheckObj = innerTabObj.rows[i].childNodes[1].childNodes[0];
if(!cCheckObj.checked)
j++;
}
for(var i = 0;i < len;i++){//if one checkbox can't be selected
var cCheckObj = innerTabObj.rows[i].childNodes[1].childNodes[0];
if(!cCheckObj.checked){
if(j==len){
pCheckObj.checked = false;
}else{
pCheckObj.checked = true;
break;
}
}
}
return true;
}// end checkSel
</script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td οnclick="return hidOrShow(this);">+</td>
<td><input type="checkbox" οnclick="selAll(this);"></td>
<td>Test</td>
</tr>
<tr style="display:none">
<td colspan="3">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td> -</td><td><input type="checkbox" οnclick="unselAll(this);"></td><td>Test1</td>
</tr>
<tr>
<td> -</td><td><input type="checkbox" οnclick="unselAll(this);"></td><td>Test2</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>