














function MM_swapImgRestore() { //v3.0


    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;


}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function check() {
  var ext = document.dodaj_foto.plik.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg') {
    alert('Zły format pliku lub brak pliku !');
    return false; }
  else
    return true; }


function sprawdz_plik() {
  var spr_zwa = false;
  var ext = document.dodaj_foto.plik.value;
  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  //if(ext == '')
  //{

  //   alert('Nie wybrano pliku !');
 // }
 // else
 // {

     if(ext != 'jpg')
     {
          alert('Wybrany plik nie jest w formacie jpg !');
     }
     else
     {

       spr_zwa = true;
     }
  //}


return   spr_zwa;

}







function sprawdz_formularz()
{
   var prawda = false;
   var temat = document.user.temat.value;
   var data_czas =  document.user.data_czas.value;
   var wpis =  document.user.opis.value;

   if(temat == '' || data_czas == '' || wpis == '')
   {

      alert('Proszę wypełnic wszystkie pola');

   }
   else
   {


       var wyrazenie = /[1-9]{1}[0-9]{3}-[0-9]{2}-[0-9]{2}/;
       var wynik = wyrazenie.test(data_czas);
       if (wynik == false)
       {
          alert('Data ma zły format powinno być np: 2007-01-01');
       }
       else
       {

         prawda = true;
       }
  
  
   }
 return prawda;

}






 /*var ext = document.user.plik.value;


  ext = ext.substring(ext.length-3,ext.length);
  ext = ext.toLowerCase();
  if(ext != 'jpg') {
    alert('You selected a .'+ext+
          ' file; please select a .jpg file instead!');
    return false; }
  else
    return true; }*/




function okienko(url, width, height)
{
    width1=width/2;
    height1=height/2;
    x=screen.availWidth/2-width1;
    y=screen.availHeight/2-height1;
    var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=0, menubar=0, status=0, toolbar=0,left='+x+', top='+y);
    Win.focus();
}

function pop(sLink)
{

     if(sLink == 1)
     {
       sLink = 'http://www.lexus-polska.pl/technology_explorer/index.asp?model=3%5FGS%5F300%5F%26%5FGS%5F430'
     }
     
     if(sLink == 2)
     {
       sLink = 'http://www.lexus-polska.pl/technology_explorer/advanced_electronic_climate_control.asp?Model=All'
     }
     
     if(sLink == 3)
     {
       sLink = 'http://www.lexus-polska.pl/technology_explorer/electronically_controlled_continuously_variable_transmission_ECVT.asp?Model=All'
     }

     if(sLink == 4)
     {
       sLink = 'http://www.lexus-polska.pl/technology_explorer/impact_protection_features.asp?Model=All'
     }

     openpopup(sLink, 790, 555);



}


function pop2(sLink,szer,wys)
{


        openpopup(sLink,szer, wys);
}

function openpopup(sLink,iWidth,iHeight,left,name)
{
	if (left == null)
	{
		left = 0;
	}

	var G_day = new Date();
	var G_seed = G_day.getTime();
	var iRand = parseInt(((G_seed - (parseInt(G_seed / 1000, 10) * 1000)) / 10) / 100 * 100000 + 1, 10);

	if (name !== null)
	{
		iRand = name;
	}

	var winleft = ((screen.width - iWidth) / 2) - left;
	var winUp = (screen.height - iHeight) / 2;

	window.open(sLink,"tech_explorer","resizable=no,scrollbars=no,width=" + iWidth + ",height=" + iHeight + ",left=" + winleft + ",top=" + winUp);
}





function okno_f(picture)
{
NewWindow=window.open("","","width=600,height=600,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=no,resizable=yes,fullscreen=no");
NewWindow.document.open();
NewWindow.document.writeln("<html><head><title>Zdjęcia</title><link rel=stylesheet href=style/style.css type=text/css></link></head>");
NewWindow.document.writeln("<body  bgcolor=#084B65 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>");
NewWindow.document.writeln("<table width=100% height=100%>");
NewWindow.document.writeln("<tr><td valign=center align=center>\n<a href=\"javascript:window.close();\" id=\"pk\"><img src="+picture+" border=0 class=owoluta><br><br><b>Zamknij okno<b></a></td></tr>");
NewWindow.document.writeln("</table>");
NewWindow.document.writeln("</body>\n</HTML>\n");
NewWindow.document.close();
NewWindow.focus();
return;

}




