// funkcje_dodatkowe.js
function ZamienZnaki(str)
{
	var str2 = str.replace(/ /g, "-");
	str2 = str2.replace(/,/, '-');
	str2 = str2.replace(/ą/, 'a');
	str2 = str2.replace(/ę/, 'e');
	str2 = str2.replace(/ś/, 's');
	str2 = str2.replace(/ć/, 'c');
	str2 = str2.replace(/ń/, 'n');
	str2 = str2.replace(/ł/, 'l');
	str2 = str2.replace(/ż/, 'z');
	str2 = str2.replace(/ź/, 'z');
	str2 = str2.replace(/ó/, 'o');

	str2 = str2.replace(/Ą/, 'A');
	str2 = str2.replace(/Ę/, 'E');
	str2 = str2.replace(/Ś/, 'L');
	str2 = str2.replace(/Ć/, 'C');
	str2 = str2.replace(/Ń/, 'N');
	str2 = str2.replace(/Ł/, 'L');
	str2 = str2.replace(/Ż/, 'Z');
	str2 = str2.replace(/Ź/, 'Z');
	str2 = str2.replace(/Ó/, 'O');

	return  str2.toLowerCase();
}

function CenterPopUp(pageUrl,pageTitle,pageWidth,pageHeight,pageSet) 
{
	if(screen){ 
	var page_width = pageWidth; 
	var page_height = pageHeight; 
	var page_set = pageSet; 
	var page_top = (screen.height-page_height)/2; 
	var page_left = (screen.width-page_width)/2; 
	openPage=window.open(''+ pageUrl + '',''+ pageTitle + '','width=' + page_width + ',height=' + page_height + ',top=' + page_top + ',left=' + page_left + ',pageSet=' + page_set + ''); 
	openPage.focus(); 
	} else { 
	openPage=window.open(''+ pageUrl + '',''+ pageTitle + ''); 
	openPage.focus(); 
	} 
}


function confirmLink(theLink, theSqlQuery)
{
    var confirmMsg  = 'Prosimy o potwierdzenie decyzji:';
	if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }
    var is_confirmed = confirm(confirmMsg + '\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '';
    }
    return is_confirmed;
}
function linkuj(url){window.location.href=url;}