function gotoo(noeud){ var path = noeud.parentNode.innerHTML.split('<')[0]; var spans = document.getElementsByTagName("span"); var wellspans = new Array(); var j = 0; for (var i=0; i0){ wellspans[j].getElementsByTagName("img")[0].parentNode.removeChild(wellspans[j].getElementsByTagName("img")[0]); } if (wellspans[j].getElementsByTagName("a").length>0) wellspans[j].getElementsByTagName("a")[0].style.backgroundColor=wellspans[j].parentNode.style.backgroundColor; j++; } } updateTooltipContent(noeud); if (document.getElementsByName(path).length>0){ document.getElementsByName(path)[0].style.backgroundColor="yellow"; appendImg(document.getElementsByName(path)[0].parentNode, getAlertType(noeud)); window.location.hash="#" + path; } else{ var wellsplits = new Array(); var list = path.split('/'); var w = 0; for (var i=0; i1){ var xxpath = new XPathElement(); xxpath.elementIndex = parseInt(ll[1]); xxpath.elementName = ll[0]; wellsplits[w] = xxpath; w++; } else{ var xxpath = new XPathElement(); xxpath.elementIndex = 0; xxpath.elementName = ll[0]; wellsplits[w] = xxpath; w++; } } } var root = new xmlNode(); extractXmlStructure(root); // alert(root.display(0)); var ell = extractElementByXpath(root, wellsplits); appendImg(ell, getAlertType(noeud)); ell.innerHTML = ell.innerHTML.anchor(path); ell.style.backgroundColor="yellow"; window.location.hash="#" + path; } } function updateTooltipContent(noeud){ var mess = getAlertContent(noeud); var divtt = getToolTipDiv('tooltip_content'); divtt.innerHTML = mess; divtt.className = getAlertType(noeud); } function getToolTipDiv(tooltipId){ if (document.getElementById(tooltipId) != null){ return document.getElementById(tooltipId); } else{ var divt = document.createElement("div"); divt.setAttribute("id", "tooltip_123"); divt.setAttribute("class", "xstooltip"); divt.style.fontFamily = 'Arial,Verdana,sans-serif'; divt.style.fontSize = '11px'; var divtc = document.createElement("div"); divtc.setAttribute("id", tooltipId); divt.appendChild(divtc); document.getElementsByTagName('body')[0].appendChild(divt); return divtc; } } function appendImg(ell, className){ var nImg = document.createElement("img"); if (className=="Warning") nImg.setAttribute("src", "/EVSClient/img/warning.gif"); if (className=="Error") nImg.setAttribute("src", "/EVSClient/img/error.gif"); if (className=="Note") nImg.setAttribute("src", "/EVSClient/img/info.png"); if (className=="Report") nImg.setAttribute("src", "/EVSClient/img/validation.gif"); nImg.setAttribute("onmouseover", "xstooltip_show('tooltip_123', this, 10, 10)"); nImg.setAttribute("onmouseout", "xstooltip_hide('tooltip_123');"); nImg.style.heigth='13px'; nImg.style.width='13px'; nImg.style.marginLeft = '5px'; nImg.style.verticalAlign='middle'; ell.appendChild(nImg); } function getAlertContent(noeud){ return noeud.parentNode.parentNode.parentNode.getElementsByTagName("tr")[2].getElementsByTagName("td")[1].innerHTML.substring(0,noeud.parentNode.parentNode.parentNode.getElementsByTagName("tr")[2].getElementsByTagName("td")[1].innerHTML.length - 15); } function getAlertType(noeud){ return noeud.parentNode.parentNode.parentNode.parentNode.className; } function extractElementByXpath(rootEl, xxp){ var ell = null; if (xxp.length == 1){ var j = 0; for(var i=0; i< rootEl.children.length; i++){ var tocompare = extractText(rootEl.children[i].element); if (tocompare == xxp[0].elementName){ if (j == xxp[0].elementIndex){ ell = rootEl.children[i].element; return ell; } else{ j++; } } } } else{ var j = 0; for(var i=0; i< rootEl.children.length; i++){ var tocompare = extractText(rootEl.children[i].element); if (tocompare == xxp[0].elementName){ if (j == xxp[0].elementIndex){ var ell1 = rootEl.children[i]; ell = extractElementByXpath(ell1, copieXPathWithDeleteOfFirstElemnt(xxp)); return ell; } else{ j++; } } } } return ell; } function copieXPathWithDeleteOfFirstElemnt(tab) { var res = new Array(); for (var i=1;i0) wellspans[j].getElementsByTagName("a")[0].style.backgroundColor=wellspans[j].parentNode.style.backgroundColor; j++; } if ((spans[i].className=="xml_tag_symbols") && (spans[i].innerHTML != '=')){ if ((spans[i].innerHTML == '><') || (spans[i].innerHTML == '></') || (spans[i].innerHTML == '/><') || (spans[i].innerHTML == '/></') ){ wellspans[j]=spans[i]; j++; wellspans[j]=spans[i]; j++; } else{ wellspans[j]=spans[i]; j++; } } } var ind = 0; populateChildrenXmlNode(xmlNoeud, ind, wellspans); } function populateChildrenXmlNode(xmlNoeud, ind, wellspans){ var end = false; while ((!end) && (ind < wellspans.length)){ if ((wellspans[ind].innerHTML=='<') || (wellspans[ind].innerHTML=='><') || (wellspans[ind].innerHTML=='/><')){ // < || >< || />< var child = new xmlNode(); child.element = wellspans[ind+1]; xmlNoeud.children.push(child); if ((wellspans[ind+2].innerHTML=='/>') || (wellspans[ind+2].innerHTML=='/><') || (wellspans[ind+2].innerHTML=='/></')){ // /> || />< || /> || >< || >0){ tocompare = noeud.getElementsByTagName('a')[0].innerHTML; } if (tocompare.indexOf(':') != -1) { tocompare = tocompare.split(':')[1]; } return tocompare; } function xmlNode(){ this.element = null; this.children = new Array(); xmlNode.prototype.display = function(childNumb) { var res = ''; if (this.element != null){ res = res + '\n'; for (var i=0; i<(childNumb+1); i++){ res = res + '-'; } res = res + this.element.innerHTML; } if (this.children.length >0){ for (var i=0; i