
function check(e, regexp) 
{
	if(navigator.userAgent.indexOf('Gecko') != -1) 
	{
		charCode = e.which;
	} 
	else 
	{
		charCode = e.keyCode;
	}
		
	if(charCode > 31) 
	{	 
		znak = String.fromCharCode(charCode);
		return regexp.test(znak);
	}
}

<!--Ustawia kursor w polu logowania-->

function setFocus() 
{
	document.loginForm.usrname.select();
	document.loginForm.usrname.focus();
}

//funkcja noweokno otwiera popupa

function noweokno_scroll(url, width, height) 
{
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,left=50,top=100' );
}
function noweokno(url, width, height) 
{
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,left=50,top=100' );
}
function noweokno2(url, nr, width, height) 
{
        var Win = window.open(url, nr,'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,left=50,top=100' );
}


function select_sor(id)
	{
		
		document.getElementById('sor').selected=document.getElementById('parent').options[id];
		
		
	/*	
	advAJAX.get({
    url: "../mod/menu/private/include/func/ajax.php?strona="+id,
    onSuccess : function(obj) { 

			document.getElementById('sor').innerHTML = obj.responseText;
		
	}
	});	
	*/
	}
function uwaga(text)
{
	alert(text);	
}

function CheckAll()
   {
      for (var i=0;i<document.loginForm.elements.length;i++)
      {
         var e = document.loginForm.elements[i];
         if (e.name != "allbox")
            e.checked = document.loginForm.allbox.checked;
      }
   }
	 
	
	
function oblicz(netto, cena, jed, brutto)
{
	btt=document.getElementById(netto);
	sel=document.getElementById(jed);
	btt_b=document.getElementById(brutto);
	s=sel.options[sel.selectedIndex].value;
	
	btt.value=cena*s;
	btt_b.value=cena*s*1.22;
}

function sumuj()
{
	
	n_sum=document.getElementById('netto_suma');
	b_sum=document.getElementById('brutto_suma');
	a=eval(document.getElementById('netto1').value);
	b=eval(document.getElementById('netto2').value);
	c=eval(document.getElementById('netto3').value);

	n_sum.value=a + b + c;
b_sum.value=(a + b + c)*1.22;
	
	setTimeout("sumuj()",100);
}




function pokaz_fakture(fo)
{

	fo.setAttribute('method', 'get')
	fo.setAttribute('target', '_blank')
	fo.setAttribute('action', 'faktura.php')
	fo.submit();

}

function wyslij_fakture(fo)
{
	fo.setAttribute('method', 'post')
	fo.setAttribute('action', '../ajax/wyslij_fakture.php')

	
 advAJAX.submit
 (
	document.getElementById("bilingForm"), 
	{
		
		onInitialization : function(obj)
		{
			document.getElementById("submitBtn_wyslij").value = "Proszę czekać... Trwa wysyłanie faktury!";
		},
		onComplete : function()
		{
			document.getElementById("submitBtn_wyslij").value = "Faktura została wysłana.. wyślij jeszcze jedną";
		},
		onSuccess : function(obj) 
		{ 
			alert(obj.responseText); 
			
		}
		
	}
 );




}
