//-info
//-<a href="./?m=logout" onClick="return confirmLink(this,'Na pewno chcesz się wylogować?');">
function confirmLink(theLink, message)
{
	var is_confirmed = confirm(message);
	
	if (is_confirmed) {
		theLink.href += '&is_sure=1';
	}
	return is_confirmed;
}

//-zmiana
//-<a href="javascript:document.tmove.submit();" onClick="return confirmForm(is_sure,'Jesteś pewien że chcesz przenieść użytkowników do woj '+getText(document.tmove.to.value)+'?','1');">Przenieś tych użytkowników do woj:</a>
function confirmForm(formField, message, okValue)
{
	var is_confirmed = confirm(message);
	if (is_confirmed) {
		formField.value = okValue;
	}
	return is_confirmed;
}

//-kolory
//-<tr onmouseover="setPointer(this, '#C6EDBF')" onmouseout="setPointer(this, '#ffffff')">
function setPointer(theRow, thePointerColor)
{
	if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
		return false;
	}
	if (typeof(document.getElementsByTagName) != 'undefined') {
		var theCells = theRow.getElementsByTagName('td');
	}
	else if (typeof(theRow.cells) != 'undefined') {
		var theCells = theRow.cells;
	}
	else {
		return false;
	}
	
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {
		theCells[c].style.backgroundColor = thePointerColor;
	}
	
	return true;
}

function setPointerTD(theCell, thePointerColor)
{
	if (thePointerColor == '' || typeof(theCell.style) == 'undefined') {
		return false;
	}
	theCell.style.backgroundColor = thePointerColor;
	return true;
}

//-nowe okno
//-<a href="javascript: void(0);" onClick="return firstLogin();">Pierwsze logowanie</a>
function openSelectWindow(theURL,myWidth,myHeight,isCenter)
{
	if(window.screen)
		if(isCenter)
			var myLeft = 5;
	var myTop = 5;
	if(isCenter=="true"){
		myLeft = (screen.width-myWidth)/2;
		myTop = (screen.height-myHeight)/2;
	}
	
	okno = window.open(theURL,"Window",'location=0,directories=0,scrollbars=no,toolbar=0,menubar=0,resizable=0,status=0,width='+myWidth+',height='+myHeight+',left=' + myLeft+ ',top=' + myTop);
	return false;
}

function firstLogin(){
	okno = openSelectWindow('./?m=first-login',300,150,'true')
	return false;
}

function viewInfoSzkolenie(id){
	okno = openSelectWindow('./?m=info-szkolenia&id='+id,300,150,'true')
	return false;
}
//-view-pic-
function okno(fotka,myWidth,myHeight) {
	myLeft = (screen.width-myWidth)/2;
	myTop = (screen.height-myHeight)/2;
	window.open("modules/view_pic.php?name=" + fotka +"","MMB","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + myLeft + ",top=" + myTop + ",width=" + myWidth + ",height=" + myHeight + "");
	}

