
function detekcja(){
			var MSIE="Microsoft Internet Explorer";
			var FF="Netscape";
			var Opera="Opera";
			var appName=navigator.appName;
			
			if (appName==MSIE) 				agent="MSIE";
			else if (appName==FF)    agent="FF";
			else if (appName==Opera) agent="Opera";
			else 											agent="FF";
			
			return agent;
}

function zamowProjekt(id,text){
			location.replace(text+','+id+',zamawiam.html');
}

/*
var lewo;
var prawo;

function autolewo(){
	document.getElementById('menuScroll').scrollLeft--;
	lewo = setTimeout('autolewo()',30);	
	clearTimeout(prawo);
	
	//document.getElementById('pozycjaScroll').innerHTML=document.getElementById('menuScroll').scrollLeft;
	
	if (document.getElementById('menuScroll').scrollLeft<=1) clearTimeout(lewo);
	prawo = setTimeout('autoprawo()',30);
}

function autoprawo(){
	document.getElementById('menuScroll').scrollLeft++;
	prawo = setTimeout('autoprawo()',30);	
	clearTimeout(lewo);
	
	//document.getElementById('pozycjaScroll').innerHTML=document.getElementById('menuScroll').scrollLeft;
	
	if (document.getElementById('menuScroll').scrollLeft>=570) clearTimeout(prawo);
	lewo = setTimeout('autolewo()',30);	
}

function wlewo(){
	document.getElementById('menuScroll').scrollLeft--;
	lewo = setTimeout('wlewo()',1);	
	clearTimeout(prawo);
}

function wprawo(){
	document.getElementById('menuScroll').scrollLeft++;
	prawo = setTimeout('wprawo()',1);	
	clearTimeout(lewo);
}
*/
function stoj(){
	clearTimeout(lewo);
	clearTimeout(prawo);	
}


// Marquee script written by blue
// licensed under Creative Common license
// http://creativecommons.org/licenses/by-sa/2.5/pl/
function marquee(x,typ,p){
    typ={
        'up':[-1,'top','offsetHeight'],
        'down':[1,'top','offsetHeight'],
        'left':[-1,'left','offsetWidth'],
        'right':[1,'left','offsetWidth']
    }[typ];
    var m=this,mOut,mIn,turlaj,T,i=typ[0],j=0,p=p||5;
    (mOut=document.getElementById(x)).onmouseover=function(){T=clearInterval(T)};
        mOut.appendChild((mIn=mOut.childNodes)[0].cloneNode(1));
        mOut.onmouseout=function(e){
            e=e||event;e=e.toElement||e.relatedTarget;
            if(e)do{if(e==this)return!1}while(e=e.parentNode)
            T=setInterval(turlaj,p)
        };
    mOut=mIn[0][typ[2]];
    turlaj=function(){
        mIn[0].style[typ[1]]=(-2*i*(j+=i)<(i-1)*mOut?(j=(-i-1)/2*mOut+i):j)+'px';
        mIn[1].style[typ[1]]=j+mOut+'px';
    }
    T=setInterval(turlaj,p);   
}

function displayWindow(adres,szerokosc,wysokosc){
        window.open(adres,'','width='+szerokosc+',height='+wysokosc+'toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no');
}

function czytajCiacho(){
					fSize=document.cookie.substring(6,10);		
					//if (fSize=="") fSize='15px';
					rozmiarTekstu(fSize);
}

function displayWindow(adres,szerokosc,wysokosc){
        window.open(adres,'','width='+szerokosc+',height='+wysokosc+'toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no');
        }

function menuLI(t){
					
					objMenuUL=document.getElementById('menuUL');
					objMenuLI=objMenuUL.getElementsByTagName('li');
					for(var i=0;i<objMenuLI.length;i++)							
							objMenuLI[i].style.backgroundImage='none';
							
					t.style.backgroundImage='url(gfx/menuZakladka.jpg)';
					t.style.backgroundRepeat='repeat-x';
					t.style.backgroundPosition='bottom center';
}

function sprawdzFormularz(t){					
					
					if (t.value=='kod' || 
							t.value=='wpisz swój adres e-mail' ||
							t.value=='adres e-mail' || 
							t.value=='haslo') t.value='';					
}

function nipy(){
nip=document.getElementById('nip');

					kto=document.getElementById('id_rachunek').options[document.getElementById('id_rachunek').selectedIndex].value;
					if(kto == '1')
					{
					nip.style.display           = '';
					}
					else if(kto == '2')
					{
					
					nip.style.display           = 'none';
					
					}

}

function odblokujFormularz(name){
				zmiennaok=0;
AForm = document.forms[name]; 
for (i = 0; i < AForm.elements.length; i++) {
        if (AForm.elements[i].type == "radio") {
				
				if(AForm.elements[i].checked ==true) zmiennaok++;
				else zmiennaok=0;
		 
        } else if (AForm.elements[i].type == "checkbox") {
				
					if(AForm.elements[i].checked==true) zmiennaok++;
					else zmiennaok=0;
			
        } else if (AForm.elements[i].type == "text") {
	
					if(AForm.elements[i].value !='') zmiennaok++;
					else zmiennaok=0;
			
        } else if (AForm.elements[i].type == "textarea") {
				
        if(AForm.elements[i].value !='') zmiennaok++;
				 else zmiennaok=0;
				 
        } else if (AForm.elements[i].type == "select-one") {
				
					if(AForm.elements[i].selectedIndex !=0) zmiennaok++;
					else zmiennaok=0;
					
        } else if (AForm.elements[i].type == "select-multiple") {
				
					if(	AForm.elements[i].selectedIndex !=-1) zmiennaok++;
					else zmiennaok=0;
		
        } else if (AForm.elements[i].type == "submit") {
				
					zmiennaok++;
        } else if (AForm.elements[i].type == "hidden") {
				
					zmiennaok++;
        } else if (AForm.elements[i].type == "file") {
				
					zmiennaok++;
					
		
        }
    }
		if(zmiennaok == i) AForm.elements['dodaj'].disabled=false;
		else AForm.elements['dodaj'].disabled=true;
}

var sek=5;

function pobierzPlik(plik){
					
					t=setTimeout("pobierzPlik('"+plik+"')",1000);
					
					if (sek==0){ 
							clearTimeout(t);
							//window.location.target='_blank';
							window.open(plik);
					}
					
					document.getElementById('sekund').innerHTML=sek;					
					sek-=1;
}


