// detect referrer
var showButtons = false;
var codeToWrite = "";
var myquery = document.location.search;
myquery = myquery.substring(myquery.lastIndexOf("?"));
//gets everything after and including the question mark

var buttonCode1 = '<div class="navcolortabs" align="center"><ul>';
buttonCode1 += '<li type="none"><a href="http://store.kagi.com/?6FAEM_LIVE&lang=en" style="margin-left: 12px"><span>Order Software</span></a></li>';
buttonCode1 += '<li type="none"><a href="http://www.creatingmusic.com" style="margin-left: 12px"><span>Creating Music Homepage</span></a></li></ul>';
buttonCode1 += '</div>';

var buttonCode2 = '<div class="navcolortabs" align="center"><ul>';
buttonCode2 += '<li type="none"><a href="http://www.alfred.com/alfredweb/front/SearchResult.aspx?BrowseBy=Artist&Artist=Subotnick,%20Morton" style="margin-left: 12px"><span>Back to Alfred Music Publishing</span></a></li></ul>';
buttonCode2 += '</div>';

if ( myquery.indexOf("m") >= 0)
	{//if there is an m in the query string value
	showButtons = "m";
	//alert ("Show Buttons");
	codeToWrite = buttonCode1;
	} else if ( myquery.indexOf("a") >= 0)
	{//if there is an a in the query string value
	showButtons = "a";
	//alert ("Show Buttons");
	codeToWrite = buttonCode2;
	}
	
function golink(thisurl)
	{
	var thisLink = thisurl;
	if (showButtons)
		{
		thisLink += myquery;
		//alert(thisLink);
		}
	document.location = thisLink;
	}
	
