// *** JSF Main Routines
// *** (c) feel by fish, http://www.imagen.pl

// --- netscape resize bugfix
if (document.layers) {
	widthCheck = window.innerWidth
	heightCheck = window.innerHeight
	window.onResize = resizeFix
}
function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
		document.location.href = document.location.href
}

// --- some core functions
function formatDate(date) {
	year = date.getYear();
	if (year < 1000) year+=2000;
	s = new String(year);
	day = date.getDate();
	if (day<10) day = "0" + day;
	monthd = date.getMonth() + 1;
	if (monthd<10) monthd = "0" + monthd;
	return (day + "/" + monthd + "/" + s);
}

// --- menu functions
function MenuColor(fontover, fontout, backover, backout) {
	this.fontover = fontover;
	this.fontout = fontout;
	this.backover = backover;
	this.backout = backout;
}

MenuColors = new Array();
MenuColors[1] = new MenuColor("#7E0000", "#A0A0A0", "#FFFFFF", "#F5F5F5");

function setMenuColors() {
	if(document.all) {
		td_tags = document.all.tags("TD");
		for(var i=0; i<td_tags.length; i++)
			if(td_tags[i].className.match(/^menubox\d$/) != null) {
				td_tags[i].onmouseover = td_over;
				td_tags[i].onmouseout = td_out;
				td_tags[i].onclick = td_click;
			}
		
		function td_over() {
			this.style.backgroundColor = MenuColors[this.className.substring(7)].backover;
			this.all.tags('A')[0].style.color=MenuColors[this.className.substring(7)].fontover;
			this.style.cursor = "hand";
		}
		function td_out() {
			this.style.backgroundColor = MenuColors[this.className.substring(7)].backout;
			this.all.tags('A')[0].style.color=MenuColors[this.className.substring(7)].fontout;
		}
		function td_click() {
			this.all.tags('A')[0].click();
		}
	}
}


// --- main init
function initMain() {
	setMenuColors();
}


