function lwrite(layer, txt) {

        if (document.all)

                document.all[layer].innerHTML = txt;

}



function MenuColor(fontover, fontout, backover, backout) {

        this.fontover = fontover;

        this.fontout = fontout;

        this.backover = backover;

        this.backout = backout;



}



MenuColors = new Array();

MenuColors[0] = new MenuColor("#003300", "#000D87", "#cccc66", "#E6E6E6");





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(/^menu\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(4)].backover;

                        this.all.tags('A')[0].style.color=MenuColors[this.className.substring(4)].fontover;

                        this.style.cursor = "hand";

                }

                function td_out() {

                        this.style.backgroundColor = MenuColors[this.className.substring(4)].backout;

                        this.all.tags('A')[0].style.color=MenuColors[this.className.substring(4)].fontout;

                }

                function td_click() {

                        this.all.tags('A')[0].click();

                }

        }

}







function getDate() {

        date = new Date();

        year = date.getYear();

        if (year < 1000) year+=1900;

        day = date.getDay();

        month = date.getMonth();

        monthd = date.getDate();

        days = new Array("niedziela", "poniedzialek", "wtorek", "sroda", "czwartek", "piatek", "sobota");

        months = new Array("stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "wrzesnia", "pazdziernika", "listopada", "grudnia");

        str = days[day] + ", " + monthd + " " + months[month] + " " + year;

        return str;

}



function getTime() {

	date = new Date();

	hr = date.getHours(); 

	mn = date.getMinutes(); 

	sc = date.getSeconds(); 

	

	if (hr < 10) hr = "0" + hr;

	if (mn < 10) mn = "0" + mn;

	if (sc < 10) sc = "0" + sc;

	

	str = "<div class='zegarek'>" + "Witamy! Dziekujemy za odwiedzenie naszej strony, dzisiaj jest "+ getDate() + "," +  " "+ "godz. " + hr + ":" + mn + ":" + sc + "</div>";

	return str;

}



function runClock() {

	lwrite("czas", getTime());

}





function initMain() {

	

	setMenuColors();

	setInterval("runClock()", 1000);	

}




