// JScript source code
var xml;
var xsl;
var xmlhttp ;
var href="";
var newfile2 ;
var newfile ;
function getTask( id){
var table = document.getElementById('Table4');
var cnt = table.getElementsByTagName("tr");
i = id;
name='tr'+i;
im_name='img'+i;
var tr = document.getElementById( name );
var tr0 = document.getElementById( name+"00" );
var img = document.getElementById( im_name );
if (tr.getAttribute("isOK") == "1")
{
img.setAttribute("src","images/plus.gif","0")
tr.setAttribute("isOK", "0");
tr .parentNode.removeChild( tr0 );
return;
};
img.setAttribute("src","images/minus.gif","0")
xmlhttp.Open("POST", newfile , false);
xmlText = '<root><getProject id="'+id+'" /></root>';
xmlhttp.Send(xmlText);
xml.loadXML(xmlhttp.responseText);
var rt = xml.getElementsByTagName("task");
if ( rt.length==0 ) {
img.setAttribute("src","images/minus2.gif","0")
img.setAttribute("title","нет текущих задач","0")
return;
}
xsl.async = false;
xsl.load(newfile2 );
i=0;
var rw = table.rows;
for (i=0; i< rw.length-1; i++){
//if ( cnt.item(i).getAttribute("id") == tr.getAttribute("id") ) break;
//if ( cnt.item(i).getAttribute("id") == name ) break;
if ( rw.item(i).getAttribute("id") == name ) break;
}
var addRow = table.insertRow(i+1);
addRow.setAttribute("id", name+"00" );
var addCell2 = addRow.insertCell(0);
var addCell3 = addRow.insertCell(0);
var addCell1 = addRow.insertCell(0);
//addCell3.setAttribute("bgcolor","#F0F0F0","0");
addCell2.setAttribute("colspan","8","0");
addCell2.setAttribute("class","context","0");
//addCell2.setAttribute("bgcolor","#F0F0F0","0");
addCell3.innerHTML =" ";
addCell2 .innerHTML = xml.transformNode(xsl);
if ( tr.getAttribute("isOK") == null ) tr.setAttribute("isOK", '1');
if ( tr.getAttribute("isOK") == "0" ) tr.setAttribute("isOK", '1');
}