// cornerpng-rotate.js

var scriptpath = 'http://sehrgut.co.uk/testbed/cornerpng.php?guid=';
var divstyle = 'float: left; position: absolute; left: 0px; top: 0px; z-index: 10;';
var prob = 0.5;

var guids = new Array();
var titles = new Array();
var links = new Array();

banner(	'2dec24f90e13937fac47f2da563fede0',
		'Joshua 24:15 - And if it seem evil unto you to serve the LORD, choose you this day whom ye will serve; whether the gods which your fathers served that were on the other side of the flood, or the gods of the Amorites, in whose land ye dwell: but as for me and my house, we will serve the LORD.',
		'http://kjv.sehrgut.co.uk/Joshua/24.php#15');

banner( 'e2eee6d6857cbc32d1ce48d29546c7dd',
		'Psalm 27:8 - When thou saidst, Seek ye my face; my heart said unto thee, Thy face, LORD, will I seek.',
		'http://kjv.sehrgut.co.uk/Psalms/27.php#8');

banner(	'fa0726a2c4d66886ba9502601d2cb8e9',
		'Nine Reasons Why Abortions Should Be Illegal: an answer to Planned Parenthood\'s "Nine Reasons Why Abortions Should Be Legal".',
		'http://www.mrdata.net/books/9reasons.htm');

banner(	'eead5e5cc50e29c0b99218f42080ceaf',
		'Free Lebanon: Lebanese Foundation for Peace',
		'http://www.free-lebanon.com/');

banner( 'e20f169926af812ab0a4d2eed365edfd',
		'The Libertarian Party: the Party of Principle. We support everyone\'s rights, whether or not we agree with them. Can you say that about your party?',
		'http://lp.org/');

banner(	'747a1c1f7c47d5f0656605306765dc6f',
		'The World\'s Smallest Political Quiz, from the Advocates for Self-Government. Take the quiz and find out where you fit on the political map.',
		'http://www.theadvocates.org/quiz.html');

banner(	'61b97d022601788f4f5c3247c78eb104',
		'Bad Cop! No Doughnut! Police brutality and power-tripping at its worst.',
		'http://nodonut.egoweblog.com/');

banner( '9963a11a5a2663a3f7e4094d2aa2a30c',
		'Do you care enough about violence, life, death, liberty and slavery to put in the effort to get the facts about guns? GunsAndCrime.org is one of the best-researched firearms-law resources available. All data are carefully cited, allowing you to make your own decisions based on the truth, rather then pro- or anti-gun rhetoric.',
		'http://gunsandcrime.org/');

function banner(guid,title,link) {
	var len = guids.length;
	guids[len] = guid;
	titles[len] = title;
	links[len] = link;
	}

function showTag() {
	var len = guids.length;
	var n = Math.round(Math.random()*(len-1));
	var src = scriptpath + guids[n];
	document.write('<div style="' + divstyle + '">');
	document.write('<a href="' + links[n] + '" title="' + titles[n] + '">');
	document.write('<img id="cornerpng" src="' + src + '" border="0" /></a>');
	document.write('</div>');
	}

function decideProb() {
	var n = Math.round(Math.random()*100);
	if( n > prob*100) {
		return false;
		}
	else {
		return true;
		}
	}

function cpOnLoadFunction(headerid,headerhtunits,contentid,contenthtunits,contentnwidth,contentwunits) {
	if(document.getElementById) {
		headerht = document.getElementById(headerid).height;

		var thediv = document.getElementById(contentid);
		thediv.style.position = 'absolute';

		if(document.getElementById('cornerpng')) {
			cornerht = document.getElementById('cornerpng').height;
			thediv.style.top = cornerht/2 + headerhtunits;
			}
		else {
			thediv.style.top = headerht + headerhtunits;
			thediv.style.width = contentnwidth + contentwunits;
			thediv.style.marginLeft = '0';
			}
		}
	}

if(decideProb()){ showTag(); }
