var IE = (navigator.appName == "Microsoft Internet Explorer") ? 1 : 0;
var NS = (navigator.appName == "Netscape") ? 1 : 0;
var OP = (navigator.userAgent.indexOf('Opera')>0) ? 1 : 0;


function checkTheBox(n) {
	var box = (!document.all ? document.getElementById("c"+n) : document.all["c"+n] );
	var anchor = (!document.all ? document.getElementById("a"+n) : document.all["a"+n] );

	if (box.checked) {
		box.checked = false;
		anchor.style.color = "#CC0000";
		anchor.style.fontWeight = "bold";
		}
	else {
		box.checked = true;
		anchor.style.color = "#008800";
		anchor.style.fontWeight = "bold";
		}
	}

function checkTheBoxH(n) {
	var box = (!document.all ? document.getElementById("c"+n) : document.all["c"+n] );
	var anchor = (!document.all ? document.getElementById("a"+n) : document.all["a"+n] );
	box.checked = true;
	anchor.style.color = "#008800";
	anchor.style.fontWeight = "bold";
	}
function uncheckTheBoxH(n) {
	var box = (!document.all ? document.getElementById("c"+n) : document.all["c"+n] );
	var anchor = (!document.all ? document.getElementById("a"+n) : document.all["a"+n] );
	box.checked = false;
	anchor.style.color = "#CC0000";
	anchor.style.fontWeight = "bold";
	}

function checkTheBoxW(n) {
	var box = (!document.all ? document.getElementById("cw"+n) : document.all["cw"+n] );
	var anchor = (!document.all ? document.getElementById("aw"+n) : document.all["aw"+n] );
	if (box.checked) {
		box.checked = false;
		anchor.style.color = '#CC0000';
		}
	else {
		box.checked = true;
		anchor.style.color = "#008800";
		}
	}

var daily = false;

function setDaily() {
	for (n=1;n<=7;n++) {
		box = (!document.all ? document.getElementById("cw"+n) : document.all["cw"+n] );
		anchor = (!document.all ? document.getElementById("aw"+n) : document.all["aw"+n] );
		box.checked = (!daily ? true : false );
//		anchor.style.color = (!daily ? "red" : "black");
		anchor.style.color = (!daily ? "#FF0000" : '#000000');
//		anchor.style.fontWeight = (!daily ? "bold" : "normal");
		}
	daily = !daily;
	}



function expandRow(id) {
	var td1 = (!document.all ? document.getElementById('cr'+id+'_1') : document.all['cr'+id+'_1'] );
	var td2 = (!document.all ? document.getElementById('cr'+id+'_2') : document.all['cr'+id+'_2'] );
	var cr = getCookie('cr['+id+']');

	if (cr == 1) {
		td1.style.visibility = 'hidden';
		td1.style.display = 'none';
		td2.style.visibility = 'hidden';
		td2.style.display = 'none';
		setValue('cr['+id+']', 0);
		document.images['cr'+id].src = './images/plus.gif'
		}
	else {
		td1.style.visibility = 'visible';
		td1.style.display = (NS || OP ? 'table-cell' : 'inline');
		td2.style.visibility = 'visible';
		td2.style.display = (NS || OP ? 'table-cell' : 'inline');
		setValue('cr['+id+']', 1);
		document.images['cr'+id].src = './images/minus.gif'
		}
//	setCookie()
	}


var sh = new Array();

function showHelp(id) {
	var layer = (!document.all ? document.getElementById('h'+id) : document.all['h'+id]);
	if (sh[id] == 1) {
		layer.style.visibility = 'hidden';
		layer.style.display = 'none';
		sh[id] = 0;
		}
	else {
		layer.style.visibility = 'visible';
		layer.style.display = 'block';
		sh[id] = 1;
		}
	}
