a = 'Nazwa pojazdu....<INPUT TYPE=\"text\" NAME=\"motocykl\" STYLE=\"width:465px;height:21px; padding:0px;\" onfocus=\"nie_kasowanie3();document.ogl_mot.motocykl.className=\'\';" MAXLENGTH=\"50\"><FONT COLOR="#FF0000">*</FONT><BR>';

b = 'Rodzaj...........<SELECT NAME=\"ii_typ_pojazdu\" STYLE=\"width:465px;height:21px; padding:0px;margin-top:1px;\" onfocus=\"document.ogl_mot.ii_typ_pojazdu.className=\'\';\"><option> -------------------------------------- wybierz rodzaj pojazdu -------------------------------------</option><option>chopper</option><option>cross</option><option>cruiser</option><option>custom</option><option>enduro</option><option>klasyczny</option><option>naked</option><option>quad</option><option>skuter</option><option>sportowy</option><option>sportowo-turystyczny</option><option>streetfighter</option><option>supermoto</option><option>trajka</option><option>turystyczny</option><option>wojskowy</option><option>zabytkowy</option><option>inny</option></SELECT><FONT COLOR="#FF0000">*</FONT><BR>';


e = 'Rodzaj...........<SELECT NAME=\"ii_typ_pojazdu\" STYLE=\"width:465px;height:21px; padding:0px;margin-top:1px; \" onfocus=\"document.ogl_mot.ii_typ_pojazdu.className=\'\';\"><option> -------------------------------------- wybierz rodzaj pojazdu -------------------------------------</option><option>chopper</option><option>cross</option><option>cruiser</option><option>custom</option><option>enduro</option><option>klasyczny</option><option>quad</option><option>skuter</option><option>sportowy</option><option>zabytkowy</option><option>inny</option></SELECT><FONT COLOR="#FF0000">*</FONT><BR>';


c = 'Rok produkcji....<INPUT TYPE=\"text\" NAME=\"rok_produkcji\" VALUE=\"\"STYLE=\"width:465px;height:21px;padding:0px;\" onfocus=\"document.ogl_mot.rok_produkcji.className=\'\';" MAXLENGTH=\"4\" onchange=\"sprawdz_rok()\"><FONT COLOR="#FFFFFF">.</FONT><BR>';

d = 'Pojemność w ccm..<INPUT TYPE=\"text\" NAME=\"pojemnosc\" VALUE=\"\" STYLE=\"width:465px;height:21px; padding:0px;\" onfocus=\"document.ogl_mot.pojemnosc.className=\'\';" MAXLENGTH=\"4\" onchange=\"sprawdz_poj()\"><FONT COLOR="#FFFFFF">.</FONT><BR>Przebieg w km....<INPUT TYPE=\"text\" NAME=\"przebieg\" STYLE=\"width:465px;height:21px;padding:0px;\" MAXLENGTH=\"6" VALUE=\"\" onchange=\"sprawdz_przebieg()\" onfocus=\"document.ogl_mot.przebieg.className=\'\';\"><FONT COLOR="#FFFFFF">.</FONT><BR>Kolor............<INPUT TYPE=\"text\" NAME=\"kolor\" STYLE=\"width:465px;height:21px;padding:0px;\" MAXLENGTH=\"50\" VALUE=\"\" onchange=\"sprawdz_kolor()\" onfocus=\"document.ogl_mot.kolor.className=\'\';\"><FONT COLOR="#FFFFFF">.</FONT><BR>';

function nazwa_pojazdu()
{

if (document.ogl_mot.motocykl)
{
var wartosc_a = document.ogl_mot.motocykl.value;
}
else
{
var wartosc_a = 'marka, model, typ pojazdu - max. 50 znaków';
}

if (document.ogl_mot.rok_produkcji)
{
var wartosc_b = document.ogl_mot.rok_produkcji.value;
}
else
{
var wartosc_b = '';
}

if (document.ogl_mot.pojemnosc)
{
var wartosc_c = document.ogl_mot.pojemnosc.value;
}
else
{
var wartosc_c = '';
}

if (document.ogl_mot.przebieg)
{
var wartosc_d = document.ogl_mot.przebieg.value;
}
else
{
var wartosc_d = '';
}

if (document.ogl_mot.kolor)
{
var wartosc_e = document.ogl_mot.kolor.value;
}
else
{
var wartosc_e = '';
}

if (document.ogl_mot.cena)
{
var wartosc_f = document.ogl_mot.cena.value;
}
else
{
var wartosc_f = '';
}


if(document.ogl_mot.typ_ogloszenia[0].checked)
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = b;
document.getElementById('nie_motocykl2').innerHTML = c;
document.getElementById('nie_motocykl3').innerHTML = d;
document.ogl_mot.cena.value = "";
}
else
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
document.ogl_mot.cena.value="";
}


