var req;var srcpage;
function in001() {document.getElementById('tags').innerHTML = "<img border=\"0\" src=\"images/indicator.gif\" width=\"16\" height=\"16\"> Loading Tags... Please wait...";
}function loadMatTags(st) {
	srcpage = st;
	in001();
	document.getElementById('tStart').innerHTML = st;
	qryurl = "getyptags.jsp?start=" + st;
	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {req = new XMLHttpRequest();	req.onreadystatechange = processctags;
		req.open("GET",qryurl , true);	req.send(null);	} else if (window.ActiveXObject) {	
		req = new ActiveXObject("Microsoft.XMLHTTP");		if (req) {		
			req.onreadystatechange = processctags;			req.open("GET", qryurl, true);
			req.send();		}		}}
function processctags() {	if (req.readyState == 4) {
		if (req.status == 200) {	d898();	} 	
		else{document.getElementById('tags').innerHTML ="<font color=\"red\">Unable to get the tags. Please try later.</font>"}
	}
}
function d898() {	
	t = "";
	try{		ctags = req.responseXML.getElementsByTagName("ctag");
		if(ctags){			tagCount = ctags.length;
			if(tagCount > 0 ){				t = "";
				atag = "";	j=0;			for(i=0; i<tagCount; i++ ){
					if(ctags[i].firstChild){						atag = ctags[i].firstChild.nodeValue;
					j += atag.length;
					if(j >= 60){
						t += "<br>";j=0;
					}
					t += "<a href=\"tag/" + encodeURIComponent(atag) +"\">" + atag + "</a>&nbsp;&nbsp;&nbsp;";

					}				}
				
			}
			else{t ="<font color=\"red\">No matching categories found that starts with '<b>" + srcpage +"</b>'</font>";}
			}	}	
	catch(e)	{	}document.getElementById('tags').innerHTML = t;
}
