function opened(id, width, height) {
 var Win = window.open("tresc/php/show.php?id=" + id,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no');
}

function openedn(clink, width, height) {
 var Win = window.open(clink,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no');
}

function openeds(clink, width, height) {
 var Win = window.open(clink,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no');
}

function addgroup(){
	document.promocja.grupy.value = document.promocja.grupy.value +  	document.promocja.istgrupy.value + " ,";
}

var timerID = null;
var timerRunning = false;

function stopclock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false;
}

function startclock()
{
    stopclock();
    showtime();
}

function showtime()
{
    var now = new Date();
	var day = now.getDay();
	var days = now.getDate();
	var month = now.getMonth();
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
	switch (day) {
		case 0: { day = 'Niedziela'; break; }
		case 1: { day = 'Poniedziałek'; break; }
		case 2: { day = 'Wtorek'; break; }
		case 3: { day = 'Środa'; break; }
		case 4: { day = 'Czwartek'; break; }
		case 5: { day = 'Piątek'; break; }
		case 6: { day = 'Sobota'; break; }
	}
	switch (month){
		case 0: { month = 'Styczeń'; break; }
		case 1: { month = 'Luty'; break; }
		case 2: { month = 'Marzec'; break; }
		case 3: { month = 'Kwiecień'; break; }
		case 4: { month = 'Maj'; break; }
		case 5: { month = 'Czerwiec'; break;}
		case 6: { month = 'Lipiec'; break; }
		case 7: { month = 'Sierpień'; break; }
		case 8: { month = 'Wrzesień'; break; }
		case 9: { month = 'Październik'; break; }
		case 10: { month = 'Listopad'; break; }
		case 11: { month = 'Grudzień'; break; }
	}
    var timeValue = "" + ((hours > 12) ? hours - 12 : hours);
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;
    timeValue  += (hours >= 12) ? "" : "";
	document.getElementById('zegar').innerHTML = day + ' ' + days + ' ' + month + ' ' +timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
}