if (document.ogl_mot.motocykl)
{
document.ogl_mot.motocykl.value = wartosc_a;
}

if (document.ogl_mot.rok_produkcji)
{
document.ogl_mot.rok_produkcji.value = wartosc_b;
}

if (document.ogl_mot.typ_ogloszenia[0].checked)
{

if (document.ogl_mot.pojemnosc)
{
document.ogl_mot.pojemnosc.value = wartosc_c;
}

document.ogl_mot.pojemnosc.value = "";

}


if (document.ogl_mot.przebieg)
{
document.ogl_mot.przebieg.value = wartosc_d
}

if (document.ogl_mot.kolor)
{
document.ogl_mot.kolor.value = wartosc_e;
}

if (document.ogl_mot.cena)
{
document.ogl_mot.cena.value = wartosc_f;
}

}


function motorower()
{

if (document.ogl_mot.motocykl)
{
var wartosc_a = document.ogl_mot.motocykl.value;
}
else
{
var wartosc_a = 'marka, model, typ pojazdu - max. 50 znaków';
}

if (document.ogl_mot.rok_produkcji)
{
var wartosc_b = document.ogl_mot.rok_produkcji.value;
}
else
{
var wartosc_b = '';
}

if (document.ogl_mot.pojemnosc)
{
var wartosc_c = document.ogl_mot.pojemnosc.value;
}
else
{
var wartosc_c = '';
}

if (document.ogl_mot.przebieg)
{
var wartosc_d = document.ogl_mot.przebieg.value;
}
else
{
var wartosc_d = '';
}

if (document.ogl_mot.kolor)
{
var wartosc_e = document.ogl_mot.kolor.value;
}
else
{
var wartosc_e = '';
}

if (document.ogl_mot.cena)
{
var wartosc_f = document.ogl_mot.cena.value;
}
else
{
var wartosc_f = '';
}

if(document.ogl_mot.typ_ogloszenia[0].checked)
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = e;
document.getElementById('nie_motocykl2').innerHTML = c;
document.getElementById('nie_motocykl3').innerHTML = d;
document.ogl_mot.cena.value = "";
}
else
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
document.ogl_mot.cena.value="";

}

if (document.ogl_mot.motocykl)
{
document.ogl_mot.motocykl.value = wartosc_a;
}

if (document.ogl_mot.rok_produkcji)
{
document.ogl_mot.rok_produkcji.value = wartosc_b;
}

if (document.ogl_mot.pojemnosc)
{
document.ogl_mot.pojemnosc.value = wartosc_c;
}

if (document.ogl_mot.przebieg)
{
document.ogl_mot.przebieg.value = wartosc_d
}

if (document.ogl_mot.kolor)
{
document.ogl_mot.kolor.value = wartosc_e;
}

if (document.ogl_mot.cena)
{
document.ogl_mot.cena.value = wartosc_f;
}

if (document.ogl_mot.typ_ogloszenia[0].checked)
{

if (document.ogl_mot.pojemnosc)
{
document.ogl_mot.pojemnosc.value = wartosc_c;
}

document.ogl_mot.pojemnosc.value = "50";
}
}


function czesci()
{
if (document.ogl_mot.motocykl)
{
var wartosc_a = document.ogl_mot.motocykl.value;
}
else
{
var wartosc_a = 'marka, model, typ pojazdu - max. 50 znaków';
}

if (document.ogl_mot.cena)
{
var wartosc_f = document.ogl_mot.cena.value;
}
else
{
var wartosc_f = '';
}

document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';

if (document.ogl_mot.motocykl)
{
document.ogl_mot.motocykl.value = wartosc_a;
}

if (document.ogl_mot.cena)
{
document.ogl_mot.cena.value = wartosc_f;
}


}

