/** retrieves the content of a given link, and passes it
* back to the specified location.
*/
var lastArticleOpened;
function getArticle(sLink, sOutput) {
	try {
		/* first make contact with the output area
		*/
		var output = MM_findObj(sOutput);
		if (output) {
			/** insure that the article output area is empty, if not, then we're closing the article
			*/
			if (output.innerHTML == "") {
				/* create ajax instance
				*/
				var ajax = new Ajax();
				ajax.onSuccess = function(x, t) {
					try {
						/** clear open article
						*/
						if (lastArticleOpened && lastArticleOpened != this.output) {
							lastArticleOpened.innerHTML = "";
						}
						/** create close link
						*/
						var closelink = "<br /><div align=\"right\"><a href=\"javascript:;\" class=\"ArticleLink\" onclick=\"getArticle('none','" + this.output.id + "');\">(close article)</a></div>"
						/** add content to new article
						*/
						this.output.innerHTML = closelink + t + closelink;
						/** get new location of top of open article
						*/
						vScroll = window.kPosition.get(this.output);
						/** force a scroll to the top of the article
						*/
						window.scrollTo(vScroll.x, vScroll.y);
						/** inform the scripts of the currently open item
						*/
						lastArticleOpened = this.output;
					} catch (e) { Catch("oldsite/articles/js.js->getArticle.onSuccess(base)", e, true); };
				};
				ajax.output = output;
				ajax.send(sLink);
			} else {
				try {
					/** clear open article
					*/
					output.innerHTML = "";
					/** indicate that no articles are open
					*/
					lastArticleOpened = undefined;
				} catch (e) { Catch("oldsite/articles/js.js->getArticle(1)", e, true); };
			};
		};
	} catch (e) { Catch("oldsite/articles/js.js->getArticle(base)", e, true); };
};