
function Preview(id, src, width) {
	var el = document.getElementById(id);
	el.src = src;
	el.style['width'] = width+"px"; 
}

function $(id) {
      try {
          return document.getElementById(id);
      }
      catch (oError) {
           // info o bledzie ;)
      }
} 

function pokazDuzeFoto(url,wmax,hmax)
	{
			noweOkno = window.open('', 'aaa', 'top=20, left=20, width='+wmax+', height='+hmax+', toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, menubar=no, margin=0');
			noweOkno.document.write('<html><head></head><body style="margin:0px;">');
			noweOkno.document.write('<img src="'+ url +'" alt="Zamknij" title="Zamknij" style="width:'+wmax+'px; height:'+hmax+'px" onclick="self.close()" />');
			noweOkno.document.write('</body></html>');
	}



function checkAll( n, fldName ) {
  if (!fldName) {
     fldName = 'cb';
  }
	var f = document.adminForm;
	var c = f.toggle.checked;
	var n2 = 0;
	for (i=1; i <= n; i++) {
		cb = eval( 'f.' + fldName + '' + i );
		if (cb) {
			cb.checked = c;
			n2++;
		}
	}
	if (c) {
		document.adminForm.boxchecked.value = n2;
	} else {
		document.adminForm.boxchecked.value = 0;
	}
} 


function submitform(pressbutton){
	document.adminForm.task.value=pressbutton;
	try {
		document.adminForm.onsubmit();
		}
	catch(e){}
	document.adminForm.submit();
}

function nowe_okno() {
	window.open("","nazwa_okna","toolbar=no,height=200px,width=400px");
}