function inne()
{
if (document.ogl_mot.cena)
{
var wartosc_f = document.ogl_mot.cena.value;
}
else
{
var wartosc_f = '';
}
document.getElementById('nazwa_motocykla').innerHTML = '';
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
if (document.ogl_mot.cena)
{
document.ogl_mot.cena.value = wartosc_f;
}
}


function sprawdz_rok()
{
if (document.ogl_mot.rok_produkcji.value!="")
	
{
	var rok = document.ogl_mot.rok_produkcji.value;
		
	if (!isInteger(rok))
	{
	alert("Pole ROK PRODUKCJI zawiera nieprawidłowe znaki. Dozwolone są tylko cyfry.");
	document.ogl_mot.rok_produkcji.value='';
	}	
	
	if (!length(rok) & isInteger(rok))
	{
	alert("Pole ROK PRODUKCJI zawiera zbyt mało cyfr !");
	document.ogl_mot.rok_produkcji.value='';
	}
	
	if (length(rok) & isInteger(rok) & za_maly_min())
	{
	alert("W "+rok+" roku nie było jeszcze motocykli !");
	document.ogl_mot.rok_produkcji.value='';
	}
	
	if (length(rok) & isInteger(rok) & !za_maly_min() & za_duzy_min())
	{
	alert("To nie jest wechikuł czasu !");
	document.ogl_mot.rok_produkcji.value='';
	}

}
}
	
function isInteger(rok) 
{
return (rok.toString().search(/^-?[0-9]+$/) == 0);
}

function length(rok) 
{
return (rok.toString().length == 4);
}

function za_maly_min() 
{
return (document.ogl_mot.rok_produkcji.value < 1884);
}

function za_duzy_min() 
{
return (document.ogl_mot.rok_produkcji.value > new Date().getFullYear());
}



function sprawdz_poj()
{
if (document.ogl_mot.pojemnosc.value!="")
	
{
	var poj = document.ogl_mot.pojemnosc.value;

	switch(isInteger(poj))
	{
	case true:
	if((document.ogl_mot.motocykl_czy_czesci[1].checked)&(document.ogl_mot.pojemnosc.value>50))
	{
	alert("Motorower może mieć najwyżej 50 ccm pojemności !");
	document.ogl_mot.pojemnosc.value='50';
	}
	break;
	case false:
        alert("Pole POJEMNOŚĆ  zawiera nieprawidłowe znaki. Dozwolone są tylko cyfry.");
	document.ogl_mot.pojemnosc.value='';
	}
		

}
}



function sprawdz_cena()
{



var cena = document.ogl_mot.cena.value;

	switch(isInteger(cena))
	{
	
	case false:
        alert("Pole CENA  zawiera nieprawidłowe znaki. Dozwolone są tylko cyfry.");
	document.ogl_mot.cena.value='';
	}

}

function sprawdz_przebieg()
{



var przebieg = document.ogl_mot.przebieg.value;

	switch(isInteger(przebieg))
	{
	
	case false:
        alert("Pole PRZEBIEG  zawiera nieprawidłowe znaki. Dozwolone są tylko cyfry.");
	document.ogl_mot.przebieg.value='';
	}
		
}


function sprawdz_tytul()

