function helpService()
{
	var path = document.getElementById("path");
	var pathValue = path.innerHTML.slice(0,177);

	var answer = document.getElementById("help_answer");
	var questions = answer.parentNode.getElementsByTagName("ul").item(0).getElementsByTagName("a");

	for( var i = 0; i < questions.length; i++ )
	{
		questions[i].onclick = function()
		{
			this.blur();
			var url = this.pathname + "?media=ajax";
			// IE fix
			if(url.slice(0,1) != "/") url = "/" + url;
			
			ajaxRequest(url, "GET", answer, null);
			clearAndSetQuestion(this);
			setPath(this);
			location.replace(location.pathname+"#help_answer");
			return false;
		}
	}
	
	function clearAndSetQuestion(q)
	{
		for( var i = 0; i < questions.length; i++ )
		{
			if(questions[i]==q) addClass(questions[i].parentNode,"active");
			else removeClass(questions[i].parentNode,"active");
		}
	}
	
	function setPath(elem)
	{
		var topic = elem.parentNode.parentNode.parentNode.getElementsByTagName("a").item(0);
		var topicHTML = '<span>&raquo;</span><a title="'+topic.innerHTML+'" href="'+topic.href+'">'+topic.innerHTML+'</a>';
		var questionHTML = '<span>&raquo;</span><a title="'+elem.innerHTML+'" href="'+elem.href+'">'+elem.innerHTML+'</a>';
		path.innerHTML = pathValue + topicHTML + questionHTML;
	}
}


addEvent(window,"load",helpService);
