function myload( ){
// f = new ActiveXObject("Microsoft.XMLDOM");
//if ( errorCode == 1) alert("Вы не можете удалить проект\nтак как в нем есть задачи"};
xml = new ActiveXObject("Microsoft.XMLDOM");
xsl = new ActiveXObject("Microsoft.XMLDOM");
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
href = document.location.href;
pos = href.lastIndexOf("/");
pos2 = href.lastIndexOf(".");
path = href.substring(0,pos);
file = href.substring(pos,pos2);
newfile = path+"/getData.aspx";
newfile2 = path+"/xsl/getData.xslt";
}
function getWorks( id ){
if (id==0) return;
name_im = 'im_t'+id;
var isOk = document.getElementById('work'+id);
var img = document.getElementById( name_im );
if (isOk != null){
if (isOk.getAttribute("visible") == "1")
{
img.setAttribute("src","images/plus.gif","0")
var parentTag = isOk.parentNode;
parentTag.removeChild( isOk);
return;
};
}
var table = document.getElementById('task'+id);
img.setAttribute("src","images/minus.gif","0")
i = id;
name='work'+i;
var t1 = document.createElement('<table title="задачи" width="100%" id="'+name+'" >');
t1.setAttribute("visible", '1');
xmlhttp.Open("POST", newfile , false);
xmlText = '<root><getTask id="'+id+'" /></root>';
xmlhttp.Send(xmlText);
xml.loadXML(xmlhttp.responseText);
var rt = xml.getElementsByTagName("work");
if ( rt.length==0 ) {
img.setAttribute("src","images/minus2.gif","0")
img.setAttribute("title","нет текущих работ","0")
return;
}
xsl.async = false;
xsl.load(newfile2 );
var r0 = t1.insertRow(0);
var c1 = r0.insertCell(0)
c1.innerHTML = xml.transformNode(xsl);
var addRow = table.insertRow( -1 );
var addCell2 = addRow.insertCell(0);
var addCell1 = addRow.insertCell(0);
addCell2.setAttribute("colspan","8","0");
addCell1.innerHTML = '';
addCell2.innerHTML = t1.outerHTML;
}