function openWindow(file,x,y) {
	x+=16;
	y+=16;
	var left=(screen.width - x)/2;
	var top=(screen.height - y)/2;
	var options='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+x+',height='+y+',left='+left+',top='+top;
	window.open(file,"Window",options); 
}


function getStyle(e,style) {
	if (e.currentStyle)
		var val=e.currentStyle[style];
	else if (window.getComputedStyle)
		var val=document.defaultView.getComputedStyle(e,null).getPropertyValue(style);
	return val;
}


function confirmAction(address) {
	if (confirm('Czy na pewno chcesz usunac pozycje ?'))
		window.parent.location=address;
}

function confirmGalRemove(address) {
	if (confirm('Czy na pewno chcesz usunac galerie ? Wszystkie zdjęcia w niej zawarte zostaną również trwale usunięte.'))
		window.parent.location=address;
}

function showElement(elem,value) {
	if (value)
		document.getElementById(elem).style.display="block";
	else
		document.getElementById(elem).style.display="none";
}

function trigger(elem) {
	if (document.getElementById(elem).style.display=="block")
		document.getElementById(elem).style.display="none";
	else
		document.getElementById(elem).style.display="block";
}

function cleanField(elem) {
	elem.value='';
	elem.style.color='#545654';
}

function setFieldTxt(elem,value) {
	elem.value=value;
	elem.style.color='#8F938F';
}

function setEmptyTxt(elem,value) {
	if (elem.value=='') {
		elem.value=value;
		elem.style.color='#8F938F';
	}
}

function giveAddress(ac) {
	if (ac==undefined)
		ac='biuro';
	var d='luczakowie.pl';
	var ad=ac+'@'+d;
	document.write(ad);
}

//__________ Special _____________



function podnies(co) {
	document.getElementById(co).style.top="-3px";
	document.getElementById(co+'Ref').style.top="3px";
}

function upusc(co) {
	document.getElementById(co).style.top="0px";
	document.getElementById(co+'Ref').style.top="0px";
}

function kopiujFiltruj(skad,dokad) {
	var txt=skad.value;
	txt=txt.replace(/ą/gi,'a');
	txt=txt.replace(/ć/gi,'c');
	txt=txt.replace(/ę/gi,'e');
	txt=txt.replace(/ł/gi,'l');
	txt=txt.replace(/ń/gi,'n');
	txt=txt.replace(/ó/gi,'o');
	txt=txt.replace(/ś/gi,'s');
	txt=txt.replace(/ź/gi,'z');
	txt=txt.replace(/ż/gi,'z');
	txt=txt.replace(/\s+/g,'-');
	txt=txt.replace(/[^0-9a-zA-Z\-]/g,'');
	txt=txt.toLowerCase();
	//txt=txt.replace(new RegExp("e","g"));&nbsp;
	dokad.value=txt;
}
	
function ostrzezURL(form) {
	if (document.getElementById('url').value=='') {
		alert('Pole URL nie może byc puste.');
		return false;
	}
	return true;
}






