function del_confirm(link, elem_name) {
	if(confirm("Czy na pewno chcesz usunąć "+elem_name+"?")) location.href=link;
	}

function open_help_window(file) {
	sY = 10;
	sX = 300;
	window.open(file,'wi','toolbar=no location=no,directories=no,status=yes,menubar=no, scrollbars=no,resizable=yes,fullscreen=no,channelmode=no,width='+sX+',height='+sY+',top=10,left=10');
	}
function open_passwd_window(file) {
	sY = 280;
	sX = 400;
	window.open(file,'wi','toolbar=no location=no,directories=no,status=yes,menubar=no, scrollbars=no,resizable=no,fullscreen=no,channelmode=no,width=436,height=260,top=10,left=10');
	}


function plToLower(str) {
	bigChars = new Array('Ą', 'Ć', 'Ę', 'Ł', 'Ń', 'Ó', 'Ś', 'Ź', 'Ż');
	smallChars = new Array('ą', 'ć', 'ę', 'ł', 'ń', 'ó', 'ś', 'ź', 'ż');
	str = str.replace('Ą', 'ą');
	str = str.replace('Ć', 'ć');
	str = str.replace('Ę', 'ę');
	str = str.replace('Ł', 'ł');
	str = str.replace('Ń', 'ń');
	str = str.replace('Ó', 'ó');
	str = str.replace('Ś', 'ś');
	str = str.replace('Ź', 'ź');
	str = str.replace('Ż', 'ż');
	return str;
	}


function Replace( strString, strFind, strReplace ) {
	var intIndex = 0;
    var strBuffer = "" + strString;     // Force copy by value using ""
    // Look for the occurance of strFind
		intIndex = strBuffer.indexOf( strFind, intIndex );
    while( intIndex >= 0 ) {
    	// If found then get the first part of the string, the replace string, and the last part.
        strBuffer =	strBuffer.substring( 0, intIndex ) +
                    strReplace +
                    strBuffer.substring( intIndex + strFind.length );
        // Find the next occurance.  Start search after the last replacement.
        intIndex = strBuffer.indexOf( strFind, intIndex + strReplace.length );
     }
     return strBuffer;
	}



function isValidName(text) {
	var telnoRegxp = "^([0-9a-zA-Z]+)$";
	var regex = new RegExp(telnoRegxp);
	if (regex.test(text) != true) return false;
	return true;
	}
