function info(okno,szer,wys){
	noweOkno=window.open(okno,'123','width='+szer+',height='+wys+',left='+(screen.width/2-szer/2)+',top='+(screen.height/2-wys/2)+',scrollbars=yes,resizable=yes')	
	}

function info2(okno,szer,wys){
	noweOkno2=window.open(okno,'nowe','width='+szer+',height='+wys+',left='+(screen.width/2-szer/2)+',top='+(screen.height/2-wys/2)+',scrollbars=yes,resizable=yes')	
	}	
	
function plik(plik,user){
	noweOkno=window.open('includes/'+plik+'.php?id='+user,'Dodaj zadanie','width=650,height=300,scrollbars=yes,resizable=yes')	
	}
	
function otworz(okno){
	noweOkno=window.open(okno,'_blank','fullscreen, scrollbars=no')
	}

function skasuj_plik(plik){
	noweOkno2=window.open('skasuj_plik.php?plik='+plik,'_blank','width=400,height=20')
	}	
	
function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;
    	window.top.location.href = gourl;
}

function selecturl2(s) {
	var gourl = s.options[s.selectedIndex].value;
    	window.opener.document.location.href = gourl;		
}

function otworz_z_combo_w_nowym(s) {
	var gourl = s.options[s.selectedIndex].value;
    	noweOkno=window.open(gourl);
		
}


function Potwierdz(URLDoPrzejscia,TekstDoPokazania)
	{
	PotwierdzPytanie = confirm(TekstDoPokazania);
	if(PotwierdzPytanie == true)
		{
		window.location.href = URLDoPrzejscia;
		}
	}
	

function uaktywnij(P)
{

  for (var i=1;i<=ile;i++)
  {
	var panel=document.getElementById('panel'+i);	
	var zakladka=document.getElementById('zak'+i);	
	if (i==P)
		{
		//panel.style.display='block';
		panel.style.backgroundColor='#eeeeee';
		zakladka.style.display='block';		

		/*createCookie("zakladeczka", i, 365);*/
		}
	else
		{
		//panel.style.display='none';
		panel.style.backgroundColor='#ffffff';
		zakladka.style.display='none';		
		}
  }
}

function uaktywnij2(P)
{

  for (var i=1;i<=ile;i++)
  {	
	var zakladka=document.getElementById('zakladka'+i);	
	if (i==P)
		{		
		zakladka.style.display='block';		
		}
	else
		{		
		zakladka.style.display='none';		
		}
  }
}

function uaktywnijZakladki(P)
{

  for (var i=1;i<=ileZakladek;i++)
  {	
	var panel=document.getElementById('zakladka'+i);	
	var zakladka=document.getElementById('naglowek'+i);	
	if (i==P)
		{		
		panel.style.display='block';	
		zakladka.style.background='#C4C6C4 url(\'images/strzalka_czerwona_dol.gif\')  no-repeat 0px 2px';		
		}
	else
		{		
		panel.style.display='none';		
		zakladka.style.background='transparent url(\'images/strzalka_czerwona_prawo.gif\')  no-repeat 0px 2px';		
		}
  }
}




function NapiszDo(kto,serwer) {
	parent.location.href = "mailto:"+kto+"@"+serwer+"";
}


function setCheckboxesRange(the_form, do_check, basename, min, max)
{
    for (var i = min; i < max; i++) {
        if (typeof(document.forms[the_form].elements[basename + i]) != 'undefined') {
            document.forms[the_form].elements[basename + i].checked = do_check;
        }
        if (typeof(document.forms[the_form].elements[basename + i + 'r']) != 'undefined') {
            document.forms[the_form].elements[basename + i + 'r'].checked = do_check;
        }
    }

    return true;
} // end of the 'setCheckboxesRange()' function


function toggle_visibility(id) {
	var e = document.getElementById(id);
	if(e.style.display == 'none')
		e.style.display = 'block';
	else
		e.style.display = 'none';
}


function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
	for (i=0;i<group[x].length;i++){
	temp.options[i]=new Option(group[x][i].text,group[x][i].value)
	
	}
temp.options[0].selected=true
}

function redirect2(x){
for (m2=temp2.options.length-1;m2>0;m2--)
temp2.options[m2]=null
	for (i=0;i<group[x].length;i++){
	temp2.options[i]=new Option(group[x][i].text,group[x][i].value)
	}
temp2.options[0].selected=true
}


function odkryj(id) {
	var e = document.getElementById(id);	
		e.style.display = 'block';
	
}


function PrzeliczCene(cena,RabatzaWczesniejszaRejestracje,RabatZaOsobe){

var LiczbaNiepustychOsob = new Array();
CenaPoRabacie = Math.floor((cena-cena*(RabatzaWczesniejszaRejestracje/100))*100)/100;
/*
if (document.formularzZamowienia.osoba_1.value == null) {}else{LiczbaNiepustychOsob.push(1);}
if (document.formularzZamowienia.osoba_2.value == null) {}else{LiczbaNiepustychOsob.push(2);}

LiczbaOsob = LiczbaNiepustychOsob.length;
alert(LiczbaOsob);
*/
LiczbaOsob = 3;
RabatZaLiczbeOsob = LiczbaOsob*RabatZaOsobe;
document.formularzZamowienia.wartosc.value = (CenaPoRabacie-RabatZaLiczbeOsob)+' zł'; 
}
