/**
 * @author 		Léon Kwikkers
 * @copyright	Erasmus Universiteit Rotterdam, faculteit Sociale Wetenschappen
 * @name		include/js/psyweb.js
 */

function changeBgColor(layer, fromColor, toColor, state) {
	if (state == 'over') {
		if (!document.all) { 
			layer.style.backgroundColor = '#' + toColor;
			layer.style.borderLeft = 'solid 1px #FFFFFF';
			layer.style.borderRight = 'solid 1px #FFFFFF';
		}
	} else {
		if (!document.all) { 
			layer.style.backgroundColor = '#' + fromColor;
			layer.style.borderLeft = 'solid 1px #' + fromColor;
			layer.style.borderRight = 'solid 1px #' + fromColor;
		}
	}
	
}

function setHeight() {
	
//	var stdHeight = 125; // (height wanneer er geen footer text is)
	var stdHeight = 140;
	var stdFrmHeight = -2;
	var stdLlcHeight = 2;
	var noPx = document.childNodes ? 'px' : 0;
	var llc = document.getElementById('left-content');
	var lcc = document.getElementById('center-content');
	
	if (!lcc) { // define content iframe and set widths for IE
		lcc = document.getElementById('frmContent');
		// something went horribly wrong, exit to avoid javascript errors
		if( !lcc ) return ;
		//if (document.all && lcc.style.width.length == 5) { lcc.style.width = (lcc.style.width.substring(0, 3) - 2) + noPx; }
		//if (document.all && lcc.style.width.length == 6) { lcc.style.width = (lcc.style.width.substring(0, 4) - 2) + noPx; }
	}
	
	if (document.all) {
		lcc.style.height = document.documentElement.clientHeight - stdHeight;
		if (llc) { llc.style.height = document.documentElement.clientHeight - stdHeight + stdLlcHeight; }
		if (document.getElementById('frmContent')) { document.getElementById('frmContent').height = document.documentElement.clientHeight - stdHeight - stdFrmHeight; } 
		if (document.getElementById('frmContentRight')) { document.getElementById('frmContentRight').height = document.documentElement.clientHeight - stdHeight - stdFrmHeight; } 
	} else {
		lcc.style.height = (self.innerHeight - stdHeight) + noPx;
		if (llc) { llc.style.height = (self.innerHeight - stdHeight + stdLlcHeight) + noPx; }
		if (document.getElementById('frmContent')) { document.getElementById('frmContent').height = (self.innerHeight - stdHeight - stdFrmHeight) + noPx; } 
		if (document.getElementById('frmContentRight')) { document.getElementById('frmContentRight').height = (self.innerHeight - stdHeight - stdFrmHeight) + noPx; } 
	}

}