function okno(picture)
{
NewWindow=window.open("","","width=740,height=600,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=no,resizable=yes,fullscreen=no");
NewWindow.document.open();
NewWindow.document.writeln("<html><head><title>Zdjęcia</title><link rel=stylesheet href=style/style.css type=text/css></link></head>");
NewWindow.document.writeln("<body  bgcolor=#084B65 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>");
NewWindow.document.writeln("<table width=100% height=100%>");
NewWindow.document.writeln("<tr><td valign=center align=center>\n<a href=\"javascript:window.close();\" id=\"pk\"><img src="+picture+" border=0 class=owoluta><br><br><b>Zamknij okno<b></a></td></tr>");
NewWindow.document.writeln("</table>");
NewWindow.document.writeln("</body>\n</HTML>\n");
NewWindow.document.close();
NewWindow.focus();
return;

}

function pokarz_obraz_wielki(picture)
{
NewWindow=window.open("","","width=1024,height=728,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=no,resizable=yes,fullscreen=no");
NewWindow.document.open();
NewWindow.document.writeln("<html><head><title>Zdjęcia</title><link rel=stylesheet href=style/style.css type=text/css></link></head>");
NewWindow.document.writeln("<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>");
NewWindow.document.writeln("<table width=100% height=100%>");
NewWindow.document.writeln("<tr><td valign=center align=center>\n<a href=\"javascript:window.close();\" id=\"pk\"><img src="+picture+" border=0 class=owoluta><br><br><b>Zamknij okno<b></a></td></tr>");
NewWindow.document.writeln("</table>");
NewWindow.document.writeln("</body>\n</HTML>\n");
NewWindow.document.close();
NewWindow.focus();
return;

}


function pokarz_tekst(jaki_tekst)
{
   window.film.location.href = jaki_tekst;

}



function sprawdz_dane()
{

   var zmienna_p2 = false;
   var zmienna_p3 = 1;

   var model =   document.wys_auta.model.value;
   var data_r =  document.wys_auta.data_r.value;
   var rok_p  =   document.wys_auta.rok_p.value;
   var przebieg = document.wys_auta.przebieg.value;
   var pojemnosc  =  document.wys_auta.pojemnosc.value;
   var moc      = document.wys_auta.moc.value;
   var paliwo   =   document.wys_auta.paliwo.value;
   var skrzynia_b =document.wys_auta.skrzynia_b.value;
   var kolor     =document.wys_auta.kolor.value;
   var cena      = document.wys_auta.cena.value;
   var historia  = document.wys_auta.historia.value;
   var wyposarzenie  =  document.wys_auta.wyposarzenie.value;
   var opis       =  document.wys_auta.opis.value;

   var wuswietl_model =   document.wys_auta.wuswietl_model.checked;
   var wuswietl_data_r =  document.wys_auta.wuswietl_data_r.checked;
   var wuswietl_rok_p  =   document.wys_auta.wuswietl_rok_p.checked;
   var wuswietl_przebieg = document.wys_auta.wuswietl_przebieg.checked;
   var wuswietl_pojemnosc  =  document.wys_auta.wuswietl_pojemnosc.checked;
    var wuswietl_moc      = document.wys_auta.wuswietl_moc.checked;
   var wuswietl_paliwo   =   document.wys_auta.wuswietl_paliwo.checked;
   var wuswietl_skrzynia_b =document.wys_auta.wuswietl_skrzynia_b.checked;
   var wuswietl_kolor     =document.wys_auta.wuswietl_kolor.checked;
   var wuswietl_cena      = document.wys_auta.wuswietl_cena.checked;
   var wuswietl_historia  = document.wys_auta.wuswietl_historia.checked;
   var wuswietl_wyposarzenie  =  document.wys_auta.wuswietl_wyposarzenie.checked;
   var wuswietl_opis       =  document.wys_auta.wuswietl_opis.checked;



   if(wuswietl_model == true && model == '' )
   {
       alert1 = 'Pole model jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert1 = '';

   }
   if(wuswietl_data_r == true && data_r == '' )
   {
       alert2 = 'Pole data pierwszej rejestracji jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert2 = '';

   }
   if(wuswietl_rok_p == true && rok_p == '' )
   {
       alert3 = 'Pole rok produkcji pierwszej rejestracji jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert3 = '';

   }

   if(wuswietl_przebieg == true && przebieg == '' )
   {
       alert4 = 'Pole przebieg jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert4 = '';

   }

   if(wuswietl_pojemnosc == true && pojemnosc == '' )
   {
       alert5 = 'Pole pojemność jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert5 = '';

   }

    if(wuswietl_moc == true && moc == '' )
   {
       alert6 = 'Pole moc jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert6 = '';

   }

   if(wuswietl_paliwo == true && paliwo == '' )
   {
       alert7 = 'Pole paliwo jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert7 = '';

   }

   if(wuswietl_skrzynia_b == true && skrzynia_b == '' )
   {
       alert8 = 'Pole skrzynia biegów jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert8 = '';

   }

   if(wuswietl_kolor == true && kolor == '' )
   {
       alert9 = 'Pole kolor jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert9 = '';

   }

    if(wuswietl_cena == true && cena == '' )
   {
       alert10 = 'Pole cena jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert10 = '';

   }

   if(wuswietl_historia == true && historia == '' )
   {
       alert11 = 'Pole historia pojazdu jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert11 = '';

   }

   if(wuswietl_wyposarzenie == true && wyposarzenie == '' )
   {
       alert12 = 'Pole wyposarzenie jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert12 = '';

   }


   if(wuswietl_opis == true && opis == '' )
   {
       alert13 = 'Pole opis jest zaznaczone ale nie ma wpisu !\n';
       zmienna_p3++;
   }
   else
   {   alert13 = '';

   }


      if(zmienna_p3 > 1)
   {

      alert(alert1+alert2+alert3+alert4+alert5+alert6+alert7+alert8+alert9+alert10+alert11+alert12+alert13)
   }
   else
   {

    zmienna_p2 = true;
   }

   return  zmienna_p2;

}





