var obrazki = new Array()
obrazki[0] = new Image()
obrazki[0].src = "glowna_wl.jpg"
obrazki[1] = new Image()
obrazki[1].src = "posrednictwo_wl.jpg"
obrazki[2] = new Image()
obrazki[2].src = "oferty_wl.jpg"
obrazki[3] = new Image()
obrazki[3].src = "rynek_wl.jpg"
obrazki[4] = new Image()
obrazki[4].src = "kontakt_wl.jpg"
obrazki[5] = new Image()
obrazki[5].src = "istota_wl.jpg"
obrazki[6] = new Image()
obrazki[6].src = "umowa_otw_wl.jpg"
obrazki[7] = new Image()
obrazki[7].src = "umowa_wyl_wl.jpg"
obrazki[8] = new Image()
obrazki[8].src = "prawa_wl.jpg"
obrazki[9] = new Image()
obrazki[9].src = "transakcje_wl.jpg"
obrazki[10] = new Image()
obrazki[10].src = "zakres_wl.jpg"
obrazki[11] = new Image()
obrazki[11].src = "sprzedaz_wl.jpg"
obrazki[12] = new Image()
obrazki[12].src = "zgloszenie_wl.jpg"
obrazki[13] = new Image()
obrazki[13].src = "cennik_wl.jpg"
obrazki[14] = new Image()
obrazki[14].src = "platne_wl.jpg"


function wlacz(nr)
{
if (nr==0) document.glowna.src=obrazki[0].src;
if (nr==1) document.posrednictwo.src=obrazki[1].src;
if (nr==2) document.oferty.src=obrazki[2].src;
if (nr==3) document.rynek.src=obrazki[3].src;
if (nr==4) document.kontakt.src=obrazki[4].src;
if (nr==5) document.istota.src=obrazki[5].src;
if (nr==6) document.umowa_otwarta.src=obrazki[6].src;
if (nr==7) document.umowa_wylacznosc.src=obrazki[7].src;
if (nr==8) document.prawa.src=obrazki[8].src;
if (nr==9) document.transakcje.src=obrazki[9].src;
if (nr==10) document.zakres.src=obrazki[10].src;
if (nr==11) document.sprzedaz.src=obrazki[11].src;
if (nr==12) document.zgloszenie.src=obrazki[12].src;
if (nr==13) document.cennik.src=obrazki[13].src;
if (nr==14) document.platne.src=obrazki[14].src;
}

function wylacz(nr)
{
if (nr==0) document.glowna.src="glowna_wy.jpg";
if (nr==1) document.posrednictwo.src="posrednictwo_wy.jpg";
if (nr==2) document.oferty.src="oferty_wy.jpg";
if (nr==3) document.rynek.src="rynek_wy.jpg";
if (nr==4) document.kontakt.src="kontakt_wy.jpg";
if (nr==5) document.istota.src="istota_wy.jpg";
if (nr==6) document.umowa_otwarta.src="umowa_otw_wy.jpg";
if (nr==7) document.umowa_wylacznosc.src="umowa_wyl_wy.jpg";
if (nr==8) document.prawa.src="prawa_wy.jpg";
if (nr==9) document.transakcje.src="transakcje_wy.jpg";
if (nr==10) document.zakres.src="zakres_wy.jpg";
if (nr==11) document.sprzedaz.src="sprzedaz_wy.jpg";
if (nr==12) document.zgloszenie.src="zgloszenie_wy.jpg";
if (nr==13) document.cennik.src="cennik_wy.jpg";
if (nr==14) document.platne.src="platne_wy.jpg";
}

function nipek()
{
cyferki="0256789"
numerek=cyferki.substring(6,7)+cyferki.substring(3,5)+cyferki.substring(0,3)+cyferki.substring(0,1);
numerek=numerek+cyferki.substring(0,2)+cyferki.substring(5,6);
document.write(numerek);
}

