

function init(page)
{
	// limit width to between 779 and 1003
	if (document.all) {
		var thePage = document.getElementById('page');
		var theWidth = getWidth(thePage);
		if (theWidth>1003) thePage.style.width = "1003px";
		if (theWidth<779)  thePage.style.width = "779px";
	}
	setHeight(document.getElementById('bodyBlock'));

	switch (page)
	{
		case	"emailReminder":
		case	"iContact":
		case	"memberCheck":
		case	"checkout":
		{
			getVerificationImage('');
			break;
		}
	}
}
// ** Various Utilities used throughout site **

// ** Show currency converter for Value 'thePrice' **
function cConvert(thePrice) {
	var theURL="http://www.xe.net/pca/input.cgi?amount="+thePrice+"&From=AUD";
	CurrencyWindow = window.open (theURL, 'CurrencyWindow', 'toolbar=0,location=0,directories=0=0,menubar=0,scrollbars=0,resizable=1,height=170,width=600');
	CurrencyWindow.focus();
}

// ** Set columns to correct heights or summat **
function getWidth(theEl)
{
	return (theEl.currentStyle) ? theEl.offsetWidth : stripPX(document.defaultView.getComputedStyle(theEl,'').width);
}
function getHeight(theEl)
{
	return (theEl.currentStyle) ? theEl.offsetHeight : stripPX(document.defaultView.getComputedStyle(theEl,'').height);
}
function stripPX(theValue)
{
	return (theValue.substring(0, theValue.length - 2) - 0);
}
function setHeight(element)
{
	leftSideHeight  	= getHeight(document.getElementById("leftColumn"));
	rightSideHeight 	= getHeight(document.getElementById("rightColumn"));
	contentColumnHeight = getHeight(document.getElementById("contentColumn"));

	tallestColumn   	= (leftSideHeight > rightSideHeight)	? leftSideHeight	: rightSideHeight;
	tallestColumn   	= (tallestColumn > contentColumnHeight) ? tallestColumn 	: contentColumnHeight;

	if (element.style.minHeight)
	{
		element.style.minHeight = tallestColumn+"px";
	}
	else
	{
		element.style.height	= tallestColumn+"px";
	}

	limitWidth();
}

function limitWidth() {
	// set minimum width (for those browsers too pathetic to recognise min-width *cough*Explorer*cough*)
	var pageEl = document.getElementById("page");
	var pageWidth = getWidth(pageEl);
	if (pageWidth<779) pageEl.style.width="779px";
}

// ** Make dropdown menus work in Explorer **
sfHover = function() {
	var sfEls = document.getElementById("navHome").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);