

var initFunctions = Array(0);

function addToOnLoad(functionName) {
	initFunctions[initFunctions.length] = functionName;
}


function init()  {
	for (var f = 0;f < initFunctions.length;f++) {
		eval(initFunctions[f] + "()");
	}	
}

var p = {};
function openPopup(url, w, h, scroll)
{
	if (!p[url] || p[url].closed)
		p[url] = window.open(url, '', 'resizable=no, menubars=no, copyhistory=no, status=no, scrollbars='+(scroll?'yes':'no')+', width='+w+',height='+h);
	p[url].focus();
	return false;
}

function closePopup()
{
	this.window.close();
	return false;
	
}

window.onload=init;

function helpResize()
{
window.resizeTo(416,document.body.scrollHeight+65);
}
/*
// make array of bg image source files
var bgArray = new Array();
// will need to know how many bg images there are and adjust n < ... accordingly
for (var n=0;n <30;n++) {bgArray[n] = "http://www.moorcockinn.co.uk/images/" + (n+1) + ".jpg";}

//preload the bg images
preloadIm = new Array(bgArray.length);
for (var i=0; i<bgArray.length ; i++) {
	preloadIm[i] = new Image(658,652);
	preloadIm[i].src=bgArray[i];
}
*/

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}