function wysokosc_ekranu(obiekt_wys)
{

if(navigator.userAgent.indexOf("Opera")>-1)
{

var szerokosc = window.innerHeight;
var do_wzrotu = (szerokosc-obiekt_wys)/2;

}
else if(navigator.userAgent.indexOf("Firefox")>-1)
{

var szerokosc = window.innerHeight;
var do_wzrotu = (szerokosc-obiekt_wys)/2;
}

else if(navigator.appVersion.indexOf("MSIE")>-1)
{

var szerokosc = document.body.offsetHeight;
var do_wzrotu = (szerokosc-obiekt_wys)/2;
}
else
{
var szerokosc = window.innerHeight;
var do_wzrotu = (szerokosc-obiekt_wys)/2;
}

return  do_wzrotu;
}





function srodek_ekranu(obiekt_szer)
{

if(navigator.userAgent.indexOf("Opera")>-1)
{

var szerokosc = window.innerWidth;
var do_wzrotu = (szerokosc-obiekt_szer)/2;

}
else if(navigator.userAgent.indexOf("Firefox")>-1)
{

var szerokosc = window.innerWidth;
var do_wzrotu = (szerokosc-obiekt_szer)/2;
}

else if(navigator.appVersion.indexOf("MSIE")>-1)
{

var szerokosc = document.body.offsetWidth;
var do_wzrotu = (szerokosc-obiekt_szer)/2;
}
else
{
var szerokosc = window.innerWidth;
var do_wzrotu = (szerokosc-obiekt_szer)/2;
}

return  do_wzrotu;
}


function pokarz_diva2(id,ile_wszystkich,id_licz)
{
  var liczba_st = 1;

  while(liczba_st <= ile_wszystkich)
  {
    prze = 'ft'+liczba_st;

    if(id_licz == liczba_st)
    {

       if(navigator.appVersion.indexOf("MSIE")>-1)
       {
         document.getElementById(id).style.left = srodek_ekranu(440)-20;
       }
       document.getElementById(id).style.top = wysokosc_ekranu(300)-100;
      document.getElementById(id).style.visibility="visible";

    }
    else
    {
      document.getElementById(prze).style.visibility="hidden";
    }

    liczba_st = liczba_st+1;
  }

}


function pokarz_pre()
{
  do_alertu =  srodek_ekranu(370);
  do_alertu2 =  wysokosc_ekranu(300);
  //alert(do_alertu2);
  
  document.getElementById("wgrywanie").style.left= do_alertu;
  document.getElementById("wgrywanie").style.top= do_alertu2;
  document.getElementById("wgrywanie").style.visibility="visible";
}



function sprawdz_czy_liczba(opcja)
{
  var do_testu = opcja.value;
  var wyrazenie = /[a-zA-Z- .,;:\"\'\#\~\!\@\$\%\`\^\&\+\*\(\)\-\_\=\|\{\}\{\}\>\<\?\/\\]/;
  var wynik = wyrazenie.test(do_testu);
  if (wynik == true)
  {
    alert('Wprowadz tylko liczbę!')
    opcja.value = "";
  }
}

