function zRunAll(){
  tmp = document.getElementById('allTIDs').value;
  alltids = tmp.split(',');
  for(i=0;i<alltids.length;i++)
    runTest(alltids[i]);
}
function runTest(tid){
	zupdate(tid,'Running','');
	window.open('ztestbuf.aspx?tid='+tid,'tf_'+tid,'');
}
function zupdate(id, status, msg){
	if(status != null && status.length != ''){
		s = document.getElementById('s_'+id);
		if(s==null)alert('unknown error');
		s.innerHTML = status;
		s.removeAttribute('class');
        var newC = document.createAttribute('class');
		newC.value = status;
		s.setAttributeNode(newC);
	}
	if(msg != null){
		m = document.getElementById('m_'+id);
		var tmp;
		var smsg = msg.replace('<br>','    ');
		while(tmp != smsg){//replace all br
		    tmp = smsg;
		    smsg = smsg.replace('<br>','    ');
		}
		smsg = smsg.substring(0,100);
		if(smsg.length < msg.length)
			smsg = smsg+'...';
		m.innerHTML = smsg;
		document.getElementById('md_'+id).innerHTML = msg;
	}
}
function updateGlobal(id,status){
	if(status != null && status.length != ''){
		if(s==null)return;
		s = document.getElementById('h_'+id);
		s.removeAttribute('class');
        var newC = document.createAttribute('class');
		newC.value = status;
		s.setAttributeNode(newC);
	}
}
var lnode;
function showZNode(parent,node){
    lnode = document.getElementById(parent);
    lnode.style.background = '#ABD1FF';
    showqsnode(node);
}
function hideZNode(){
    lnode.style.background='#eeeeee';
    hideqsnode();
}
function zerror(msg){
    document.getElementById('zmessage').innerHTML = msg;
}