	var nodeAdded;

	nodeAdded = false;
	tagList = new Array();
	count = 0;
	function catchCat(caller)
		{

			myNode = document.getElementById('galleryHook').parentNode;

			if (nodeAdded == false)
				{

				var z=document.createElement('p');
				z.id = "myPara";
				z.name = "myPara";
				document.getElementById('galleryHook').parentNode.appendChild(z);			
				var x=document.createElement('a');
				x.id = "myAnchor";
				x.name = "myAnchor";
				document.getElementById('myPara').appendChild(x);

				var y=document.createElement('span');
				y.id = "myAnchorSpan";
				y.name = "myAnchorSpan";
				document.getElementById('myPara').appendChild(y);

				document.getElementById("myAnchor").style.color = '#800000';
				document.getElementById("myAnchor").style.fontWeight = 'bold';
				document.getElementById("myAnchor").style.position = 'relative';

				quoteCaller = caller.replace("QQQQQ", "%27");
				newCaller = quoteCaller.replace("_", " ");
				displayText = unescape(newCaller);
				y = document.createTextNode("Search for: " + displayText);
				document.getElementById("myAnchor").appendChild(y);
				document.getElementById("myAnchor").alt = "Click to launch gallery";
				document.getElementById("myAnchor").href = "http://www.cathbond.com/gallery/tags/" + caller;

				var a=document.createElement('p');
				a.id = "myClear";
				a.name = "myClear";
				document.getElementById('galleryHook').parentNode.appendChild(a);			
				var b=document.createElement('a');
				b.id = "myClearAnchor";
				b.name = "myClearAnchor";
				document.getElementById("myClear").appendChild(b);

				document.getElementById("myClearAnchor").style.color = '#800000';
				document.getElementById("myClearAnchor").style.fontWeight = 'bold';
				document.getElementById("myClearAnchor").style.position = 'relative';

				c = document.createTextNode("Clear this search");
				document.getElementById("myClearAnchor").appendChild(c);
				document.getElementById("myClearAnchor").alt = "Click to clear this search";
				document.getElementById("myClearAnchor").href = "gallery";

				
				tagList[count] = caller;
				nodeAdded = true;
				count ++;
				}

				inArray = false;

				for (a=0;a < count + 1 ;a++)
					{
					if (tagList[a] == caller)
						{
						inArray = true;
						}
					}
					
					if (inArray == false)
						{
						quoteCaller = caller.replace("QQQQQ", "%27");
						newCaller = quoteCaller.replace("_", " ");
						displayText = unescape(newCaller);
						document.getElementById("myAnchor").href += "/" + caller;
						y = document.createTextNode(" AND " + displayText);
						document.getElementById("myAnchor").appendChild(y);
						tagList[count] = caller;
						count++;
						}
				tagCopy = tagList
				sndReq(tagCopy);
		}
