
/* mmh/common/savedResources.js */

 
function repositionBg(){
	//IE6 in non-quirks doesnt get document.body.scrollTop:
	var pos = (document.body.scrollTop)?document.body.scrollTop:document.documentElement.scrollTop;
	document.getElementById("bg_fade").style.top = parseInt(pos) + "px";
}

onload = function(){
if(document.getElementById && !window.getComputedStyle && document.getElementById("bg_fade")){// DOM but not Mozilla
	document.getElementById("bg_fade").style.position = "absolute";
	window.onscroll = repositionBg;
	}
}
function fadeBg(userAction, whichDiv) {
	if(userAction == 'close'){
		new Effect.Opacity('bg_fade', {duration:.5, from:0.5, to:0, beforeUpdate:makeInvisible, afterUpdate:hideLayer(whichDiv)});
	}else{
		new Effect.Opacity('bg_fade', {duration:.5, from:0, to:0.5, beforeUpdate:makeVisible, afterUpdate:showLayer(whichDiv)});
	}
}
function makeVisible() {
	var el = document.getElementById("bg_fade");
	el.style.visibility = "visible";
}
function makeInvisible() {
	var el = document.getElementById("bg_fade");
	el.style.visibility = "hidden";
}
function showLayer(userAction) {
	var el = document.getElementById(userAction);
	el.style.display = "block";
}
function hideLayer(userAction) {
	var el = document.getElementById(userAction);
	el.style.display = "none";
}

function enableOtherBoxProj(whichOne){
	if(whichOne == 'other'){
		document.getElementById('otherSpecialty').disabled=false;
	}else{
		document.getElementById('otherSpecialty').disabled=true;
	}
}
function enableOtherBox(whichOne){
	if(whichOne == 'other'){
		document.getElementById('otherSpecialtyid1').disabled=false;
		document.getElementById('otherSpecialtyid2').disabled=false;
	}else{
		document.getElementById('otherSpecialtyid1').disabled=true;
		document.getElementById('otherSpecialtyid2').disabled=true;
	}
}
