var timerID = null;
var timerRunning = false;
function stopTimer()
	{	//stop the clock
		if(timerRunning);
			{	clearTimeout(timerID);
				timerRunning = false;
			};
	};
function startTimer()
	{	// Stop the clock (in case it's running), then make it go.
		stopTimer();
		runClock();
	};
function runClock()
	{	document.clock.face.value = timeNow();
		//Notice how setTimeout() calls its own calling function, runClock().
		timerID = setTimeout("runClock()",1000);
		timerRunning = true;
	};
function timeNow() 
	{	//Grabs the current time and formats it into hh:mm:ss am/pm format.
		now = new Date();
		hours = now.getHours();
		minutes = now.getMinutes();
		seconds = now.getSeconds();
		timeStr = ((hours > 12) ? hours  : hours);
		timeStr += ((minutes < 10) ? ":0" : ":") + minutes;
		timeStr += ((seconds < 10) ? ":0" : ":") + seconds;
		//timeStr += (hours >= 12) ? " PM" : " AM";
		return timeStr;
	};
// End of custom functions, stop hiding code -->



function clearDefault(EL) 
	{	if (EL.defaultValue == EL.value) EL.value = '';
	};


function winstat()
{	
//		var x=window.screen.width;	
//		var y=window.screen.height;
		var x=window.event.x;	
		var y=window.event.y;
		window.status=' ...::Autor Zbigniew Stolarski::...  X='+x+'  Y='+y;
//		return true;
};
function pokaz(idelementu)
{	var element = document.getElementById(idelementu);
	//element.style.display = "block";
	if (element.style.display != "block")
	{	element.style.display = "block";
	}
	else
	{	element.style.display = "none";	
	}
}

	

function SetFocus(id_input)
{	var el = document.getElementById(id_input);
	el.focus();
};


function validateForum(Forum)
{	if (!Forum.imie.value) 
	{	alert("Wypełnij pole imię!");
		return false;
	}else 
	{	return true;
	}
};

function validateForm(AForm)
{	//alert("Start Walidacja");
	if	(!AForm.imie.value) 
	{	alert("Wypełnij pole imię!");
		return false;
	}
	if	(!AForm.name.value) 
	{	alert("Wypełnij pole nazwisko!");
		return false;
	}
	if	(!AForm.email.value) 
	{	alert("Wypełnij pole e-mail!");
		return false;
	}

	return true;
}


function pokaz(plik, tytul, W, H)
{
	L=(screen.availWidth-W)/2;
	T=(screen.availHeight-H)/2;

	up="<"+"?xml version=\"1.0\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
   +" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
   +"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n   <title>"+tytul+"</title>\n</head>\n";

	mid="<body style=\"margin: 0; padding: 0;\">\n"
   +"   <img src=\"";

	bot="\" style=\"display: block;\" onclick=\"window.close();\" alt=\""+tytul+"\" />\n</body>\n</html>";
   
   Popup = window.open("","okno","width="+W+",height="+H+",left="+L+",top="+T+",resizable=no"); void(0);
   Popup.document.open();
   Popup.document.write(up+mid+plik+bot);
   Popup.document.close();
   Popup.focus();
}


