	function unreadarticle(whichdiv,resourceid,msina){
		var args = "http://www.gammonvillage.com/backgammon/article_unread_ajax.cfm?unread=" + resourceid + "&msina=" + msina;
		var b = loadFragmentInToElement(args, whichdiv);
	}

	function loadFragmentInToElement(fragment_url, element_id, hash) {
		var element = document.getElementById(element_id);
		element.innerHTML = '<img src="http://www.gammonvillage.com/backgammon/images/shim.gif" height="175" width="1" border="0"><span style="position:relative; top:-90px; left:225px;"><img src="http://www.gammonvillage.com/backgammon/ecom/twirl.gif" border="0" width="32" height="32" style="position:relative; top:10px;"><strong><em><font size="3">&nbsp;&nbsp;&nbsp;Loading...</font></em></strong></span>';
		setTimeout( "finishload('" + fragment_url +"','" + element_id + "');", 1); 
	}
		
function finishload(sourceUrl, elementSelector) {
	$("#"+elementSelector+"").load("http://www.gammonvillage.com/backgammon/magazine/"+sourceUrl+"");
}

// move browser focus to top of window
function moveWindow (){
	//window.location.hash="#top";
	$.scrollTo( { top:0, left:0}, 0 );
}

function go(thisyear, thispage, thisfragment, whichtemplate, thisfc, thistut)
{
	if (thisfc == 0) {
		var fc = "";
	}
	else {
		var fc = "&show_fc=" + thisfc;
	}
	if (thistut == 0) {
		var tut = "";
	}
	else {
		var tut = "&show_tutorial=" + thistut;
	}

	if (thisyear == 0) {
		javascript:loadFragmentInToElement(whichtemplate + '?usefragment=' + thisfragment + fc + tut,'leftcontent',thispage);
	}
	else {
		javascript:loadFragmentInToElement(whichtemplate + '?showyear=' + thisyear + '&usefragment=' + thisfragment + fc + tut,'leftcontent',thispage);
	}
}

function go2(thisauthor, thispage, thisfragment, whichtemplate, thisdirection)
{
	if (thisauthor == '') {
		javascript:loadFragmentInToElement(whichtemplate + '?usefragment=' + thisfragment,'leftcontent',thispage);
	}
	else {
		javascript:loadFragmentInToElement(whichtemplate + '?showauthor=' + thisauthor + '&usefragment=' + thisfragment,'leftcontent',thispage);
	}
}

function go3(thisdirection, thispage, thisfragment, whichtemplate)
{
	if (thisdirection == '') {
		javascript:loadFragmentInToElement(whichtemplate + '?usefragment=' + thisfragment,'leftcontent',thispage);
	}
	else if (thisdirection == 1 || thisdirection == 2 || thisdirection == 3) {
		javascript:loadFragmentInToElement(whichtemplate + '?thisdirection=' + thisdirection + '&usefragment=' + thisfragment,'leftcontent',thispage);
	}
	else {
		javascript:loadFragmentInToElement(whichtemplate + '?usefragment=' + thisfragment,'leftcontent',thispage);
	}
}

function go4(thiscolumn, thispage, thisfragment, whichtemplate, thisdirection)
{
	javascript:loadFragmentInToElement(whichtemplate + '?show_fc=' + thiscolumn + '&usefragment=' + thisfragment,'leftcontent',thispage);
}

function saveAjaxSection() {
	var currentContent = document.getElementById( "leftcontent" ).innerHTML ;
	document.getElementById( "ajaxSaveField" ).value = currentContent ;
}
	
function reloadAjaxPanels(){
	var previousContent = document.getElementById( "ajaxSaveField" ).value ;
	if ( previousContent.length > 0 ) {
		document.getElementById( "leftcontent" ).innerHTML = previousContent ;
	}
}