function adres(wspak)
{
literki="acelnoptz";
literki="acglmoprt";
dl=wspak.length;
nazwa="";

for (i=0;i<dl;i++)
   {
    nazwa=nazwa+wspak.substring(dl-i-1,dl-i);
   }
nazwa=nazwa+"@"+literki.substring(2,3)+literki.substring(7,8)+literki.substring(0,1)+literki.substring(4,6)+literki.substring(8,9)+"."+literki.substring(1,2)+literki.substring(5,6)+literki.substring(4,5)+"."+literki.substring(6,7)
+literki.substring(3,4);
document.write('<a href="mailto:'+nazwa+'">'+nazwa+'</a>');
}

function pszczola()
{
literki="aeilnow";
nazwa="";

nazwa=nazwa+literki.substring(0,1)+literki.substring(3,4)+literki.substring(1,2)+literki.substring(4,5)+literki.substring(2,3)+literki.substring(5,7)+literki.
substring(0,1);
document.write(nazwa);
}

function zmien(forma)
{
if (forma[1].options[forma[1].selectedIndex].value=="mieszkanie")
   {
    forma[2].options[0].text="Niski blok";
    forma[2].options[1].text="Wieżowiec";
    forma[2].options[2].text="Kamienica";
   }
if (forma[1].options[forma[1].selectedIndex].value=="dom")
   {
    forma[2].options[0].text="Wolnostojący";
    forma[2].options[1].text="Bliźniak";
    forma[2].options[2].text="Szeregowiec";
   }
if (forma[1].options[forma[1].selectedIndex].value=="ziemia")
  {
    forma[2].options[0].text="Budowlana";
    forma[2].options[1].text="Rekreacyjna";
    forma[2].options[2].text="Rola";
   }
}

function sprawdz(forma)
{
blad="";
if (!(zm=parseFloat(forma.powierzchnia.value))) blad=blad+"\n Należy podać powierzchnię";

if (!(zm=(-1<parseInt(forma.kondygnacja_pietro.value))) && (forma[1].options[forma[1].selectedIndex].value=="mieszkanie" || forma[1].options[forma[1].selectedIndex].value=="dom"))
   blad=blad+"\n Należy podać kondygnację/piętro";
   else
   if (zm=parseInt(forma.kondygnacja_pietro.value) && forma[1].options[forma[1].selectedIndex].value=="ziemia")
      blad=blad+"\n wybierając ziemię nie można podawać kondygnacji/pietra";

if (!(zm=parseInt(forma.pokoje.value)) && (forma[1].options[forma[1].selectedIndex].value=="mieszkanie" || forma[1].options[forma[1].selectedIndex].value=="dom"))
   blad=blad+"\n Należy podać liczbę pokoi";
   else
   if (zm=parseInt(forma.pokoje.value) && forma[1].options[forma[1].selectedIndex].value=="ziemia")
      blad=blad+"\n wybierając ziemię nie można podawać pokoi";

if (forma.lokalizacja.value.length<2) blad=blad+"\n Należy podac lokalizacje";
if (forma.imie.value.length<2) blad=blad+"\n Nalezy podac imie";
if (forma.nazwisko.value.length<2) blad=blad+"\n Należy podac nazwisko";
if (forma.telefon.value.length==0 && forma.poczta.value.length==0)
   blad=blad+"\n Należy podać albo telefon albo adres poczty elektronicznej.";
   else
     if (forma.poczta.value.length!=0 && forma.poczta.value.indexOf("@")<1)
        blad=blad+"\n Należy podać właściwy adres poczty elektronicznej";
if (blad!="")
   alert(blad);
   else
//     document.forma.name.submit();
       forma.submit();
}

function zdjecie(numer,szer,wys)
{
okno=window.open(numer+'.jpg', 'zdjecia', 'toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,height='+wys+',width='+szer+',left=20,top=20');
okno.focus();
}


