function highlightInterests(IDString)
{
	if (document.getElementById)
	{
		var elem = document.getElementById(IDString);
		if (elem == undefined)
			return;

		inputString = elem.innerHTML;

		
		/*
			Delimiters in hex:
			,	\x2C
			(	\x28
			)	\x29
			-	\x2D
			:	\x3A
			;	\x3B
			*	\x2A
			/	\x2F
			\	\x5C
			.	\x2E
			!	\x21
			?	\x3F
			{	\x7B
			}	\x7D
			[	\x5B
			]	\x5D
			+	\x2B
			Control chars in hex:
			<	\x3C
			>	\x3E
		*/
		var HTML = /([\x3C\x3E])/gi;
		var Items = /([^\s\x2C\x28\x29\x2D\x3A\x3B\x2A\x2F\x5C\x2E\x21\x3F\x7B\x7D\x5B\x5D\x2B]+([\s]+[^\s\x2C\x28\x29\x2D\x3A\x3B\x2A\x2F\x5C\x2E\x21\x3F\x7B\x7D\x5B\x5D\x2B]+)*)/g;
		var outputString = inputString;
		if (!HTML.test(outputString) && outputString.indexOf('<z>') == -1)
		{
			outputString = outputString.replace(Items, "<A HREF=\"#\" CLASS=\"searchlinksmall\" onclick=\"executeSearch('" + IDString + "',this.innerHTML);return false;\">$1</A>");
			document.getElementById(IDString).innerHTML = outputString;
		}
	}
}

function executeSearch(IDString, linkRef)
{
    var searchTerm = encodeURI(linkRef);
    var intType;
    if (IDString.search(/ProfileGeneral/) != -1)
        intType = "G";
    else if (IDString.search(/ProfileMusic/) != -1)
        intType = "Mu";
    else if (IDString.search(/ProfileMovies/) != -1)
        intType = "M";
    else if (IDString.search(/ProfileBooks/) != -1)
        intType = "B";
    else
    {
        location.href = "http://sads.myspace.com/index.cfm?fuseaction=advancedFind.results&searchtarget=tms&searchtype=myspace&t=tms&get=1&websearch=1&searchBoxID=HeaderWebResults&searchString=" + searchTerm + "&q=" + searchTerm;
        return;
    }
    location.href = "http://searchservice.myspace.com/index.cfm?fuseaction=search&searchBy=First&interestType=" + intType + "&f_search_criteria=" + searchTerm;
}
