imie  = ""
visit = 0
lastv = new Date()

days = new Array("Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota")
months = new Array("stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia")
today = new Date()

function setcookie(imie,counter)
{
	var expires = new Date()
	expires.setTime(today.getTime() + 1000*60*60*24*365*5)
	document.cookie = "Guest's info=" + counter + "," + today.toGMTString() +
		"$" + escape(imie)+	"; expires=" + expires.toGMTString()
	visit++
}


function accept(noweimie,count)
{
	var p = noweimie.toUpperCase()
	imie  = p.charAt(0) + noweimie.substring(1,noweimie.length)
	setcookie(noweimie,count-1)
	this.document.location.reload()
}


function ZmienImie()
{
	temp = prompt("Podaj nowe imię:",imie);
	if (temp!=null && temp!="") {
		accept(temp,visit-1)
		imie=temp
	}
}


function clear()
{
 setcookie("",1)
	this.document.location.reload()
}


function getCookie(search)
{
 if (document.cookie.length > 0) {
	offset = document.cookie.indexOf(search)
	if (offset != -1) {
		offset += search.length
		end = document.cookie.indexOf(";", offset)
		if (end == -1)
			end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
}


function detect()
{
 var guest = getCookie("Guest's info=")

 if(guest!=null) {
	var pos1= guest.indexOf(',')
	var pos2= guest.indexOf('$')

	visit	= guest.substring(0,pos1)
	imie	= guest.substring(pos2+1,guest.length)
	lastv = new Date(guest.substring(pos1+1,pos2))

	visit++
	setcookie(imie,visit)
 }
}

detect()

endYear = new Date("December 31, 2000")
endYear.setYear(today.getYear())
msPerDay = 24 * 60 * 60 * 1000
daysLeft = (endYear.getTime() - today.getTime()) / msPerDay
daysLeft = Math.round(daysLeft)

var correctwidth=800
var correctheight=600

 // do konca roku
 agent = navigator.userAgent;
 version = parseFloat(navigator.appVersion);
 
 isie4 = (
		(agent.indexOf("MSIE") != -1) &&
		(version >= 4)
				);

	if ( isie4 )  // stupid Netscape is to stupid to do this script sa I want it to do!
	{
	 document.write(days[today.getDay()]+', '+today.getDate()+' '+months[today.getMonth()]+
	' '+(today.getYear())+' r.');
	};
 

          
  