{

	switch((document.ogl_mot.tytul.value=='')||(document.ogl_mot.tytul.value=='max. 50 znaków'))
	{
	
	case true:
        alert("Pole TYTUŁ OGŁOSZENIA jest niepoprawnie wypełnione !");
	document.ogl_mot.tytul.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_motocykl()

{

	switch((document.ogl_mot.motocykl.value=='')||(document.ogl_mot.motocykl.value=='marka, model, typ pojazdu - max. 50 znaków'))
	{
	
	case true:
        alert("Pole NAZWA POJAZDU jest niepoprawnie wypełnione !");
	document.ogl_mot.motocykl.className='zly';
	return false;

	case false:
	return true;	
	}

}


function sprawdz_ii_typ_pojazdu()

{

	switch(document.ogl_mot.ii_typ_pojazdu.selectedIndex==0)
	{
	
	case true:
        alert("Wybierz typ motocykla !");
	document.ogl_mot.ii_typ_pojazdu.className='zly';
	return false;

	case false:
	return true;	
	}

}


function sprawdz_rok_produkcji()

{

	switch((document.ogl_mot.rok_produkcji.value=='')||(document.ogl_mot.rok_produkcji.value=='podaj rok produkcji'))
	{
	
	case true:
        alert("Pole ROK PRODUKCJI jest niepoprawnie wypełnione !");
	document.ogl_mot.rok_produkcji.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_pojemnosc()

{

	switch((document.ogl_mot.pojemnosc.value=='')||(document.ogl_mot.pojemnosc.value=='podaj pojemność pojazdu'))
	{
	
	case true:
        alert("Pole POJEMNOSC jest niepoprawnie wypełnione !");
	document.ogl_mot.pojemnosc.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_cene()

{

	switch(document.ogl_mot.cena.value=='')
	{
	
	case true:
        alert("Pole CENA jest niepoprawnie wypełnione !");
	document.ogl_mot.cena.className='zly';
	return false;

	case false:
	return true;	
	}

}



function sprawdz_komentarz()

{

	switch(document.ogl_mot.komentarz.value=='')
	{
	
	case true:
        alert("Pole TREŚĆ OGŁOSZENIA nie zawiera wpisu !");
	document.ogl_mot.komentarz.className='zly';
	return false;

	case false:
	return true;	
	}

}


function sprawdz_nazwisko()

{

	switch(document.ogl_mot.nazwisko.value=='')
	{
	
	case true:
        alert("Pole IMIĘ, NAZWISKO LUB PSEUDONIM nie zawiera wpisu !");
	document.ogl_mot.nazwisko.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_adres_mailowy()

{
if (document.ogl_mot.adres_mailowy.value!='')
{

switch((document.ogl_mot.adres_mailowy.value.indexOf("@") == -1 || document.ogl_mot.adres_mailowy.value.indexOf(".") == -1 || document.ogl_mot.adres_mailowy.value.indexOf(" ") != -1 || document.ogl_mot.adres_mailowy.value.length < 6))
	{
	
	case true:
        alert("Pole ADRES E-MAIL zawiera błędny wpis !");
	document.ogl_mot.adres_mailowy.className='zly';
	return false;

	case false:
	return true;	
	}

}
}


function dlugosc_gg(nr_gg) 
{
return ((nr_gg.toString().length == 6)||(nr_gg.toString().length == 7)||(nr_gg.toString().length == 8));
}



function sprawdz_gg()

{



	switch((document.ogl_mot.gg.value!="")&&(!isInteger(document.ogl_mot.gg.value)||!dlugosc_gg(document.ogl_mot.gg.value)))
	{
	
	case true:
        alert("Pole NUMER GG zawiera błędny wpis !");
	document.ogl_mot.gg.className='zly';
	return false;

	case false:
	return true;
	}

}

function dlugosc_tel_kom(nr_tel_kom) 
{
return ((nr_tel_kom.toString().length == 9)||(nr_tel_kom.toString().length == 10));
}



function sprawdz_tel_kom()
{
if (document.ogl_mot.tel_kom.value!='')
{


document.ogl_mot.tel_kom.value=document.ogl_mot.tel_kom.value.replace(/ /gi,'').replace(/-/gi,'');

var nr_tel_kom = document.ogl_mot.tel_kom.value;
var wzorzec = /^[0]{0,1}[5-8]{1}[0-9]{8}$/;
	switch((!dlugosc_tel_kom(nr_tel_kom))||(!isInteger(nr_tel_kom))||(!wzorzec.test(document.ogl_mot.tel_kom.value)))
	{
	
	case true:
        alert("Pole NUMER TELEFONU KOMÓRKOWEGO zawiera błędny wpis !");
	document.ogl_mot.tel_kom.className='zly';
	return false;

	case false:
	return true;	
	}

}
}

function dlugosc_tel_dom(nr_tel_dom) 
{
return ((nr_tel_dom.toString().length == 9)||(nr_tel_dom.toString().length == 10));
}



function sprawdz_tel_dom()
{

if (document.ogl_mot.tel_dom.value!='')
{


document.ogl_mot.tel_dom.value=document.ogl_mot.tel_dom.value.replace(/ /gi,'').replace(/-/gi,'');
var nr_tel_dom = document.ogl_mot.tel_dom.value;
var wzorzec2 = /^[0]{0,1}[0-8]{1}[0-9]{8}$/;
	switch((document.ogl_mot.tel_dom.value=='')||(!dlugosc_tel_dom(nr_tel_dom))||(!isInteger(nr_tel_dom))||(!wzorzec2.test(document.ogl_mot.tel_dom.value)))
	{
	
	case true:
        alert("Pole NUMER TELEFONU STACJONARNEGO zawiera błędny wpis !");
	document.ogl_mot.tel_dom.className='zly';
	return false;

	case false:
	return true;	
	}

}
}

function sprawdz_tel_skype()

{

	switch(document.ogl_mot.tel_skype.value=='')
	{
	
	case true:
        document.ogl_mot.tel_skype.className='zly';
	return false;

	case false:
	return true;	
	}

}


function sprawdz_miejscowosc()

{

	switch(document.ogl_mot.miejscowosc.value=='')
	{
	
	case true:
        alert("Pole Miejscowosc nie zawiera wpisu !");
	document.ogl_mot.miejscowosc.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_wojewodztwo()

{

	switch(document.ogl_mot.wojewodztwo.selectedIndex==0)
	{
	
	case true:
        alert("Pole WOJEWÓDZTWO nie zawiera wpisu !");
	document.ogl_mot.wojewodztwo.className='zly';
	return false;

	case false:
	return true;	
	}

}

function sprawdz_prawidlowosc()
{


if(!sprawdz_tel_kom())
{
document.ogl_mot.tel_kom.value='';
}
if(!sprawdz_tel_dom())
{
document.ogl_mot.tel_dom.value='';
}
if(!sprawdz_gg())
{
document.ogl_mot.gg.value='';
}
if(!sprawdz_adres_mailowy())
{
document.ogl_mot.adres_mailowy.value='';
}

if (sprawdz_tel_kom()||sprawdz_tel_dom()||sprawdz_adres_mailowy()||sprawdz_gg())
{
return true;
}

}

function sprawdz_kontakt()

{

if ((document.ogl_mot.adres_mailowy.value=='')&(document.ogl_mot.gg.value=='')&(document.ogl_mot.tel_kom.value=='')&(document.ogl_mot.tel_dom.value=='')&(document.ogl_mot.tel_skype.value==''))
{
	
	alert("Nie podałeś żadnej formy kontaktu !");	
	document.ogl_mot.adres_mailowy.className='zly';
	document.ogl_mot.gg.className='zly';
	document.ogl_mot.tel_kom.className='zly';
	document.ogl_mot.tel_dom.className='zly';
	document.ogl_mot.tel_skype.className='zly';		
	
	

return false;


}
else
{


	document.ogl_mot.adres_mailowy.className='';
	document.ogl_mot.gg.className='';
	document.ogl_mot.tel_kom.className='';
	document.ogl_mot.tel_dom.className='';
	document.ogl_mot.tel_skype.className='';


return true;


}

	
}



function ogl_mot_akcja()
{



if (document.ogl_mot.motocykl_czy_czesci[0].checked)
{
if (document.ogl_mot.typ_ogloszenia[0].checked)
{
if (sprawdz_tytul()&sprawdz_motocykl()&sprawdz_ii_typ_pojazdu()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="motocykl";
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="sprzedam";
top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;
top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value=document.ogl_mot.ii_typ_pojazdu.selectedIndex;
document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}

if (document.ogl_mot.typ_ogloszenia[1].checked)
{
if (sprawdz_tytul()&sprawdz_motocykl()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="motocykl";
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="szukam";
top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;

document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}
}

if (document.ogl_mot.motocykl_czy_czesci[1].checked)
{
if (document.ogl_mot.typ_ogloszenia[0].checked)
{
if (sprawdz_tytul()&sprawdz_motocykl()&sprawdz_ii_typ_pojazdu()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="motorower";
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="sprzedam";
top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;
top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value=document.ogl_mot.ii_typ_pojazdu.selectedIndex;
document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}
if (document.ogl_mot.typ_ogloszenia[1].checked)
{
if (sprawdz_tytul()&sprawdz_motocykl()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="motorower";
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="szukam";
top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;

document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}
}



if(document.ogl_mot.motocykl_czy_czesci[2].checked)
{

if (sprawdz_tytul()&sprawdz_motocykl()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="czesci";
if (document.ogl_mot.typ_ogloszenia[0].checked)
{
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="sprzedam";
}

if (document.ogl_mot.typ_ogloszenia[1].checked)
{
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="szukam";
}

top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;

document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}


if(document.ogl_mot.motocykl_czy_czesci[3].checked)
{
if (sprawdz_tytul()&sprawdz_komentarz()&sprawdz_nazwisko()&sprawdz_kontakt()&sprawdz_prawidlowosc()&sprawdz_miejscowosc()&sprawdz_wojewodztwo())
{
top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value="inne";
if (document.ogl_mot.typ_ogloszenia[0].checked)
{
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="sprzedam";
}
if (document.ogl_mot.typ_ogloszenia[1].checked)
{
top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value="szukam";
}
top.frames.b.document.znajdz_motocykl.wojewodztwo3.value=document.ogl_mot.wojewodztwo.selectedIndex;
document.ogl_mot.action="dodane.php";
document.ogl_mot.submit();
}
}

}

function menu()

{

if (document.ogl_mot.rodzaj_czesci.selectedIndex==1)
{
document.getElementById('nie_motocykl5').innerHTML = f;
}

if (document.ogl_mot.rodzaj_czesci.selectedIndex==2)
{
document.getElementById('nie_motocykl5').innerHTML = g;
}

}

function sprawdz_sprzedam()

{
if ((document.ogl_mot.typ_ogloszenia[0].checked)&(document.ogl_mot.motocykl_czy_czesci[0].checked))
{
nazwa_pojazdu();
}

if ((document.ogl_mot.typ_ogloszenia[1].checked)&(document.ogl_mot.motocykl_czy_czesci[0].checked))
{
nazwa_pojazdu();
}

if ((document.ogl_mot.typ_ogloszenia[0].checked)&(document.ogl_mot.motocykl_czy_czesci[1].checked))
{
motorower();
}

if ((document.ogl_mot.typ_ogloszenia[1].checked)&(document.ogl_mot.motocykl_czy_czesci[1].checked))
{
motorower();
}
}

function sprawdz_kupie()
{
if ((document.ogl_mot.motocykl_czy_czesci[0].checked)||(document.ogl_mot.motocykl_czy_czesci[1].checked))
{

document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';

document.ogl_mot.cena.value = "";
}
}


function nie_kasowanie2()
{
if (document.ogl_mot.tytul.value == "max. 50 znaków")
{
document.ogl_mot.tytul.value = "";
}
}

function nie_kasowanie3()
{
if (document.ogl_mot.motocykl.value == "marka, model, typ pojazdu - max. 50 znaków")
{
document.ogl_mot.motocykl.value = "";
}
}


function sprawdz_kolor()

{

var Miff = "Lubie Susla";

}

function cofaj()
{


if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="motocykl")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="sprzedam"))
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = b;
document.getElementById('nie_motocykl2').innerHTML = c;
document.getElementById('nie_motocykl3').innerHTML = d;

if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}

if(top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value!="")
{
document.ogl_mot.ii_typ_pojazdu.selectedIndex=top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value;
}

if(document.ogl_mot2.kolor2.value!="")
{
document.ogl_mot.kolor.value=document.ogl_mot2.kolor2.value;
}

if(document.ogl_mot2.rok_produkcji2.value!="")
{
document.ogl_mot.rok_produkcji.value=document.ogl_mot2.rok_produkcji2.value;
}

if(document.ogl_mot2.pojemnosc2.value!="")
{
document.ogl_mot.pojemnosc.value=document.ogl_mot2.pojemnosc2.value;
}

if(document.ogl_mot2.przebieg2.value!="")
{
document.ogl_mot.przebieg.value=document.ogl_mot2.przebieg2.value;
}

document.ogl_mot.typ_ogloszenia[0].checked=true;
document.ogl_mot.motocykl_czy_czesci[0].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="motorower")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="sprzedam"))
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = e;
document.getElementById('nie_motocykl2').innerHTML = c;
document.getElementById('nie_motocykl3').innerHTML = d;

if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}

if(top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value!="")
{
document.ogl_mot.ii_typ_pojazdu.selectedIndex=top.frames.b.document.znajdz_motocykl.ii_typ_pojazdu3.value;
}

if(document.ogl_mot2.kolor2.value!="")
{
document.ogl_mot.kolor.value=document.ogl_mot2.kolor2.value;
}

if(document.ogl_mot2.rok_produkcji2.value!="")
{
document.ogl_mot.rok_produkcji.value=document.ogl_mot2.rok_produkcji2.value;
}

if(document.ogl_mot2.pojemnosc2.value!="")
{
document.ogl_mot.pojemnosc.value=document.ogl_mot2.pojemnosc2.value;
}

if(document.ogl_mot2.przebieg2.value!="")
{
document.ogl_mot.przebieg.value=document.ogl_mot2.przebieg2.value;
}

document.ogl_mot.typ_ogloszenia[0].checked=true;
document.ogl_mot.motocykl_czy_czesci[1].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="czesci")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="sprzedam"))
{

document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}


document.ogl_mot.typ_ogloszenia[0].checked=true;
document.ogl_mot.motocykl_czy_czesci[2].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="inne")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="sprzedam"))
{
inne();
document.ogl_mot.typ_ogloszenia[0].checked=true;
document.ogl_mot.motocykl_czy_czesci[3].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="motocykl")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="szukam"))
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}

