function produceaddress() {
	var randomsection = Math.random();
	var randompage = Math.random();
	var frlocation = "http://www.beerquarium.com";
	if (randomsection > .75) {
		frlocation = frlocation + "/classics/";
		if (randompage > .95) {frlocation = frlocation + "balls/"
		} else if (randompage > .875) {frlocation = frlocation + "cookie/"
		} else if (randompage > .8) {frlocation = frlocation + "gullible/"
		} else if (randompage > .75) {frlocation = frlocation + "marino/"
		} else if (randompage > .675) {frlocation = frlocation + "mistert/"
		} else if (randompage > .6) {frlocation = frlocation + "shocker/"
		} else if (randompage > .55) {frlocation = frlocation + "shocker/"
		} else if (randompage > .5) {frlocation = frlocation + "zete/"};
	} else if (randomsection > .5) {
		frlocation = frlocation + "/features/";
		if (randompage > .975) {frlocation = frlocation + "2002/"
		} else if (randompage > .95) {frlocation = frlocation + "2003/"
		} else if (randompage > .9) {frlocation = frlocation + "around/"
		} else if (randompage > .875) {frlocation = frlocation + "auction/"
		} else if (randompage > .84) {frlocation = frlocation + "bike/"
		} else if (randompage > .815) {frlocation = frlocation + "blunt/"
		} else if (randompage > .79) {frlocation = frlocation + "case0405/"
		} else if (randompage > .765) {frlocation = frlocation + "civil/"
		} else if (randompage > .74) {frlocation = frlocation + "drbill/"
		} else if (randompage > .715) {frlocation = frlocation + "duffman/"
		} else if (randompage > .685) {frlocation = frlocation + "homecoming/"
		} else if (randompage > .66) {frlocation = frlocation + "love/"
		} else if (randompage > .635) {frlocation = frlocation + "pistachio/"
		} else if (randompage > .61) {frlocation = frlocation + "res2003/"
		} else if (randompage > .585) {frlocation = frlocation + "res2004/"
		} else if (randompage > .55) {frlocation = frlocation + "thrillhouse/"
		} else if (randompage > .5) {frlocation = frlocation + "trip/"};
	} else if (randomsection > .45) {
		frlocation = frlocation + "/mylife/";
	} else if (randomsection > .3) {
		frlocation = frlocation + "/new/";
	};
	return frlocation;
};

function chop(fullstring,stringend) {
	var stringsplit=fullstring.split(stringend)
	var stringpieces=stringsplit.length
	var returnvar=(stringpieces>1)? stringsplit[0]+stringend : fullstring
	return returnvar
}

function contains(fullstring,substring) {
	var testmatch=fullstring.search(substring)
	var testresult=(testmatch>-1)
	return testresult
}

function picklogo() {
	var currentdomain=getdomain()
	var isdemocrat=contains(currentdomain,"democratjoke")
	var logo=isdemocrat? "djlogo" : "rjlogo"
	return logo
}

function getdomain() {
	var fullurl=window.location
	fullurl+=""
	fullurl=fullurl.toLowerCase()
	var filtered=chop(fullurl,"republ~1")
	filtered=chop(filtered,"republican%20joke")
	filtered=chop(filtered,"republicanjoke.com")
	filtered=chop(filtered,"republicanjokes.net")
	filtered=chop(filtered,"democratjoke.com")
	filtered+="/"
	return filtered
	return fullurl
}
