function addqaissueattrs ()
{
    var issuefoundtext = document.createTextNode("This file has a quality issue. Click on the yellow text to find out more.");
    var mypara = document.createElement("p");
    mypara.appendChild(issuefoundtext);
    myb = document.getElementsByTagName("body")[0];
    myb.appendChild(mypara);
    var spanlist = document.getElementsByTagName('span');
    for(i=0; i<spanlist.length; i++) {
	if(spanlist[i].getAttribute('its-loc-quality-issues-ref') != '') { 
	    spanlist[i].setAttribute("onclick","getqaissue(this.getAttribute('its-loc-quality-issues-ref'))");
	    spanlist[i].setAttribute("class","qaissue");  
	}
    }
}
function getqaissue (qiref) {
    var issueslist = new String;
    var parser = new DOMParser();
    var standoffits = document.getElementById('lq1').textContent;
    var doc = parser.parseFromString(standoffits,'application/xml');
    var locqualityissues = doc.getElementsByTagNameNS('http://www.w3.org/2005/11/its','locQualityIssues');
    for(i=0; i<locqualityissues.length; i++)
    {
	if (locqualityissues[i].getAttribute('xml:id') == qiref.substr(1));
	{	
	    var issues = locqualityissues[i].childNodes;}
	var issueslist = new String;
        for(i=0; i<issues.length; i++) {
	    if(issues[i].nodeType==1) { issueslist = issueslist +
					issues[i].getAttribute('locQualityIssueType') + " "; } }
    }
    window.alert("QA issues found. Type(s) of issues: " + issueslist);
}