var monitor_opacity = 0;
var mode;
mode = "on";
function switch_monitor(){
	if(mode == "on"){
		document.getElementById('monitor').style.visibility = "visible";
		document.getElementById('monitor').style.opacity = 0;
		document.getElementById('switch_button').style.background = "url(/images/off.png)";
		mode = "off";
	}
	else{
		document.getElementById('switch_button').style.background = "url(/images/on.png)";
		mode = "on";
	}
}
function monitor_bg(){
	if(mode == "off"){
		document.getElementById('monitor').style.zIndex = 1000;
		if(monitor_opacity<1){
			monitor_opacity = monitor_opacity+0.05;
			document.getElementById('monitor').style.opacity = monitor_opacity;
		}
	}
	if(mode == "on"){
		if(monitor_opacity>0){
			monitor_opacity = monitor_opacity-0.05;
			if(monitor_opacity < 0.1){
				document.getElementById('monitor').style.zIndex = -1;
			}
			document.getElementById('monitor').style.opacity = monitor_opacity;
		}
	}
}
setInterval('monitor_bg()',20);
function switch_button_over(){
	if(mode == "on"){
		document.getElementById('switch_button').style.background = "url(/images/off.png)";
	}
	else{
		document.getElementById('switch_button').style.background = "url(/images/on.png)";
	}
}
function switch_button_out(){
	if(mode == "on"){
		document.getElementById('switch_button').style.background = "url(/images/on.png)";
	}
	else{
		document.getElementById('switch_button').style.background = "url(/images/off.png)";
	}
}
