// Divs in IE don't auto adjust even if you put height of 100%.  This is to calculate the main content's height on page load and adjust accordingly
function adjustHeight() {

	mainBox = document.getElementById('mainc');
	startBox = document.getElementById('startc');
	bottomBox = document.getElementById('backToTop');
	mainMargin = document.getElementById('main_margin');
	leftSide = document.getElementById('leftc');
	rightSide = document.getElementById('rightc');
	
	bottomBoxHeight = bottomBox.offsetTop-startBox.offsetTop;
	mainHeight = Math.max(mainBox.offsetHeight, bottomBoxHeight);
	maxHeight = mainHeight;

	if (leftSide) {
		leftHeight = Math.max(leftSide.offsetHeight, leftSide.scrollHeight);
		maxHeight = Math.max(mainHeight, leftHeight);
	}

	if (rightSide) {
		rightHeight = Math.max(rightSide.offsetHeight, rightSide.scrollHeight);
		maxHeight = Math.max(maxHeight, rightHeight);
	}

	maxHeight = maxHeight + 'px';

	mainBox.style.height = maxHeight;
	if (leftSide)
		leftSide.style.height=maxHeight;

	if (rightSide)
		rightSide.style.height=maxHeight;

	mainMargin.style.height=maxHeight;
}
function toggleElement(elementname) {
    thisItem = document.getElementById(elementname);
    if (thisItem.style.display == 'none') {
        thisItem.style.display = 'inline';
    }
    else {
        thisItem.style.display = 'none';
    }
}

function toggleBullet(bulletname, bulleton, bulletoff) {
    thisItem = document.getElementById(bulletname);

    if (thisItem.style.listStyleImage=='url(' + bulleton + ')')
        thisItem.style.listStyleImage='url(' + bulletoff + ')';
    else
        thisItem.style.listStyleImage='url(' + bulleton + ')';
}

function showDiv(elementname) {
    thisItem = document.getElementById(elementname);
    thisItem.style.display = 'inline';
}
function hideDiv(elementname) {
    thisItem = document.getElementById(elementname);
    thisItem.style.display = 'none';
}

function openFileBrowser() {
	window.open('external/hydrogen/tinyfck/filemanager/browserd4ea.html?Connector=connectors/php/connector.php&amp;Type=File', 'Upload Video', "height=500,width=700,modal=yes,alwaysRaised=yes");
	return false;
}