document.ogl_mot.typ_ogloszenia[1].checked=true;
document.ogl_mot.motocykl_czy_czesci[0].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="motorower")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="szukam"))
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}

document.ogl_mot.typ_ogloszenia[1].checked=true;
document.ogl_mot.motocykl_czy_czesci[1].checked=true;
}

if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="czesci")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="szukam"))
{
document.getElementById('nazwa_motocykla').innerHTML = a;
document.getElementById('nie_motocykl').innerHTML = '';
document.getElementById('nie_motocykl2').innerHTML = '';
document.getElementById('nie_motocykl3').innerHTML = '';
if(document.ogl_mot2.motocykl2.value!="")
{
document.ogl_mot.motocykl.value=document.ogl_mot2.motocykl2.value;
}


document.ogl_mot.typ_ogloszenia[1].checked=true;
document.ogl_mot.motocykl_czy_czesci[2].checked=true;
}



if((top.frames.b.document.znajdz_motocykl.motocykl_czy_czesci2.value=="inne")&(top.frames.b.document.znajdz_motocykl.typ_ogloszenia2.value=="szukam"))
{
inne();
document.ogl_mot.typ_ogloszenia[1].checked=true;
document.ogl_mot.motocykl_czy_czesci[3].checked=true;
}




if(document.ogl_mot2.tytul2.value!="")
{
document.ogl_mot.tytul.value=document.ogl_mot2.tytul2.value;
}


