$(document).ready(function(){
	   $("#content").slideDown("slow");
	   //$("#content").css("display", "block");
     $(".menu div").hover(function(){$(this).fadeTo("fast", 0.5);$(this).fadeTo("slow", 1);});

      $('#slideshow').innerfade({
        containerheight: '420px' 
       });
       
       $('#hp-slideshow').innerfade({
        containerheight: '420px' 
       }); 
       
       $('#slideshow.motability').innerfade({
        containerheight: '550px' 
       }); 

	}
);

function antispam(t) {
  t.spam.value=2;
  return true;
}


function check_form(t) {
if(document.form_book.byemail.checked) {
    if (!t.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
      alert("Your e-mail address doesn't seem to be correct!");
      t.email.focus();
      return false;
    }
    return true;
  }
}



function check_email(t){

  if(!t.email.value=='') {  

    if (!t.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {

      alert("Your e-mail address doesn't seem to be correct!");

      t.email.focus();

      return false;

    }

    return true;

  }

}



function numeric(t) {

  if (t.value.match(/\D/)) {

    t.value =

    t.value.replace(/\D/g,"");

  }

}





function upload(pole) {

  o = window.open("upload.php?p="+pole, "k", "width=500, height=100,"

   + " innerwidth=200,innerheight=200,location=0,status=0,"

   + " directories=0, scrollbars=0, menubar=0, toolbar=0, resizable=1");

  o.moveTo(screen.width/2-500/2,screen.height/2-100/2);

  o.focus();

   

  return false;

}



function file_check(t){

  //alert(t.plik1.value);

  if(!t.plik1.value=='') { 

   

    if (!t.plik1.value.match(/.jp/)) {

      alert("You can upload JPG files only!");

      t.plik1.focus();

      return false;

    }

    

    return true;

  }

}





function view(url, x, y) {

 okno = window.open("", "o", "width="+x+", height="+y+", left=100, top=25,"

   + " innerwidth="+x+", innerheight="+y+", location=0, directories=0,"

   + " scrollbars=0, menubar=0, toolbar=0, status=0, resizable=1");

 okno.document.open();

 okno.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"');

 okno.document.writeln('"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');

 okno.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" ');

 okno.document.writeln('xml:lang="pl"><head><meta http-equiv="Content-type"');

 okno.document.writeln(' content="text/html; charset=iso-8859-2" />');

 okno.document.writeln('<title>Used cars</title><style type="text/css"><!--');

 okno.document.writeln('body {margin:0px; padding:0px; background:white;}');

 okno.document.writeln('img {display:block; border:0px;}');

 okno.document.writeln('--></style></head><body>');

 okno.document.writeln('<a href="javascript:self.close()"><img ');

 okno.document.writeln('src="'+url+'" alt="Close" title="Close" /></a></body></html>');

 okno.document.close();

 okno.moveTo(screen.width/2-x/2,screen.height/2-y/2);

 okno.focus();

}



function zmien(wybor) {

  l2=document.f1.model;

  for (i=l2.options.length;i>=0;i--) l2.options[i]=null;

  for (i=0;i<opcje[wybor].length;i++)

    l2.options[i]=new Option(opcje[wybor][i].value,opcje[wybor][i].text);



  l3=document.f1.engine;

  for (i=l3.options.length;i>=0;i--) l3.options[i]=null;

  for (i=0;i<opcje2[wybor].length;i++)

    l3.options[i]=new Option(opcje2[wybor][i].value,opcje2[wybor][i].text);



}



function show_hide() {
  if (navigator.appName=="Microsoft Internet Explorer"
      && navigator.userAgent.indexOf("Opera")==-1) {
    typ = "block";
  } else {
    typ = "table-row";
}

  if (document.f1.noton.checked) {
    document.getElementById("manual").style.display=typ;
    document.getElementById("manual2").style.display=typ;
    document.f1.model.disabled=true;
    document.f1.engine.disabled=true;
    document.f1.lista1.disabled=true;
  } else {
    document.getElementById("manual").style.display="none";
    document.getElementById("manual2").style.display="none";
    document.f1.model.disabled=false;
    document.f1.engine.disabled=false;
    document.f1.lista1.disabled=false;
  }
}

/*
Author: Robert Hashemian
http://www.hashemian.com/

You can use this code in any manner so long as the author's
name, Web address and this disclaimer is kept intact.
********************************************************
Usage Sample:

<script type="text/javascript">
TargetDate = "12/31/2020 5:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>

*/

function calcage(secs, num1, num2) {
  s = ((Math.floor(secs/num1))%num2).toString();
  if (LeadingZero && s.length < 2)
    s = "0" + s;
  return "<b>" + s + "</b>";
}

function CountBack(secs) {
  if (secs < 0) {
    document.getElementById("cntdwn").innerHTML = FinishMessage;
    return;
  }
  DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
  DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
  DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
  DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));

  document.getElementById("cntdwn").innerHTML = DisplayStr;
  if (CountActive)
    setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
}

function putspan(backcolor, forecolor) {
 document.write("<span id='cntdwn' style='background-color:" + backcolor + 
                "; color:" + forecolor + "'></span>");
}

if (typeof(BackColor)=="undefined")
  BackColor = "white";
if (typeof(ForeColor)=="undefined")
  ForeColor= "black";
if (typeof(TargetDate)=="undefined")
  TargetDate = "12/31/2020 5:00 AM";
if (typeof(DisplayFormat)=="undefined")
  DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
if (typeof(CountActive)=="undefined")
  CountActive = true;
if (typeof(FinishMessage)=="undefined")
  FinishMessage = "";
if (typeof(CountStepper)!="number")
  CountStepper = -1;
if (typeof(LeadingZero)=="undefined")
  LeadingZero = true;


CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
  CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper>0)
  ddiff = new Date(dnow-dthen);
else
  ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(gsecs);

