window.onload = init;

function init() {
	collapseHandler();
}

function collapseHandler() {
	domText = document.getElementById('content').getElementsByTagName('div')[0];
	if (domText.className == 'collapseText' && !domText.id) {
		collapseButton = document.createElement('a');
		collapseButton.className = 'collapseButton';
		collapseButton.href = 'javascript:;';
		collapseButton.onclick = collapse;
		domText.appendChild(collapseButton);
	}
}

function collapse() {
	try {document.getElementById('signup').style.display = 'none'} catch(e){};
	this.blur();
	this.parentNode.id = 'collapsed';
	this.onclick = uncollapse;
}

function uncollapse() {
	this.blur();
	this.parentNode.id = '';
	this.onclick = collapse;
	try {document.getElementById('signup').style.display = 'block'} catch(e){};
}

/* IE5 + IE6 fix */
function replacePNG() {
	image = document.getElementById('imageContainer').getElementsByTagName('img')[0];
	image.onload = function() {
		alphaSpan = '<span style="margin:0 auto;position:relative;display:block;';
		alphaSpan+= 'width:' + this.width + 'px;height:' + this.height + 'px;';
		alphaSpan+= 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader';
		alphaSpan+= '(src=\'' + this.src + '\', sizingMethod=\'scale\');">&#160;</span>';
		this.outerHTML = alphaSpan;
	}
}