if(document.ogl_mot2.komentarz2.value!="")
{
document.ogl_mot.komentarz.value=document.ogl_mot2.komentarz2.value;
}

if(document.ogl_mot2.nazwisko2.value!="")
{
document.ogl_mot.nazwisko.value=document.ogl_mot2.nazwisko2.value;
}

if(document.ogl_mot2.adres_mailowy2.value!="")
{
document.ogl_mot.adres_mailowy.value=document.ogl_mot2.adres_mailowy2.value;
}

if(document.ogl_mot2.gg2.value!="")
{
document.ogl_mot.gg.value=document.ogl_mot2.gg2.value;
}

if(document.ogl_mot2.tel_kom2.value!="")
{
document.ogl_mot.tel_kom.value=document.ogl_mot2.tel_kom2.value;
}

if(document.ogl_mot2.tel_kom2.value!="")
{
document.ogl_mot.tel_kom.value=document.ogl_mot2.tel_kom2.value;
}

if(document.ogl_mot2.tel_dom2.value!="")
{
document.ogl_mot.tel_dom.value=document.ogl_mot2.tel_dom2.value;
}


if(document.ogl_mot2.tel_skype2.value!="")
{
document.ogl_mot.tel_skype.value=document.ogl_mot2.tel_skype2.value;
}


if(document.ogl_mot2.miejscowosc2.value!="")
{
document.ogl_mot.miejscowosc.value=document.ogl_mot2.miejscowosc2.value;
}


if(top.frames.b.document.znajdz_motocykl.wojewodztwo3.value!="")
{
document.ogl_mot.wojewodztwo.selectedIndex=top.frames.b.document.znajdz_motocykl.wojewodztwo3.value;
}



if(document.ogl_mot2.nazwa_fotki2.value!="")
{
document.ogl_mot.nazwa_fotki.value=document.ogl_mot2.nazwa_fotki2.value;

}



if(document.ogl_mot2.cena2.value!="")
{
document.ogl_mot.cena.value=document.ogl_mot2.cena2.value;
}

}


